I have a custom component which contains many promptingTextInput controls.
When i click a button, I want the text field of all the promptingTextInputs to become blank.
(Note: I have around 60 promptingTextInputs)
How do i access the controls dynamically ? I am looking for a flex equivalent of $(‘input[type=text]’) (like in jquery).
As for me the best way to obtain it is to follow data driven design. Create data object (I mean a dedicated class) with dedicated fields (of
Stringtype) for every yourTextInput. Then bind your text inputs with fields using two way binding. Then you can clear all text inputs by recreating object. I’ll illustrate it with the following pseudo code. Lets create our data object aka VO:Then our MXML class:
It seems it will be better in design point of view and much more simple. And you can use composition within your data object and still take advantage of binding.