Hi guys,
I can’t figure out what is the syntax for assigning names to textfields created dynamically using a loop.
for (var i:uint=0; i<10; i++) {
var myText:TextField = new TextField();
myText.defaultTextFormat = textFormat;
myText.text = "some text";
myText.x = i*20;
addChild(myText);
}
As expected, this code gives me a warning “Duplicate variable definition”.
How can I assign names dynamically (myText1, myText2, myText3…)?
Thanks