Hi I ve been trying to populate an empty MovieClip in AS3. I can get my head around it if I create an empty movie clip and place it in the library, and then add it to the stage and then add other MCs from the library to it.
But I want to make multiple empty MCs and fill each one with MCs. I want to do this using for loops so I can control as many as I need.
I dont know how to write the code. I can do it in AS2! but thats not the point!
here’s the simple version:::
var myMC:MovieClip = new MovieClip();
for(var i:int=0;i<5;i++)
{
var myMC.vx = i;
myMC.name = 'myMC'+i;
myMC.addEventListener(Event.ENTER_FRAME,loop);
addChild(myMC);
}
function loop(e.Event):void
{
//how do I access "myMC0" and "myMC1" etc
myMC.x += myMC.vx; // they dont scroll differently .. They ALL scroll at the same rate
}
each myMC is empty … but Ill add other MCs to them later
Any Hints? thanks …//