R – How to associate linked SWC MovieClip asset with a Class in FlexBuilder Actionscript project

actionscript-3flashflexbuilderswc

I'm using Flex Builder more and more and attempting to create a fairly asset heavy application all in Flex Builder.
I know how to publish or export Flash assets as SWC's so they are available in Flex Builder, but what if you have a button MovieClip with frame states in Flash, which is either exported or included in the swf published as a SWC, and you then want to associate a Class file created in Flexbuilder with this SWC asset?

I want to avoid unnecessary roundtripping…every time I need to make an edit to a Flash authored MovieClip class I would need to edit the Class and re -publish or reexport to a SWC so it is available in Flex Builder. ie I want to do ALL my coding in Flexbuilder while authoring graphical assets in Flash.

Best Answer

There are two ways to look at this. The first way (that I use fairly often) is to include the FLAs in my lib folder of my Flex project. Then, in the FLA I set the path to ../src/ (Publish Settings - > Flash Tab -> ActionScript 3 Button) so that Flash can reach the same packages as the rest of my Flex application. This means the SWC is just a compiled version of the classes I already have in Flex (hence I don't even have to add the SWC to the Flex project technically)

They other way of doing something like this is to create the assets inside of Flash and just assign the various assets dummy classes - Flash will create the classes for these assets for you automatically. Then you import that SWC into your Flex project. The assets, by themselves, will obviously just be dumb MovieClips - but you can write your own classes that instantiate the assets and control them.

Related Topic