Loading ...
Sorry, an error occurred while loading the content.
 

Re: Dynamically add Objects to BoxPane

Expand Messages
  • sramsey216
    I ve found a work around by setting the configuration property to null after a store in my temporary variable. So: ... var config:Array = bp.configuration;
    Message 1 of 2 , Mar 1, 2010
      I've found a work around by setting the configuration property to null after a store in my temporary variable.

      So:
      ...
      var config:Array = bp.configuration;
      bp.configuration = null;
      ...



      --- In ydn-flash@yahoogroups.com, "sramsey216" <sramsey216@...> wrote:
      >
      > I am trying to dynamically add objects to a BoxPane by updating the BoxPane's configuration property. Here is my code:
      >
      > public function addChildToPane(pane:String, object:Object):void
      > {
      > var bp:BoxPane = this.getChildByName(pane) as BoxPane;
      > if (bp)
      > {
      > var config:Array = bp.configuration;
      > if (!config)
      > config = new Array();
      > config.push(object);
      > bp.configuration = config;
      > }
      > }
      >
      > I am getting the following error: [Fault] exception, information=ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
      >
      > Has anyone successfully added object dynamically?
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.