I have an for each loop that creates a new textField for each item and I need to know how you can give each textField a unique name so it can be targeted later on.
Here is the relevent code:
var i:int = 1;
for each (var titleElement:XML in titleList) {
var header: TextField = new TextField ();
addChild(header);
header.text = titleElement;
i++
}
}
I would like to append the value of “i” to the end of the variable “header” i.e. “header_1”.
Thanks in advance for the help.