Create ViewStack in Actionscript with creationPolicy = "auto"
- by Ivan Zamylin
In MXML, when I add components to ViewStack and creationPolicy is auto, components are not instantiated until I switch to them. Say, I have the following code:
<mx:ViewStack creationPolicy="auto">
<s:NavigatorContent>
<s:DataGrid id="dg1" width="300"/>
</s:NavigatorContent>
<s:NavigatorContent>
<s:DataGrid id="dg2" width="100"/>
</s:NavigatorContent>
</mx:ViewStack>
How do I replicate this behavior in ActionScript?
The problem is that my DataGrids hold large chunks of data, and thus I don't want them to be created at the same time.