hello pixel lovers,
I grabbed the script from kirupa and tried to apply it to the movie but got a preloading issue…
The problem is with the preloading and the interval i believe, it really works well in the flash downloading simulation but goes crazy online. The slideshow should start only when the preloading of each picture is over. Here it seems that the slideshow continue playing even if the picture is not fully loaded.
Hope you can figure that mystery for me.
Thanks for your help amigo,
Val.
Here’s the beastie //////////////////////
stop();
portfolioInfo = new XML();
portfolioInfo.ignoreWhite = true;
portfolioInfo.onLoad = loadXML;
portfolioInfo.load(“GALLERY/intro.xml”);
function loadXML(loaded, filesize) {
count = this.firstChild.childNodes.length;
currentIMAGE = [];
for (i=0; i<count; i++) {
currentIMAGE* = this.firstChild.childNodes*.attributes.IMAGE;
firstImage();
}
}
p = 0;
function nextImage() {
if (p<(count-1)) {
p++;
if (loaded == filesize) {
_root.image_mc._alpha = 0;
_root.image_mc.loadMovie(currentIMAGE[p]);
}
} else if (p == (count-1)) {
p = 0;
if (loaded == filesize) {
_root.image_mc._alpha = 0;
_root.image_mc.loadMovie(currentIMAGE[p]);
}
}
}
//
function firstImage() {
if (loaded == filesize) {
_root.image_mc._alpha = 0;
_root.image_mc.loadMovie(currentIMAGE[0]);
slideshow();
}
}
//
delay = 3000;
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
nextImage();
}
}
// ====== preloader
this.onEnterFrame = function() {
filesize = image_mc.getBytesTotal();
loaded = image_mc.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (image_mc._alpha<100) {
image_mc._alpha += 10;
}
}
};
/////////////////