[COLOR="Red"]
var Labelz:Array=["Label Alpha","Label Alpha2","Alpha3","Label4 ","Label Alph5a","Alpha6"];
var Linkz:Array=["Contact","Report","Link","Broke","Suggest","Link"];
[/COLOR]
////////////////// text format and font embed.
var font:Font1=new Font1();
var txt_fmt:TextFormat=new TextFormat();
txt_fmt.font=font.fontName;
txt_fmt.size=21;
////////////////// For loop, creates buttons and adds event listeners.
[COLOR="red"]for (var i:Number = 0; i < 6; i++) {[/COLOR]
[COLOR="red"] var txt:TextField = new TextField();
txt.name="txt"+i;
addChild(txt); [/COLOR]
txt.x=179;
txt.y=209+i*40;
txt.defaultTextFormat=txt_fmt;
[COLOR="Red"] txt.appendText( Labelz* );[/COLOR]
[COLOR="red"]txt.addEventListener(MouseEvent.MOUSE_DOWN, doThis);
function doThis(evt:MouseEvent):void {
trace(Linkz*);
}[/COLOR]
[COLOR="red"]}[/COLOR]
Hello friends, I want each button I create to load its own value from the Array Linkz when the user clicks on it.
but I cant seem to get āiā to represent its corresponding value. its always 6ā¦
what am I doing wrong?
*eventually the linkz array will represent a movieclip that I want to load from the library, or from an external folder :0) *