3 Replies Latest reply on May 28, 2007 6:08 PM by kglad

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

      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);

      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.