Question

I would like to have just a single preloader in the beginning of a SWF movie and I want it to show the total download progress of multiple external resources (pictures, sounds, other SWF files, etc.)

Is it possible to preload multiple resources in one go and display their total progress with a single preloader?

To be more specific: the movie starts, the preloader loads and gets displayed, then the preloader is displaying 0% progress and builds up to 100% while it loads sounds, images and other SWF files in the background, then when all resources are loaded, preloader goes away and movie continues with the available resources ready to be attached.

Was it helpful?

Solution

There's a limit to the amount of Loader instances you can have open at once - Normally I use between 5 and 10. Any more than that and old ones will be reused.

Getting a single display to go from 0% to 100% will be quite hard, as until you know the size (i.e. you create the Loader and start loading), you can't determine what's 100%. In that case, you can either hack it - have a list and assign each file a % (i.e. game.xml is about 5%, assets.swf is about 40%...), or start loading, read the file size, quit until you have the size of everything, then load them in.

Another thing you can do is have 2 bars; one that display the % of the current file loading, and the other that displays the % of files loaded.

For easy loading of multiple files, check out something like BulkLoader - it takes care of all the grunt work for you (though I think they do the "estimate" system for determining when you're at 100%).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top