Hi,
Is it possible to add a textField dynamically but have different instance name each time this is created? In other words if I have a button that whenever its click it will add a textField to the stage and assigns a new instance each time this is added.
button.addEventListener(MouseEvent.CLICK, addField);
var inputWidth = 200;
var inputHeight = 20;
function addField(event:MouseEvent):void{
var textFieldName:TextField = new TextField();
textFieldName.type = TextFieldType.INPUT;
textFieldName.border = true;
textFieldName.width = inputWidth;
textFieldName.width = inputHeight;
textFieldName.x = Math.random()* 500;
textFieldName.y = Math.random()* 500;
textFieldName.multiline = true;
textFieldName.wordWrap = true;
addChild(textFieldName);
}
Something like this but instead of textFieldName this would be different each time.
Thanks a lot!