Add Child dynamically in a loop
Posted on 2011-05-10
I am creating new instances from a movie clip in library and adding it to a container on the stage. I also need to add a child to that already added child. Some thing like this in a loop.
var bar:YearBar=new YearBar();
then I have to do this:
var cube:Cube=new Cube();
I want to add this to the bar, so I did this:
But I am getting error.
Please note all these are happening in a loop and I need to create different number of these instances.
What am I doing wrong?