# Looping problem

**URL:** https://forum.kirupa.com/t/looping-problem/170210
**Category:** Uncategorized
**Created:** [November 23, 2005, 7:16pm UTC](https://forum.kirupa.com/t/looping-problem/170210 "2005-11-23T19:16:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Macro\_design](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Macro\_design](https://forum.kirupa.com/u/Macro_design)
#### Post date: [November 23, 2005, 7:16pm UTC](https://forum.kirupa.com/t/looping-problem/170210/1 "2005-11-23T19:16:06Z")

</div>

Hi,

I’m currently working on a project were I would like to enlargen some of my menus ( there are wround 30 menus ), and this should be done when the user clicks a on one of the three buttons in the “main-menu”.

Now, I’ve been trying to create a function that, when one of the “main-menu” buttons is clicked, are called. This function then defines the menus and makes them scale, however the following code returns: “undefined”.

[AS]function enlargen(number) {  
if (number == 1) {  
for (var q = 0; q\<numberOfChilds; q++) {  
// \_root.container.item[q].scaling(200, 200);  
trace(\_root.container.item[q].\_width)  
}  
}  
}[/AS]

Maybe a “for” loop isn’t the solution, or maybe I’m just trying to define the items in a wrong way, with the array thing ( “…**item[q]**.sca…”).

Any help would be much appreciated

Btw. all the menus are loaded in dynamically through an XML document.
