ReferenceError: Error #1056: Cannot create property myButton on ComponentTest.
at flash.display::Sprite/flash.display:Sprite::constructChildren()
at flash.display::Sprite$iinit()
at flash.display::MovieClip$iinit()
at ComponentTest$iinit()
at flash.display::Sprite/flash.display:Sprite::constructChildren()
at flash.display::Sprite$iinit()
at flash.display::MovieClip$iinit()
Does any of you have come across something similar while working on movie clips with external class definitions and contains components. The simplest way to get to this error is
Drag a button component on to stage and name it ‘myButton’.
Press F8 and convert to a movieclip.
Assign an external class definition as the Linkage Class, say ‘ComponentTest’.
Create a new AS file and enter a few lines like
package {
import flash.display.MovieClip;
public class ComponentTest extends MovieClip{
public function ComponentTest():void{
}
}
}
Save the file as ComponentTest.as
Test the flash movie.
If you take away the instance name of the component the error doesn’t occur anymore.
The workaround for me is to take away the external class definitions and go for frame scripting inside the movie clip. But I have a large amount of reusable functionality which i typically contain in a parent abstract class and the actual classes just extends the parent class. In the workaround I’ll have to type in the redundant code into each movie clip.
:upset: