Search code examples
actionscript-3flashswc

Conflicted inherited definition when using SWC


I am using Flash CS6 and I am stuck by the inherited definitions.

Suppose I have a class named Button such as:

public class Button extends MovieClip
{
    public var _text : TextField;
}

In the Library I would like to create a MovieClip symbol, export it to actionscript and set the 'class' to 'ButtonSkinned' and the 'base class' to 'Button'. Inside this MovieClip symbol I put a text field with the name '_text' on the stage.

It is a traditional way to define a customized MovieClip and do the skinning, am I right?

There the problem comes:

If I use the class 'Button' by adding it to my class path everything is OK.

If I pre-compiled this class into a SWC file and add it as an External library. When I was exporting the SWF, Flash CS6 throw out an error:

Symbol 'ButtonSkinned' A conflict exists with inherited definition MyPackage:Button._text in namespace public.

Of course I have disabled the 'Automatically declare stage instances'. I have no idea how to get rid of this error. Any solution about this?


Solution

  • I found the same case and a walk around here: http://forums.adobe.com/thread/198821

    The key to walk around is manually write the visual symbol associated class code instead of auto generate by Flash. To make it more easy to use a JSFL script to auto write the class code would be great helpful.