I’m new in Flex 3 and ActionScript.
I would like to know how do I get the value of the dynamic textboxes via their id.
for (var countz:int = 0; countz < questionCount; countz++)
{
hboxtextboxz = new HBox();
txt = new TextInput();
txt.id = countz + "";
hboxtextboxz.addChild(txt);
}
Does anyone have any idea how I get the values out of the dynamic textboxes I created with the for loop?
To dynamically get all the children of a Container, use the
getChildren()method. It will return an Array ofUIComponents, If they areTextInputinstances, cast them and get the value using thetextproperty.Sample code to get all the textBoxes from a container which are inside HBoxes.
The above code is provided your UI structure is as :