SWC Creation Gotcha

In a bare bones simple creation of a SWC file, I could not get it to work. Testing the component as well as testing a compiled clip both worked, but not an SWC. I read the tutorial by <a href=”http://www.macromedia.com/devnet/mx/flash/articles/buildtest_comp.html”>Allen & Nigel on Macromedia’s site</a>, dug into the chattyfig archives, and re-read the Flash help a few times. Still no dice.

Turns out, you have to ALSO define your AS2 class in the Component’s defintion panel. Right click on the symbol in the Library, select “Component Definition…”, and then type in your AS2 class name in the AS2 class field provided.

I didn’t see this documentated anywhere, so until someone body checks me on a RTFM part that I somehow missed, I’ll make a tutorial soon so no one has to go through the 2 day pain that I did.

Thanks again Johan Nel from Flashcoders with helping me out!

2 Replies to “SWC Creation Gotcha”

  1. FYI, I reported this issue a few months ago as a documentation bug. Others and I didn’t know of this requirement and kept on having the same issues. I didn’t give it much thought, but I’m not sure why there would be a different class defined in the component definition panel than the MovieClip class. In my eyes, there should be just a checkbox that says “This is a component”, and the IDE would just use the same class defined in the linkage properties. Also, a little tip, if you do change the class name, make sure to remember to update the class in the component definition panel too, that one got me a few times too :).

Comments are closed.