For a recent project, I had the need for a swf to ‘load itself’. This is challenging in an AS3-Only Project because all code and compile-time assets are baked in, and baked-in to ‘frame 1′ of the application. Flash can’t show ANYTHING until all filesize for frame1 is loaded.
Solution? – The (un)documented Frame Metadata Tag. Thanks to Keith Peters’ bit-101 for background info. I’ve created a great demo that is simple to follow.
FYI – This is basically how Flex works, showing a preloader before it loads (in a 1-swf setup).
If you want your ‘SystemManager’ class in this demo to be more configurable. Consider using ‘Custom Compiler Arguments’. See this post.
- Checkout the sourcecode (See ‘Member Resources’ below) for a simple example.