# createEmptyMovieClip in AS3

**URL:** <https://forum.kirupa.com/t/createemptymovieclip-in-as3/289216>\
**Category:** flash\
**Created:** [May 27, 2009, 5:07pm UTC](https://forum.kirupa.com/t/createemptymovieclip-in-as3/289216 "2009-05-27T17:07:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [May 27, 2009, 5:07pm UTC](https://forum.kirupa.com/t/createemptymovieclip-in-as3/289216/1 "2009-05-27T17:07:03Z")

</div>

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:::

```auto
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 …//
