Good to know. I did find a work around by adding the children to the main
app container and that now works. I will change my vbox to a canvas and see
what happens.

On 6/1/07, Alex Harui <[EMAIL PROTECTED]> wrote:

   Adding children runs layout which for VBox will wrestle everything into
a vertical stack.  Canvas is better for "random' positioning.


 ------------------------------

*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Clint Tredway
*Sent:* Friday, June 01, 2007 8:31 AM
*To:* [email protected]
*Subject:* [flexcoders] AddChild problem



I am not sure this as much a problem as I am probably doing something
wrong. I am adding child components at runtime to a vbox. These new
components can be dragged to a new position. This all works. The
'problem' is that when anytime a new child is added, all the child
components move the top left corner of the container they are added
to.

Code Below:
public function creatObj(what:String):void{
var obj:UIComponent;

switch(what){
case "rssFirstName":
obj = new textComponent;
//container_vb.addChild(obj);
break;

case "rssLastName":
obj = new textComponent;
//container_vb.addChild(obj);
break;

case "rssEmail":
break;

case "text":
obj = new textComponent;
//container_vb.addChild(obj);
break;

case "textArea":
obj = new textAreaComponent;
//container_vb.addChild(obj);
break;

case "checkBox":
obj = new checkboxComponent;
//container_vb.addChild(obj);
break;

default:
break;
}


container_vb.addChild(obj);
}

I really need to figure out why this is happening, so any guidance is
appreciated.

Thanks
--
I am not a diabetic, I have diabetes
my blog - http://grumpee.instantspot.com/blog




--
I am not a diabetic, I have diabetes
my blog - http://grumpee.instantspot.com/blog

Reply via email to