brockus
February 28th, 2003, 05:05 PM
I've been reading a Flash help book, and it tries to explain how you can use Action script to create a preloader that will play a movie clips frames based on the amount of bytes loaded. I can't seem to get it to work. Here is the code:
stop();
myInterval = setInterval(preloader,10);
function preloader() {
if (getBytesLoaded()>=getBytesTotal()) {
play();
clearInterval(myInterval);
}
myMovieClip.gotoAndStop(Math.round(_framesloaded/_totalframes*(myMovieClip._totalframes)));
}
This is on the first frame of my movie. I've also have a stop action on the first frame of my movie clip.
I've attached the FLA for dissection....any hints?
stop();
myInterval = setInterval(preloader,10);
function preloader() {
if (getBytesLoaded()>=getBytesTotal()) {
play();
clearInterval(myInterval);
}
myMovieClip.gotoAndStop(Math.round(_framesloaded/_totalframes*(myMovieClip._totalframes)));
}
This is on the first frame of my movie. I've also have a stop action on the first frame of my movie clip.
I've attached the FLA for dissection....any hints?