Langy
03-31-2006, 12:21 AM
Ok I'm really having troubles with setInterval.
I have created a loop to load in 8 mc's and at the same time I want a short delay between each one.
No matter what I try I still can not get this to work. I've tried placing the clearInterval where it is shown and also in the next line after the setInterval.
At the moment, I think there is a short delay before the mc's are loaded but then it loads them all at once.
Any assistance much appreciated.
for (lp=1; lp<9; lp++) {
interval = setInterval(LoadGallery, 1000,lp);
}
function LoadGallery(i) {
var mcIdent = "Gal" + i + "_mc";
_root.createEmptyMovieClip("Gal" + i + "_mc", 50+i);
_root["Gal"+i+"_mc"].attachMovie("Pic0" + i,"Pic0" + i,250+i);
_root["Gal"+i+"_mc"]._xscale = 25;
_root["Gal"+i+"_mc"]._yscale = 25;
_root["Gal"+i+"_mc"]._x = galx[i-1];
_root["Gal"+i+"_mc"]._y = galy[i-1];
clearInterval(interval);
}
I have created a loop to load in 8 mc's and at the same time I want a short delay between each one.
No matter what I try I still can not get this to work. I've tried placing the clearInterval where it is shown and also in the next line after the setInterval.
At the moment, I think there is a short delay before the mc's are loaded but then it loads them all at once.
Any assistance much appreciated.
for (lp=1; lp<9; lp++) {
interval = setInterval(LoadGallery, 1000,lp);
}
function LoadGallery(i) {
var mcIdent = "Gal" + i + "_mc";
_root.createEmptyMovieClip("Gal" + i + "_mc", 50+i);
_root["Gal"+i+"_mc"].attachMovie("Pic0" + i,"Pic0" + i,250+i);
_root["Gal"+i+"_mc"]._xscale = 25;
_root["Gal"+i+"_mc"]._yscale = 25;
_root["Gal"+i+"_mc"]._x = galx[i-1];
_root["Gal"+i+"_mc"]._y = galy[i-1];
clearInterval(interval);
}