PDA

View Full Version : Preloader for multiple scenes?


ru100
06-11-2003, 03:26 PM
Hi,
Do you guys know of a simple preloader for a flash file with multiple scenes? I have about 10 scenes in my movie....and all the newbie preloaders that I'm finding only account for only a one scene movie.

Thanks!
Ruthie

Fugee
06-11-2003, 03:40 PM
use the _root.getBytesLoaded() and _root.getBytesTotal() preloader instead of the Scene# frame# one.

For example put this code on the first keyframe of your "preloader" scene:
loaded_bytes = _root.getBytesLoaded();
total_bytes = _root.getBytesTotal();
percent_loaded = Math.round((loaded_bytes/total_bytes)*100);
//you can add actions for your bars and texts here
if (loaded_bytes >= total_bytes) {
gotoAndPlay("main_movie")/*main_movie is the frame label where
your actual movie begins, it can be on a different Scene*/
}
and in the second keyframe
gotoAndPlay(1);
this kind of preloader should load all your movie (all the Scenes) before it actually starts playing the rest ;)

Hope this helps you!