Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   _width & _height (http://www.flasher.ru/forum/showthread.php?t=124357)

Finigan 27.04.2009 21:50

_width & _height
 
В мувиклипе находится контейнер, в него через xml подгружаются картинки. Подскажите как указать контейнеру (рисунку), чтобы он растягивался по размеру swf, заполняя всё пространство но при этом не искажался,пусть даже выходя одним краем за пределы swf
код на основной временной шкале:
Код AS1/AS2:

System.useCodepage = true;
Stage.align = "tl";
Stage.scaleMode = "noScale";
_root.res = new Object();
res.onResize = function ()
{
    Fun_Resize(Stage.width, Stage.height);
};
Stage.addListener(res);
res.onResize();
_root.ArrRazdel = [];
 
function initGallery()
{
    function loadXML(loaded)
    {
        if (loaded)
        {
            xmlNode = this.firstChild;
            total = xmlNode.childNodes.length;
            for (i = 0; i < total; i++)
            {
                                _root.big_image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
                _root.description[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
                if (i == 0)
                {
                    _root.loadGImage(_root.description[i], _root.big_image[i]);
                } // end if
                _root.total_images++;
            } // end of for
        }
        else
        {
            content = "file not loaded!";
        } // end if
    } // End of the function
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    if (_root.xml_file == undefined)
    {
        _root.xml_file = "images.xml";
    } // end if
    xmlData.load(xml_file);
} // End of the function
 
function loadGImage(title, bigImgURL)
{
    _root.bigImage.imageContainer.loadMovie(bigImgURL,100);
}
_root.description = new Array();
_root.big_image = new Array();
_root.total_images = 0;
initGallery();

в мувике:
Код AS1/AS2:

filesize = imageContainer.getBytesTotal();
loaded = imageContainer.getBytesLoaded();
if (loaded != filesize) {
        preloader._visible = true;
        preloader.preload_bar._xscale = 100*loaded/filesize;
        firstTimeIn = false;
} else {
        preloader._visible = false;
        if (imageContainer._alpha<100) {
                imageContainer._alpha = imageContainer._alpha+5;
        }
        // end if
    if (firstTimeIn == false)
    {
        xGoTo = undefined;
        yGoTo = undefined;
        imageContainer._x = 0;
        imageContainer._y = 0;
                imageContainer._width = 100;
                imageContainer._height = 100;
        imageContainer._alpha = 0;
        firstTimeIn = true;
    } // end if
} // end if

сильно не рурайте. подскажите как сделать

iNils 27.04.2009 22:28

На форуме запрещено обсуждение кода полученного в результате декомпиляции.


Часовой пояс GMT +4, время: 15:44.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.