# Positioning movie clips

**URL:** <https://forum.kirupa.com/t/positioning-movie-clips/279619>\
**Category:** Uncategorized\
**Created:** [January 16, 2009, 4:52pm UTC](https://forum.kirupa.com/t/positioning-movie-clips/279619 "2009-01-16T16:52:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gencoglu](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@gencoglu](https://forum.kirupa.com/u/gencoglu)\
**Post date:** [January 16, 2009, 4:52pm UTC](https://forum.kirupa.com/t/positioning-movie-clips/279619/1 "2009-01-16T16:52:52Z")

</div>

[FONT=Courier New][SIZE=2]Hi,  
I have five rectangle shaped movie clips…I need to change their \_y position randomly by clciking a button…but there must be 10px space between them… so how do I modify the code to do it ?  
thanks

```php

myArray = new Array(m1, m2, m3, m4, m5);

for (i=0; i<=myArray.length; i++) {
_root["m"+i]._x=400;
_root["m"+i]._y=Math.floor(Math.random()*300)+20;

}

```

[/SIZE][/FONT]
