Groups | Blog | Home
all groups > flash actionscript > may 2007 >

flash actionscript : CS3 All Buttons give error #2007: Parameter child must be non-null


nu2cf
5/28/2007 11:59:32 PM
Using CS3 actionscript all buttons give the following code. I have tried it
myself and used the examples with CS3 and on livedocs.
Here is the button code:*************************

import fl.controls.Button;

var myButton:Button = new Button();
myButton.toggle = true;
myButton.move(10, 10);
myButton.addEventListener(Event.CHANGE, changeHandler);
addChild(myButton);

function changeHandler(event:Event):void {
trace("Button toggled (selected:" + event.currentTarget.selected + ")");


**************Error ***************************
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/addChildAt()
at fl.controls::BaseButton/fl.controls:BaseButton::drawBackground()
at fl.controls::LabelButton/fl.controls:LabelButton::draw()
at fl.controls::Button/fl.controls:Button::draw()
at fl.core::UIComponent/::callLaterDispatcher()
Button toggled (selected:true)

Can anyone help me with correcting this problem. I can't find it by googling,
searching livedocs, help, etc.
kglad
5/29/2007 12:28:05 AM
nu2cf
5/29/2007 1:03:07 AM
Thanks that worked. I didn't add other components directly to the library, just called them in the actionscript. Do you know why the button would be different?
kglad
5/29/2007 1:08:31 AM
AddThis Social Bookmark Button