I wanted a Button that would also hold an int as an identifier, so I tried to extend the fl.controls.Button class:
package {
import fl.controls.Button;
class ButtonID extends fl.controls.Button{
public var ID:int;
public function ButtonID( setID:int ):void {
ID = setID;
}
}
}
Simple enough. But when I try to instantiate some ButtonID’s in the main, I get
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/addChildAt()
at fl.controls::BaseButton/drawBackground()
at fl.controls::LabelButton/draw()
at fl.controls::Button/draw()
at fl.core::UIComponent/callLaterDispatcher()
The flash debugger says it cannot show the source code at the location where the error occurs. I have a Button component into the library, and creating regular buttons still works. The ButtonID’s that are created and added to the stage don’t have any of the default background images in them. They are just blank with the label text.
I’m guessing that the new ButtonID’s can’t access the default graphics that the regular Buttons are accessing. How could I enable the ButtonID’s to get those graphics?
Thanks for any help.