I'm designing an App that has a ViewStack with four identical custom components, each with it's own internal data that the user can set via checkboxes. I'd really like to break away from having to do this:
<ns1:OptionsPanel ... id="pref1">
<ns2:OptionsPanel ... id="pref2">
<ns3:OptionsPanel ... id="pref3">
<ns4:OptionsPanel ... id="pref4">
This just makes things really ugly and it restricts the number of views I can have to a hardcoded amount. I can't find a dataProvider method that I could use to bind an array of OptionsPanel objects to, and this is what I'd really like to be able to do.
Is there a way around this? Or am I stuck having to hardcode it.
There is a way, you could go with actionScript routine to fill ViewStack from the loop of 4 items for instance, loop seems like less hardcoded
for each (var op:OptionsPanel in yourDesiredDataProvider)
or even better, you could build your own ViewStack descendant having dataProvider property
If you feel this message answers your question or helps, please mark it respectively