Показать сообщение отдельно
Старый 05.03.2008, 13:22
MuShr00mer вне форума Посмотреть профиль Отправить личное сообщение для MuShr00mer Найти все сообщения от MuShr00mer
  № 3  
Ответить с цитированием
MuShr00mer

Регистрация: Jan 2007
Сообщений: 24
xml
Код:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
    <pic>
        <image>gallery/1.jpg</image>
        <thumbnail>gallery/s1.jpg</thumbnail>
        <caption>описание</caption>
    </pic>
</images>
галерея:
Код:
function initGallery()
{
    function loadXML(loaded)
    {
        if (loaded) 
        {
            xmlNode = this.firstChild;
            total = xmlNode.childNodes.length;
            i = 0;
            while (i < total) 
            {
                _root.small_image[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
                _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]);
                }
                ++i;
            }
            createSmall();
            _root.downloadButton._visible = true;
            return;
        }
        content = "файл не загрузился!";
    }
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    if (_root.xml_file == undefined) 
    {
        _root.xml_file = "images2.xml";
    }
    xmlData.load(xml_file);
}
function createSmall()
{
    _root.smallContainer.createEmptyMovieClip("smallImageContainer", 10);
    var __reg4 = 0;
    var __reg3 = 0;
    var __reg2 = 0;
    while (__reg2 < _root.small_image.length) 
    {
        _root.smallContainer.imageContainer.attachMovie("smallImage", "smallImage_" + __reg2, 100 + __reg2);
        m = _root.smallContainer.imageContainer["smallImage_" + __reg2];
        m._x = __reg3 * 50;
        m._y = 0;
        m.imageContainer.loadMovie(_root.small_image[__reg2], 100);
        m.iData = Array();
        m.iData.big = _root.big_image[__reg2];
        m.iData.title = _root.description[__reg2];
        ++__reg3;
        ++__reg2;
    }
    _root.smallImageContainer._x = 5;
    _root.smallImageContainer._y = 0;
}
function loadGImage(title, bigImgURL)
{
    _root.bigImage.imageContainer.loadMovie(bigImgURL, 100);
    _root.bigImage.imageContainer._x = 0;
    _root.bigImage.imageContainer._y = 0;
    _root.title.text = title;
    _root.downloadButton.onRelease = function ()
    {
        getURL(bigImgURL, "_blank");
    }
    ;
}
_root.description = new Array();
_root.small_image = new Array();
_root.big_image = new Array();
initGallery();
downloadButton._visible = false;
я же говорю, если просто запускать swf с галереей, все работает, а если галерею подгружать в другой swf, не работает xml файл..

на всякий случай.. подгружаю так:
Код:
_root.createEmptyMovieClip("container",1);

_root.container.loadMovie("gallery.swf");