3 Replies Latest reply on Feb 11, 2010 8:04 AM by Raju Penumatsa

    Switching between views using viewstack

    Raju Penumatsa

      Hi

      Can anybody help me in triggering a function in child mxml file when the view stack navigates among children mxmls?

       

      Eg:

       

      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">
                  <s:NavigatorContent>
                      <local:Page1/>
                  </s:NavigatorContent>
                  <s:NavigatorContent>
                      <local:Page2/>
                  </s:NavigatorContent>
      </mx:ViewStack>