# Building buttons from an array

**URL:** https://forum.kirupa.com/t/building-buttons-from-an-array/169899
**Category:** Uncategorized
**Created:** [November 21, 2005, 12:49am UTC](https://forum.kirupa.com/t/building-buttons-from-an-array/169899 "2005-11-21T00:49:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![neild](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/neild/32/1265_2.png) [@neild](https://forum.kirupa.com/u/neild)
#### Post date: [November 21, 2005, 12:49am UTC](https://forum.kirupa.com/t/building-buttons-from-an-array/169899/1 "2005-11-21T00:49:55Z")

</div>

having a little trouble with arrays here -  
pass 1, 3, 4, & 5 from the array as i create the buttons -  
but no matter what i do all i can grab is the values from the last set??

how do i define the variables so that they are unique only for that particular array “block(?)” ([1,[color=DarkRed] **“A1”** [/color],1,**[color=DarkRed]A1Title[/color]**,**[color=DarkRed]A1Title2[/color]**,**[color=DarkRed]A1Title3[/color]**]) -

thnx in advance!

```auto
navarray = [[1,"A1",1,A1Title,A1Title2,A1Title3],[2,"A2",1,A2Title,A2Title2,A2Title3],[2,"A3",1,A3Title,A3Title2,A3Title3]];
numOfNav = navarray.length;

origin1=0;

loadME=function(){
	for (var i = 0; i<numOfNav; i++){
			attachMovie("SECnav","new"+i,i,{_x:200,_y:origin1});
			origin1 += this["new"+i]._height;
			this["new"+i].name.text = navarray*[1];
			var who = navarray*[1];
			   var title1 = navarray*[3];
			   var title2 = navarray*[4];
			   var title3 = navarray*[5];
			this["new"+i].onRelease = function(){
				_root.placeTest(who, title1, title2, title3);
			}
	}
};

```
