# How to increment the \_x property

**URL:** <https://forum.kirupa.com/t/how-to-increment-the--x-property/224440>\
**Category:** flash\
**Created:** [May 2, 2007, 1:30pm UTC](https://forum.kirupa.com/t/how-to-increment-the--x-property/224440 "2007-05-02T13:30:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beebs](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@Beebs](https://forum.kirupa.com/u/Beebs)\
**Post date:** [May 2, 2007, 1:30pm UTC](https://forum.kirupa.com/t/how-to-increment-the--x-property/224440/1 "2007-05-02T13:30:13Z")

</div>

The loop as follows :

```auto

subbuttonArray = myXml.firstChild.childNodes*.childNodes;
		
		for(n = 0; n<=subbuttonArray.length-1; n++){
			trace(subbuttonArray[n])
			subMenu = subbuttonArray[n];
			var m =navigation.attachMovie( "sub_menuItem", "sub_menuItem"+n, n+100);
			m.sub_nameTxt.text = subMenu.attributes.id;
			m._x = k._x;
			m._y = k._y - (m.box._height*n )-m.box._height;
			m._visible= true;
			m.onRelease = function(){
            getURL(this.itemUrl, "_blank");
         }
      }

```

The trace result as follows :

```auto

<sub id="Logos" theURL="http://www.your.com" />
<sub id="Websites" theURL="http://www.your.com" />
<sub id="Coding" theURL="http://www.your.com" />
<sub id="Biograpy" theURL="http://www.your.com" />
<sub id="History" theURL="http://www.your.com" />
<sub id="AS Dictonary" theURL="http://www.your.com" />
<sub id="Kirupa" theURL="http://www.your.com" />
<sub id="Forum" theURL="http://www.your.com" />

```

var k was declared earlier.

The result is the last 3 array elements in the array shows on top of the rest element below it.

Can someone show me how to alter the loop so that m.\_x start from 0 and icrement accordingly?

Thanks
