Hi,
after using setInterval a billion times, i am now having the most unbelievable problems with it!!!
i got some buttons, when clicked they call a daisychain of functions, ending with a loadMovie function:
function loadInMovie(clickedButt, arrayPos){
contentMain.detail.detailImage.holderMc.loadMovie(array_clientImage[arrayPos]);
meMov = setInterval(loadUp, 15);
}
so this triggers:
function loadUp() {
contentMain.preloader._alpha = 100;
var bytesL = contentMain.detail.detailImage.holderMc.getBytesLoaded();
var bytesT = contentMain.detail.detailImage.holderMc.getBytesTotal();
var percent = bytesL/bytesT*100;
if (bytesL>=bytesT && bytesT>4) {
trace("done loading");
loaderOff();//function to clear preloader
clearInterval(meMov);
} else {
contentMain.preloader._xscale = percent;
}
}
pretty standard right? Ok so when i click a link, the preloader kicks in and it works fine, calling loadOff() and tracing “done loading”.
if i then press another button same thing.
BUT if i press another button before the current movie has finished loading, the preload bar adjusts and loads the new movie, but when complete, i get an infinite loop of traces and the loaderOff function doesn’t kick in.
so i guess the clearInterval is breaking down, but why? and how to fix?
basically the **** thing breaks down on me!!!
please, any ideas why? i’m losing my mind on this one!