# Help Needed With Arrays

**URL:** https://forum.kirupa.com/t/help-needed-with-arrays/269585
**Category:** flash
**Created:** [August 29, 2008, 5:42am UTC](https://forum.kirupa.com/t/help-needed-with-arrays/269585 "2008-08-29T05:42:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hunabku](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@hunabku](https://forum.kirupa.com/u/hunabku)
#### Post date: [August 29, 2008, 5:42am UTC](https://forum.kirupa.com/t/help-needed-with-arrays/269585/1 "2008-08-29T05:42:24Z")

</div>

Hello everyone.

Here’s the thing… I’ve made an array of movieclips and when you click any one of them they are supposed to call another array of movieclips. Something like a menu with submenus… the thing is that i cant figure out how can this be done. How can i instance an array from other array???

sorry if i’m not clear enough. Here´s the code i’ve done… hope it helps:

var menuPrincipal:Array = [  
{name:“tresD”, mct:“tresD\_mc”, prim:“p1”, id:“menu3D”},  
{name:“multimedia”, mct:“multimedia\_mc”, prim:“p2”, id:1},  
{name:“ilustracion”, mct:“ilustracion\_mc”, prim:“p3”, id:2}  
];  
var menu3D:Array = [  
{name:“renders”,mct:“renders\_mc”,prim:“3Dren”},  
{name:“recorridos”,mct:“recorridos\_mc”,prim:“3Drec”},  
{name:“animaciones”,mct:“animaciones\_mc”,prim:“3Dani”}  
];  
function crearMenu():void  
{  
for (var i:Number=0; i\<menuPrincipal.length; i++)  
{  
menuPrincipal\*.name = new MovieAssetMaterial (menuPrincipal\*.mct,true)  
menuPrincipal\*.name.animated = true;  
menuPrincipal\*.name.doubleSided = true;  
menuPrincipal\*.name.smooth = true;  
menuPrincipal\*.name.interactive = true;  
menuPrincipal\*.prim = new Plane (menuPrincipal\*.name, 125.3, 157.3,3,3);  
menuPrincipal\*.prim.x= centroX + (dist\*(i+1));

menuPrincipal\*.prim.addEventListener(InteractiveScene3DEvent.OBJECT\_OVER, mouseOver);  
menuPrincipal\*.prim.addEventListener(InteractiveScene3DEvent.OBJECT\_OUT, mouseOut);  
menuPrincipal\*.prim.addEventListener(InteractiveScene3DEvent.OBJECT\_CLICK, mouseClick);

scene.addChild (menuPrincipal\*.prim);  
}  
}

function mouseOver(e:InteractiveScene3DEvent):void  
{  
var quien = e.currentTarget;  
Tweener.addTween (quien, {z:-50, time:0.3, transition:“easeInSine”});  
};  
function mouseOut(e:InteractiveScene3DEvent):void  
{  
var quien = e.currentTarget;  
Tweener.addTween (quien, {z:0, time:0.3, transition:“easeInSine”});  
};  
function mouseClick(e:InteractiveScene3DEvent):void  
{  
var quien = e.currentTarget;  
crearSubmenus(???);  
};  
function crearSubmenus (menu):void  
{  
???  
}

////////////////////////////////////////////////

So… when you click for instance the first movieclip of the menuPrincipal array, the menu3D array shoud be called… but i can’t do it!!!

Help!!!

Thanx alot
