# Building menu + submenu, with 2 arrays

**URL:** <https://forum.kirupa.com/t/building-menu-submenu-with-2-arrays/122375>\
**Category:** Uncategorized\
**Created:** [September 13, 2004, 8:18am UTC](https://forum.kirupa.com/t/building-menu-submenu-with-2-arrays/122375 "2004-09-13T08:18:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mieras](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@mieras](https://forum.kirupa.com/u/mieras)\
**Post date:** [September 13, 2004, 8:18am UTC](https://forum.kirupa.com/t/building-menu-submenu-with-2-arrays/122375/1 "2004-09-13T08:18:48Z")

</div>

Hello,

I’m building a menu with action script, the menu has an interval, so the items follow after each other. This is not a real problem. But the submenu is. I want to build it the same way, with the interval.

But the menu array contains, some years, and with a loop a go trough this array and flash builds it with the items of the array.

The submenu array, contains the quantity of the year, so the quantity of subbuttons…  
But i can’t fix it to use the number in the array as quantity of subitems…

here is the code:

```auto
menuYearItems = [0, 4, 6, 5, 9];
 menuYear = ["2004", "2003", "2002", "2001", "2000", "INFO"];
 i = -1;
 function func_menua() {
 	i++;
 	mcIntsetInterval([menuYear*], 1000*i);
 	if (i>=menuYear.length-1) {
 		clearInterval(mcInt);
 	}
 	var menua = _root.attachMovie("buttonyear", menuYear*, 10+i);
 	menua.year.year = menuYear*;
 	trace(menua);
 	menua._x = 50;
 	menua._y = 55+24*i;
 	menua.year.hit.onPress = function() {
 		untVar = menuYearItems*;
 		trace ("unt"+untVar);
 		mcInt2 = setInterval(func_menub, 150);
 		u = -1;
 	};
 	function func_menub() {
 		u++;
 		mcIntsetInterval([menuYearItems[u]], 1000*i);
 		if (u>=menuYearItems.length-1) {
 			clearInterval(mcInt2);
 		}
 		var menub = _root.attachMovie("buttonunt", menuYearItems[u], 20+u);
 		menub.unt.unt = "unt"+menuYearItems[u]+".";
 		trace(menub);
 		menub._x = 115;
 		menub._y = 55+24.7*u;
 	}
 }
 mcInt = setInterval(func_menua, 150);
 stop();
 

```

hope somebody can help me a little bit…

Maarten
