# Adding several MC's inside a For loop with different x and y positions

**URL:** <https://forum.kirupa.com/t/adding-several-mcs-inside-a-for-loop-with-different-x-and-y-positions/323081>\
**Category:** flash\
**Created:** [June 16, 2011, 12:46am UTC](https://forum.kirupa.com/t/adding-several-mcs-inside-a-for-loop-with-different-x-and-y-positions/323081 "2011-06-16T00:46:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RubenDoliveira](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rubendoliveira/32/3905_2.png) [@RubenDoliveira](https://forum.kirupa.com/u/RubenDoliveira)\
**Post date:** [June 16, 2011, 12:46am UTC](https://forum.kirupa.com/t/adding-several-mcs-inside-a-for-loop-with-different-x-and-y-positions/323081/1 "2011-06-16T00:46:38Z")

</div>

Hi,

I have a movieclip called \_container which I’m adding to the stage 6 times (it will be dynamic so the number can vary). To do that, I’m using a for loop like this.

```auto

for(var i:int = 0; i <= 5; i++){ 		
    _container = new container;
				
    _container.x = 45;
    _container.y = 200 + (i* 95);
    addChild(_container);
}

```

Everything works so far, my problem is that I would like to have the MC displayed like this:

![](http://www.rubendoliveira-design.com/mc.jpg)

How can I have the second, fourth, etc… with a different x value? Any Ideas?

Thank you in advance.
