# Vertical button positioning without x,y coordinates

**URL:** <https://forum.kirupa.com/t/vertical-button-positioning-without-x-y-coordinates/271902>\
**Category:** flash\
**Created:** [September 30, 2008, 8:00am UTC](https://forum.kirupa.com/t/vertical-button-positioning-without-x-y-coordinates/271902 "2008-09-30T08:00:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iscarrr](https://avatars.discourse-cdn.com/v4/letter/i/cc9497/32.png) [@iscarrr](https://forum.kirupa.com/u/iscarrr)\
**Post date:** [September 30, 2008, 8:00am UTC](https://forum.kirupa.com/t/vertical-button-positioning-without-x-y-coordinates/271902/1 "2008-09-30T08:00:36Z")

</div>

Hi guys,

I’m trying to layout a navigation in flash that flows vertically down the page so basically something like

Home  
About  
Contact

etc. each button on a new line. Now at the moment im doing this by setting the y-coordinate of each button in the for loop where i add each button to the stage, so something like:

```auto

for(var i=0;i<mainNavList.length;i++){
    var navItem:NavButton = new NavButton(mainNavList*); // This class extends MovieClip
    navItem.y = i*12; 
}

```

Now this is working perfectly for me, but the problem is I dont want to set it using explicit ‘absolute’ style coordinates (dont want to use Y coords). I just want to be able to add a new button and it to follow underneath the previous one.

Why basically a) because i need each button to expand to show its children, and if it does ill have to go through and re-set all the Y values of the buttons underneath it (which is messy and a real pain).

So is there any object/element i can use that will do this automatically? something that would behave in the same was the CSS property of ‘display:block’ would really.

Thanks.
