A good designer-developer workflow is incredibly powerful in Flash Platform Development. Isolating the ‘art’ from the ‘code’ will allow both parts of your project to progress with limited dependence on the other. This will lead to more innovative ideas, a more flexible project, and less headaches for staff.
There are many ways to incorporate your assets into a Flex (or AS3-Only project). Run-time loading reduces the footprint of your primary swf, but compile-time assets are more straightforward to implement and deploy.
For my projects (often AS3-Only projects authored OUTSIDE of the Adobe Flash CS5 program), or Flex 4.x projects – the assets are created in Flash CS5 and imported at compile-time.
The Flash ‘Embed’ tag handles this. There are many flavors of this. What I like is to have one fla generating one swf, that contains linked symbols (MovieClips and Sprites). I extend ONLY MovieClip and Sprite within Flash. For custom classes, I’ll make the connection between the code and the asset outside of Flash FLA. This reduces the ‘code’ that is in the faces of your artist, and reduces any programatic reason to open the Flash FLA. Thus, your artists can work in Flash-IDE and your developers can work not-in-Flash-IDE (Flash Builder, FDT, FlashDevelop, whatever…)
FYI, I use swf, not swc for one reason. The swc makes the assets available (in intellisense) in a global sense. I find that to be unnecessarily confusing. I like all the assets to be accessed only through the AssetManager class.
FYI, the AssetManager, is a nice buffer. Allowing you to have unique names for linkage in the FLA and Class names in the AssetManager (if desired). Over time, one can change without affecting the other, and without having to change code spread throughout your application.
Next Steps
- See the sourcecode (See ‘Member Resources’ below) for a simple example project and assets file.
Member Resources
[private_Free member]Enjoy this members-only content!
- Download this FDT 3.x AssetManagerDemo project containing all files. For Flash Builder, create a new project, unzip the download and drag in the files.
- Download Flash CS5 Empty Assets Template File.
[/private_Free member]