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?

有帮助吗?

解决方案 2

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.

其他提示

If you are extending a non-dynamic class with public variables, you do not need to redeclare them, and yes, in this case you even cannot redefine such a variable. "Protected" and "public" variables are available to both the superclass and the subclass. In short, do not declare public var _text in ButtonSkinned class, the definition in Button is enough.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top