This is a tutorial for a simple preloader.
This is a simple preloader for your movie, which has 100 frames and allows to play an animation during loading. Create your movie and leave about 4 frames empty at the beginning. Also create frames to add framenames. In frame 2 write a framename like preload_Loop and in frame 5 of your movie a framename like begin_Movie. In frame 4 add this script in an actionframe:
loadedBytes = _root.getBytesLoaded();
totalBytes = _root.getBytesTotal();
if (loadedBytes < totalBytes){
frame = int(loadedBytes/(totalBytes/100));
_root.loaderBar.gotoAndStop (_root.frame);
gotoAndPlay ("preload_Loop");
}else{
gotoAndPlay("begin_Movie");
}
In frame 5 add a stop(); command. Now create a movieclip with 100 frames and name it loaderBar. Make a bar and extend the bar using a tween. If you like create an additional animation spanning over the 100 frames to entertain the users. Test your movie now.
For more complex movies, which have components download and check the component preloader.