dcmike27
10-03-2008, 06:26 PM
I'm trying to write a function in my main app that can add a child (a custom component) to a custom component. The main app is just a viewStack, composed of custom components in vBoxes.
I can get the component to add a child to itself, like this:
var myChild:myCustomChild = new myCustomChild();
this.childHolder.addChild(myChild);
In the sample above, "childHolder" is the id of the vBox inside the component.
But say the component in question is myParent.mxml. What's the syntax for adding the child to it from the main app?
Any hints would be greatly appreciated. Thanks.
I can get the component to add a child to itself, like this:
var myChild:myCustomChild = new myCustomChild();
this.childHolder.addChild(myChild);
In the sample above, "childHolder" is the id of the vBox inside the component.
But say the component in question is myParent.mxml. What's the syntax for adding the child to it from the main app?
Any hints would be greatly appreciated. Thanks.