# attachMovie in a loop, how do i have more control over x/y?

**URL:** <https://forum.kirupa.com/t/attachmovie-in-a-loop-how-do-i-have-more-control-over-x-y/80767>\
**Category:** flash\
**Created:** [February 24, 2005, 4:33pm UTC](https://forum.kirupa.com/t/attachmovie-in-a-loop-how-do-i-have-more-control-over-x-y/80767 "2005-02-24T16:33:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![livingeachday](https://avatars.discourse-cdn.com/v4/letter/l/d78d45/32.png) [@livingeachday](https://forum.kirupa.com/u/livingeachday)\
**Post date:** [February 24, 2005, 4:33pm UTC](https://forum.kirupa.com/t/attachmovie-in-a-loop-how-do-i-have-more-control-over-x-y/80767/1 "2005-02-24T16:33:47Z")

</div>

hi there.

i’ve got an attachMovie in a for loop, that creates a number of buttons, depending on how many names are in an array. as of right now i have the buttons created vertically, and im controlling the x value, like this:

allNames = attachMovie(“menuButton”,myArray[e],depth,{\_y:allNames.\_y+allNames.\_height+5});  
allNames.\_x = 520;

i’d like to do two things that this won’t let me do:

a. have more control over the Y coordinate, so when the loop starts i can say 'start making the buttons at x: 520, y: 350, instead of them just starting at y: 0 like they are now.

b. have a way to check if the amount of buttons reaches five in height, if so, the array starts a new column at x: 600 y: 350. im trying to have it do that about 3 times, as the amount of buttons will vary from 5-15.

is a or b possible? i’ve been trying to figure out both to no avail.

thanks for any insight you might have.

take care!
