0 Replies Latest reply on Aug 14, 2013 5:33 PM by pao1011

    how to push a view to another view to a specific State in Mobile App?

    pao1011 Level 1

      I want to open a second view that contains some states from the first view.

       

      Example: myFirstView  with a spark list component:
      So far I got this code for the view of the list to push to the other views:

       

      <fx:Script>
              <![CDATA[
                  import spark.events.IndexChangeEvent;
                 
                  protected function selectionChangingHandler(event:IndexChangeEvent):void
                  {
                      if(myList.selectedIndex == 0){
                          navigator.pushView(mysecondView);
                      } else if (myList.selectedIndex == 1){
                          navigator.pushView(myThirdView);
                      } else if (myList.selectedIndex == 2){
                          navigator.pushView(myFouthView);
                      }
                     
                  }
                 
              ]]>
      <s:List id="myList" width="100%" height="100%"
                  alternatingItemColors="[#EEEEEE, #E3E3E3]" change="selectionChangingHandler(event)">
                  <s:dataProvider>
                     
                      <s:ArrayList>
                          <fx:Object label="newView 1" />
                          <fx:Object label="newView 2" />
                          <fx:Object label="newView 3" />
                         
                      </s:ArrayList>
                     
                  </s:dataProvider>
                 
              </s:List>
      This code push to the views but I need to go to  any of the states in each view.

       

      And mysecondview  let's say with 3 States:
      <s:State name="myState1"/>
      <s:State name="myState2"/>
      <s:State name="myState3"/>
      From the fisrt view list to go, let's say to mySecondView > myState 1, 2 or 3
      ??????
      Any help?
      Hope is wel explained
      Thanks in advance