Search code examples
actionscript-3movieswc

Create class for imported SWC elements


I have imported a SWC into my actionscript project. It includes many different movieclips that I can access in my project. My question is this: How can I create a custom AS3 class that I can use to add functions and properties to my movieclips?

For example I have a movieclip with a linkage name of LevelButton. I tried creating a class that was the same name but they didn't seem to go together.

Thanks,


Solution

  • I was able to accomplish this by generating the .SWC with proper linkage names on my movieclip. Then in my application I created a class that extending the movieclip.

    ie. Movieclip with linkage name: MyMovieclip_mc

    then my application class:

    public class MyMovieclip extends MyMovieclip_mc
    {
        ...
    }