# Array problem

**URL:** https://forum.kirupa.com/t/array-problem/122598
**Category:** Uncategorized
**Created:** [September 15, 2004, 6:22am UTC](https://forum.kirupa.com/t/array-problem/122598 "2004-09-15T06:22:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![NarrayaN](https://avatars.discourse-cdn.com/v4/letter/n/3bc359/32.png) [@NarrayaN](https://forum.kirupa.com/u/NarrayaN)
#### Post date: [September 15, 2004, 6:22am UTC](https://forum.kirupa.com/t/array-problem/122598/1 "2004-09-15T06:22:31Z")

</div>

Hy to everybody, i’m new here.  
I have a problem with a scripted menu, i sa pop up menu, i’l show you tha code that is on mai main movieClip:  
[size=1][color=darkred]onClipEvent (load) {  
mainSections = new Array(“femei”, “barbati”, “copii”, “marochinarie”, “accesorii”);  
[/color][/size]  
[size=1][color=darkred] subSection0 = new Array(“elegant”, “casual”, “sport”);  
subSection1 = new Array(“elegant”, “casual”, “sport”);  
subSection2 = new Array(“elegant”, “sport”);  
subSection3 = new Array(“posete”, “genti”, “voiaj”);  
subSection4 = new Array(“curele”, “portofele”, “ciorapi”, “dresuri”, “intretinere”, “diverse”);  
[/color][/size]  
[size=1][color=darkred] for (i=0; i\<mainSections.length; i++) {  
attachMovie(“mainButton”, “main”+i, i+100);  
myButton = this[“main”+i];  
myButton.subs = this[“subSection”+i];  
myButton.button.value = mainSections\*;  
myButton.\_x = myButton.\_width_i;  
[/color][/size]  
[size=1][color=darkred] for (x=0; x\<myButton.subs.length; x++) {  
myButton.attachMovie(“subButton”, “sub”+x, x);  
mySub = myButton[“sub”+x];  
mySub.button.value = myButton.subs[x];  
mySub.button.outYpos = myButton.\_height+(mySub.\_height_x);  
}  
}

function openSubs(target) {  
for (i=0; i\<this[target].subs.length; i++) {  
subMenuCounter = 0;  
this[target][“sub”+i].button.newY = this[target][“sub”+i].button.outYpos;  
currentOpen = target;  
}  
}

function closeSubs(target) {  
for (i=0; i\<this[target].subs.length; i++) {  
this[target][“sub”+i].button.newY = this[target][“sub”+i].button.oYpos;  
}  
}

function doSubSection(target, sub) {  
getURL(\_root[target][sub][pic], “\_self”);  
\_root.currentSelection = target+" "+sub;  
closeSubs(currentOpen);  
}  
}  
}  
onClipEvent (enterFrame) {

subMenuCounter++;  
if (subMenuCounter\>70) {  
closeSubs(currentOpen);  
subMenuCounter = 0;  
}  
}  
onClipEvent (mouseUp) {  
if (!this.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
closeSubs(currentOpen);  
}  
}[/color][/size]  
[color=black]The code above generates one button that i’ve created and gives him the values from the arrays.[/color]  
This is tha code on my action frame:  
[size=1][color=darkred]fscommand(“allowscale”, false);  
stop();  
this.main0 = new Object()  
main0.sub0 = “…/produse/femei\_elegant\_clasic.html”  
main0.sub1 = “…/produse/femei\_casual\_clasic.html”  
main0.sub2 = “…/produse/femei\_sport.html”  
this.main1 = new Object()  
main1.sub0 = “…/produse/barbati\_elegant\_clasic.html”  
main1.sub1 = “…/produse/barbati\_casual\_clasic.html”  
main1.sub2 = “…/produse/barbati\_sport.html”  
this.main2 = new Object()  
main2.sub0 = “…/produse/copii\_elegant.html”  
main2.sub1 = “…/produse/copii\_sport.html”  
this.main3 = new Object()  
main3.sub0 = “…/produse/marochinarie\_posete.html”  
main3.sub1 = “…/produse/marochinarie\_genti.html”  
main3.sub2 = “…/produse/marochinarie\_voiaj.html”  
this.main4 = new Object()  
main4.sub0 = “…/produse/accesorii\_curele.html”  
main4.sub1 = “…/produse/accesorii\_portofele.html”  
main4.sub2 = “…/produse/accesorii\_ciorapi.html”  
main4.sub3 = “…/produse/accesorii\_dresuri.html”  
main4.sub4 = “…/produse/accesorii\_intretinere.html”  
main4.sub5 = “…/produse/accesorii\_diverse.html”[/color][/size]  
[color=black]I’m not to good at this but i just want to be able to add to each button besides a link an action loadMovie .When i click a button to change for each button the picture i have on my main stage.[/color]

Thanks for the attention.
