I have a flash projector file which is loading in 2 xml files: one containing text only, the other containing URL to both SWF & image files. This projector runs pretty much 24/7. We are running into issues where after 2-3 days the projector files starts lagging when loading in the images and/or swf files. The actionscript loops through the XML file and uses loadMovie to load the images/swfs into an empty movie clip. Every 15 seconds it loads the next image in the XML file into the movie clip.
Is there a more efficient way to load the external images into the projector?
Is there a more efficient way to load the external images into the projector?
Code:
delay = 15000;
function loadXMLAds(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
j = 0;
for (i=0; i<total; i++) {
image[j] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
j++;
}
arrTotal = image.length;
firstImage();
}
}
function firstImage() {
picture.loadMovie(image[0], 1);
slideshow();
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (arrTotal-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}
p = 0;
function nextImage() {
if (p<(arrTotal-1)) {
p++;
picture.loadMovie(image[p], 1);
slideshow();
}
}