Hi all, I’m building an XML menu and I’m having trouble loading the content, Wondering if someone can help me out.
function buildMenu(t):Void {
var xPos = 20;
var startY = 262;
var padding = 0;
for(var i:Number = 0; i < t; i++) {
// attach bg for the buttons
var myClip:MovieClip = this.attachMovie('playerBar', 'bar' + i, this.getNextHighestDepth());
myClip._y = Math.round(startY+(i*(myClip._height+padding)));
myClip._x = xPos;
myClip.title_txt.text = title1*;
myClip.dur_txt.text = duration*;
myClip.onRollOver = function():Void {
this.gotoAndPlay("up");
}
myClip.onRollOut = function():Void {
this.gotoAndPlay("over");
}
myClip.onRelease = function():Void {
for (var j:Number = 0; j < t; j++) {
_root['bar' + j].enabled = true;
_root['bar' + j].gotoAndStop("up");
}
this.enabled = false;
this.gotoAndStop("on");
loadMovie(image*, "emptyImg");
title_txt.text = title2*;
desc_txt.text = desc*;
}
}
}
This is where I’m having problems:
loadMovie(image*, "emptyImg");
title_txt.text = title2*;
desc_txt.text = desc*;
I know it just can’t see the variable “i” because if I change it to:
loadMovie(image[0], "emptyImg");
title_txt.text = title2[0];
desc_txt.text = desc[0];
it works.but I’m not sure how to fix it. I tried changing the variable name and intit. it outside the function (buildMenu) with no luck. any help would be awesome. thanks.