Technology
 

Percentage preloader

From Flash Wiki

Creating a preloader is easy!!! The easiest one is:

  • Make a dynamic text field with an instance name of preload.
  • Use this ActionScript:
   stop();
   
   if(getBytesLoaded() == getBytesTotal()) {
       play();
   }
   preload.text = Math.round(getBytesLoaded()/getBytesTotal()*100)
  • Explanation: It stops the timeline, and if all the bytes that have been loaded equals the total number of bytes, play the rest of the timeline.