I am creating several TextInput boxes via a for loop similar to the one below. The NumberOfSelections variable will differ depending on input from the user.
for(var i:int=1; i <= NumberOfSelections; i++){
InputField = new TextInput;
InputField.id = "Name" + i
InputField.text = "2"
HGroup1.addElement(InputField);
}
The TextInput text is editable when run, and the user will put in numbers and then press a calculate button that will call a new function. How do I get the information from all the TextInput fields. For instance, if NumberOfSelections was 4 how would I get all 4 numbers the user entered in order to add them together. Is it possible to use the unique id name
Many Thanks
You must save a reference to the fields as you create them. I would suggest storing them in an array: