Hi all, i’m trying to modify the slideshow for multiple xml gallery.
I have the code on the first frame and I want to load another xml (aria.xml) ,but if I use
on(release){
xmlData.load(“aria.xml”);
}
it work but not well, the loop crash.
How I do this?
Thank you!
function loadXML(loaded)
{
if (loaded)
{
xmlNode = this.firstChild;
image = [];
link = [];
total = xmlNode.childNodes.length;
for (i = 0; i < total; i++)
{
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
link* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
//trace(link*);
} // end of for
firstImage();
}
else
{
content = “file not loaded!”;
} // end else if
} // End of the function
function fadeIn()
{
onEnterFrame = function ()
{
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize)
{
preloader.preload_bar._xscale = 100 * loaded / filesize;
}
else
{
preloader._visible = false;
if (picture._alpha < 100)
{
picture._alpha = picture._alpha + 5;
}
else
{
delete onEnterFrame;
slideshow();
} // end else if
} // end else if
};
} // End of the function
function fadeOut()
{
onEnterFrame = function ()
{
if (picture._alpha > 5)
{
picture._alpha = picture._alpha - 5;
}
else
{
picture._alpha = 0;
delete onEnterFrame;
nextImage();
} // end else if
};
} // End of the function
function nextImage()
{
if (p < total - 1)
{
++p;
picture._alpha = 0;
if (loaded == filesize)
{
picture.loadMovie(image[p], 1);
picture_num();
fadeIn();
} // end if
} // end if
} // End of the function
function firstImage()
{
init = true;
picture._alpha = 0;
picture.loadMovie(image[0], 1);
picture_num();
fadeIn();
} // End of the function
function picture_num()
{
current_pos = p + 1;
pos_txt.text = current_pos + " / " + total;
} // End of the function
function slideshow()
{
function pause_slideshow()
{
clearInterval(myInterval);
if (p == total - 1 && !init)
{
p = 0;
firstImage();
}
else if (p == total - 1 && init)
{
p = -1;
fadeOut();
}
else
{
fadeOut();
} // end else if
} // End of the function
myInterval = setInterval(pause_slideshow, delay);
} // End of the function
var delay = 5000;
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“images.xml”);
p = 0;