AS: Preloader not appearing 2006-08-05 15:54:54
So there you go innocently making a flash game with a preloader. You add some music and make it export on the first frame and then WHAM! All the sudden when you load your game up to Newgrounds, the preloader never appears. "WHYYYYY??!" you lament, while Newgrounds users 0-vote your movie into destruction and then your computer explodes and you are left staring at your ash-covered monitor and fried hard drive, wondering why you never bothered to look up preloader problems or test your preloader before this horrible travesty.
(Based on a true story)
Anyways, with the introduction out of the way, you may have noticed if you try to give symbols linkage names in Flash that your preloader takes longer to show up. Sometimes, if your music file is big and your actual game/animation is relatively small, it might not show up until it's done. Although this isn't a horrible problem, it does leave a bad first impression and perfectionists like me prefer to have a better way to solve it :D
The way to fix this goes as follows:
1) Hit Ctrl+L and then sort it by Linkage. Scroll down to the bottom and for every movieclip/music that you have, right click it, go to Linkage, and decheck Export in First Frame.
2) In your preloader scene, make a useless frame that the movie will never see. In this frame, put in everything that you just dechecked. If you have more then one audio, you can have seperate movie clips containing it, or just put it in seperate frames.
This works because you aren't loading the Audio in the first frame any more, but it is loaded once Flash loads that particular frame, so you can still use it in your ActionScript.
I really wish that Adobe would implement a cleaner, less hack-ish way of doing this though
3) What if your preloader and first frame of the movie are both on the first frame? This is a problem because if you put your audio or something else on that frame, it will load it first anyways and the preloader wont show up, but if you put it on a different frame, it wont load until it actually encounters that frame. (Honestly I have no idea why that happens)
My way around it was to just have it gotoAndStop() to a frame with everything on it, and then have that frame order it to gotoAndStop() right back.
Hope this helps someone. Its rather undocumentated around NG.