I have created a preloader with the following script placed in the first frame of my movie:
stop();
myInterval = setInterval(preloader, 10);
function preloader() {
if (getBytesLoaded()>=getBytesTotal()) {
play();
clearInterval(myInterval);
}
LoadText.text = “LOADING:”+Math.round(getBytesLoaded()/getBytesTotal()*100)+"%";
}
The animation begins in frame 2.
The problem is that if the user gets impatient waiting for the movie to load, and clicks on another link to load a different movie, that second movie will load and then loop continually (even though there is a stop in the last frame). Then, no matter which movie is loaded next, it will loop as well, and on and on.
If you were to wait until each movie is loaded before loading the next, everything works fine.
What am I doing wrong?