AS 3 Runtime Assets Explorer
September 13th, 2007
For the past few days I have been doing research on how to build skinnable applications for MLB.com. The goal is to load an external swf with assets that someone in the design department could publish. Today I hit the jackpot!
Ever since my miss hap with Flash Player 9,0,45 for the Draft I have not had an easy time convincing people at work that it is safe to go back into AS 3 pool. Lucky Myles, another Flash Developer here, has built a new chat program in Flex 2 opening the door a little bit more for me. The only thing I have to prove is that AS 3 offered some insane advantage over AS 2 in the form or loading external assets and keep the application working for Player version 9,0,281. Here is what I found: Runtime Assets Explorer
So whats the big deal? Well if you work in a company that has many sites that use the same Flash Application but different designs2 you quickly find that maintaining each of these flavors is a big pain in the ass. The goal has always been to have 1 application but have it load all of it’s assets externally freeing up developers from rebuilding the app with every new design change. Compound the issue with designers who are not comfortable enough to work in code heavy FLAs that need to be republish and you are looking at a headache for any Flash Developer.
With this example on Adobe’s Live Docs it is now possible to have an exernal swf with assets and never have to touch the dreaded shared library option in Flash. This opens up a whole world of other cool things one can do with dynamically loaded assets. Take a read and download the example. As I play with this I will continue to post updates on my progress.
I did have one issue with the example. As you will soon find out the trick to retrieving the external swf’s assets involves a spacial document class. This class has a method called getAssets(). In theory this is great but the reality of it is that you have to define all of you library classes in this method or they will not be accessible from the master swf. Here is a sample:
return [ "com.example.programmingas3.runtimeassetexplorer.AnimatingBox",
"com.example.programmingas3.runtimeassetexplorer.AnimatingStar" ];
}
As you can see this works great, but if you want this to be more dynamic it may be a problem. In the end it shouldn’t really be an issue considering you would want your external file to have all the assets it needs defined before you hand it off to a designer to reskin, but now you are looking at having to pass off classes and support code to the designer that may lead to compile issues if they are not use to flash. We will see how this pans out.
- 9,0,28 was the version flex 2 was built for and is the version that Adobe says has over 80% penetration rate. [↩]
- Check out these sites: MLB.com, MiLB.com, MLSnetwork.com, IceNetwork.com, Elton John and BobMarley.com. [↩]












Leave a Reply