Can anybody help me in triggering a function in child mxml file when the view stack navigates among children mxmls?
Parent mxml is having a viewstack with 2 childrens as Page1.mxml and Page2.mxml as shown in the below code. I know that i can navigate among pages using viewstack's selectedIndex property.But i want do some task everytime when i navigated to Page1(Eg: flushing datagrid or some kind of initialization work). I also know about "creationcomplete event " which will be triggered when the mxml got created but i want this kind of some event which will be triggered whenever i come to Page1 using viewstack. Any help?
<mx:ViewStack id="vstk" x="0" y="4">
1. You can use the ViewStack change event and check the index in the event handler
2. OR you can use a presentation model and bind the ViewStack selectedIndex to it. Then you use a getter/setter in your PM. In the setter, you can check the value and dispatch an event from there if the value is 1
You can also use a "show" event handler for the page being switched to.
The show event is called every time the MXML component becomes visible again ...
I have done in the same way dude......anyway thanks for your time