Hi there
I have 9 button elements in an array that are number 0 to 9 that works, but the output_txt dynamic text field will not display the number for that button when clicked.
any ideas?
PHP Code:
var num:int;
var btnNum:int = btnArray.length;
for (var i:int = 0; i < btnNum; i++) {
this["input_"+i].buttonMode = true;
this["input_"+i].mouseChildren = false;
this["input_"+i].textNum.text = i;
this["input_"+i].num = i;
this["input_" + i].addEventListener(MouseEvent.CLICK,rClick);
function rClick(evt:MouseEvent):void {
if (output_txt.text.length < 2) {
//num = btnNum[c].name;
//output_txt.text += evt.target.name;
//output_txt.text += this.num;
//output_txt.appendText(evt.target.name);
output_txt.appendText(String(this.num));//this will only display the number 0.
}
}
}