Today I spent many hours researching the best way to create a progress bar for my existing LindsayRyerse.com website. It had been a while since I had updated it, so I figured that would be a good place to start. Unfortunately I ran into a lot of trouble getting the loading bar to start at (or even near) zero percent. After reading countless blogs and testing several different code suggestions, thanks to this tutorial (www.senocular.com/flash/tutorials/preloading/) I finally found a solution that worked. And just for the sake of reference, that tutorial uses ActionScript 2.0 which is exactly what I was looking for.
There are two options for preloading a SWF that dynamically loads movie clips that are exported in the first frame. To learn more about this issue, see here (www.senocular.com/flash/tutorials/preloading/#loadingcomplications). The first is to create a ‘loading’ frame inserted after the end of your preloading frames where you can manually load each movie. So instead of setting each movie to export, add all the movies to this single frame instead. This will allow the preloader animation itself to load and start running before any movie clips (which will later be dynamically called) are loaded. When movie clips are dynamically called, by default, Flash loads them in the very first frame so that they are available any any point in the time line. While this solution would work, it seems to add extra work and remove the flexibility of dynamically adding movie clips in the first place. Since it had been over a year since I last update my site, I had no interest in going back through it to find and change every movie clip I exported to the first frame to instead load in a single frame after my preloading animation.
Fortunately, I came stumbled across another (and in my opinion better) option, loading my SWF from another SWF to eliminate the issue of first frame exporting completely. To implement this scenario I created a new Flash SWF containing my preloading animation, which after execution, loaded my original SWF into it. This way I could ensure that the preloading animation began before the orginal movie clips even had a chance to. To read more about this, see this link (www.senocular.com/flash/tutorials/preloading/#loadingexternalcontent).
The final solution I ended up using on my site was largely based off of the MovieClipLoader class and Example 5 which can be found here (http://www.senocular.com/flash/tutorials/preloading/#themoviecliploaderclass). So just like that, LindsayRyerse.com finally comes complete with a loading bar which will hopefully ease any user frustration.