Hi,
I have a empty movieclip container in which I add movieclips as children. But when I try to get the children it does not trace/return anything. Here is my code.
// Creating Container
var competencyContainer:MovieClip = new MovieClip();
competencyContainer.name = "competencyContainer";
this.addChild(competencyContainer);
var lastx:Number = 200;
function createUsers(){
// Creating movieclips
for (var i:Number=0; i<globals.scoreList.length;i++)
{
var test:MovieClip = new userbox();
test.x= lastx;
lastx = lastx+104.3;
test.name = String(i);
competencyContainer.addChild(test);
}
}
function moveRight(eventObject:MouseEvent){
trace("right Pressed");
trace(competencyContainer);
for(var childName in competencyContainer){
trace("child movieclip: " + competencyContainer[childName]);
}
The movieclips are made perfectly on screen and do not give an error. The above code runs. But does not show the
trace("child movieclip: " + competencyContainer[childName]);