TypeError: Error #2007: Parameter child must be non-null.
Hello,
I am new to actionscript 3.0, I have Adobe Flash Builder 4.7 installed and I am creating a ActionScript project (File -> New -> ActionScript Project) named as Test. As you know flash builder does not include fl.controls package by default. I have added this package to my project as source path or swc file so that I can use the default components (e.g. Buttons, RadioButtons, Checkboxes) and now I am writing the following code.
package
{
import flash.display.Sprite;
import fl.controls.Button;
[SWF(width = "640", height = "480", frameRate = "60", backgroundColor = "#FFFFFF")]
public class Test extends Sprite
{
private var btn:Button;
public function Test()
{
btn = new Button();
btn.label = "CLICK ME!";
btn.x = 100;
btn.y = 100;
addChild(btn);
}
}
}
I am creating a fl.controls.Button instance in Test class and trying to add it on stage. When I run the project, it always gives me the following error for the bold red line.
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()
Pleae help me out to get rid of this problem. Thanks in advance.
Thanks,
momersaleem
