Data to an array from the textinput throught loop
I am trying to add data to an array from the textinput which i have created through for loop, but not working kindly help me
import fl.controls.TextInput;
import fl.controls.Button;
var myBt:Button = new Button();
addChild(myBt);
myBt.label="Submit";
myBt.x=50;
myBt.y=200;
for (var i=0; i<3; i++) {
var myTxt:TextInput = new TextInput();
addChild(myTxt);
myTxt.name = "txt" + (i).toString();
myTxt.x=50;
myTxt.y=i*40+50;
}
var myArray:Array = new Array();
myBt.addEventListener(MouseEvent.CLICK, myFun);
function myFun(evt:MouseEvent) {
for (var j=0; j<3; j++) {
myArray.push(txt0.text);
}
trace(myArray)
}