Hello,
i’m struggling with the following, i’m building an xml based flash menu. For the buttons I used a MovieClip ‘mainMenuItem’ that contains the MovieClips ‘MenuBackground’, ‘menuBlueLine’ and ‘menuText’, all of them with the exported for AS and export in frame 1 checked.
in the following code i am trying to get the text of an array into the dynamically build menu.
var menuHoogte:int=34;
var menuY:int=0;
var menuArray:Array=new Array();
menuArray[0]="item1";
menuArray[1]="item2";
menuArray[2]="item3";
menuArray[3]="item4";
menuArray[4]="item5";
function parseMenu():void {
//----------------------
for (var i:int=0; i<menuArray.length; i++) {
var newMainMenuItem:mainMenuItems = new mainMenuItems();
newMainMenuItem.x=0;
newMainMenuItem.y=menuY;
var newBlueLine:menuBlueLine = new menuBlueLine();
var newLabel:menuText=new menuText();
var labelText:String=menuArray*;
newLabel.text=labelText;
trace("labeltext: "+labelText);
this.addChild(newMainMenuItem);
this.addChild(newLabel);
menuY+=menuHoogte;
}//for(var i:int=0; i<menuArray.length; i++)
}
parseMenu();
The newMainMenuItem appears as it should, 5 times but the labels are empty.
can anyone help please?
thanks
Marco