# Only the last one shows up!?

**URL:** <https://forum.kirupa.com/t/only-the-last-one-shows-up/207047>\
**Category:** flash\
**Created:** [November 14, 2006, 9:43am UTC](https://forum.kirupa.com/t/only-the-last-one-shows-up/207047 "2006-11-14T09:43:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bennymartensson](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bennymartensson/32/1317_2.png) [@bennymartensson](https://forum.kirupa.com/u/bennymartensson)\
**Post date:** [November 14, 2006, 9:43am UTC](https://forum.kirupa.com/t/only-the-last-one-shows-up/207047/1 "2006-11-14T09:43:03Z")

</div>

Anyone know why only the last mainNav button shows up on stage? Tell me if you need more info.

```auto

function createMainMenu() {
	var a = 1;
	var total = mm_array.length;
	while (a<=total) {
		ypos = ((a-1)*homm)+1;
		container_mc.attachMovie("mainnav_mc", "mainnav"+a+"_mc", this.getNextHighestDepth()+100, {_x:0, _y:ypos});	// attach the movieClip
		var nc = container_mc["mainnav"+a+"_mc"];
		nc.menutext = mm_array[(a-1)];	// set the title text for each button
		nc.itemnum = a;	// set the menu #
		a++;
	}
}

```
