# Array driven menu locking up flash

**URL:** <https://forum.kirupa.com/t/array-driven-menu-locking-up-flash/216850>\
**Category:** Uncategorized\
**Created:** [February 21, 2007, 2:26am UTC](https://forum.kirupa.com/t/array-driven-menu-locking-up-flash/216850 "2007-02-21T02:26:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pyromunky](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@pyromunky](https://forum.kirupa.com/u/pyromunky)\
**Post date:** [February 21, 2007, 2:26am UTC](https://forum.kirupa.com/t/array-driven-menu-locking-up-flash/216850/1 "2007-02-21T02:26:56Z")

</div>

I’m creating a couple menus complied from arrays, a main menu and a sub menu. I created a container clip to dump the menu items into. The function runs fine when creating the initial main menu from \_root. However, when running it from the individual menu item - calling the same build function in another instance of the container in the parent clip - it causes flash to lock up. I’ve run out of ideas, can anyone help?

Here’s the build function for the main menu:

function buildMainMenu(menuArray) {  
arrayLength = menuArray.length;  
yPos = 10;  
for (a=0; a\<=arrayLength-1; a++) {  
this.attachMovie(“menuItem”, “item”+a, a);  
this[“item”+a].linkText.text = menuArray[a];  
this[“item”+a].\_y = yPos;  
yPos = yPos+(this[“item”+a].\_height+10);  
this[“item”+a].menuButton.onRelease = function() {  
\_parent.targetFrame = 20;  
// this freezes flash  
\_parent.menuContainer02.buildMainMenu(mainArray);  
};  
}  
}

I’ve also attached the .fla …any help is truly appreciated.
