Single-movie Flash Preloading with AS3

Posted on Oct 18, 2011

Way back in the AS2 days, you could write Actionscript preloaders that could run inside the same *.fla/swf file as your main movie/site/app/animation.  Useing frames and checking the movie size vs the bytes loaded, you could figure out when the movie was completely in memory and readyfor use.  With AS3, with class files and proper object-oriented structures, it became less clear as to how you were supposed to do this.

Generally everything in your library was being exported on frame 1, so how could you put a preloader there?  Frame 1 would need to load first before it would execute, and by then its too late for the preloader to do anything.  So it seemed like the consensus amongst the people I talked to and worked with was that you needed to a build a separate pre-loader movie which would load the main movie.