« Gershie | Main | Programming for Designers »
February 05, 2003
Attaching shared assets in Flash
A bit off the usual topics here today. Here's a workaround I figured out in Flash. I've seen this mentioned only in an aside on Branden Hall's blog (read to the end of the "Shared Fonts Hell" entry), and it wasn't written in any Technotes that I could see.
You might have two movies, a library.swf and a main.swf. Using Flash's shared assets feature, you can put stuff in library.swf that you need to use in multiple other movies (this is a lot like Director's shared Cast files). Shared assets are "activated" by using the "export/import at runtime" feature of each movie clip symbol; the contents of library.swf's Library can then appear in main.fla's Library. But, if you want to place library.fla's contents on main.fla's stage using attachMovie, it won't work. You have to manually place at least one symbol from library.fla's Library on main.fla's Stage first. The easiest way is to create an empty movie clip in library.fla, import it as a shared asset into main.fla's Library, then drag it onto main.fla's Stage.
Posted by Andrew at February 5, 2003 10:56 AM