2 Replies Latest reply on Feb 29, 2008 7:50 PM by jooeee

    Navigating via View Stack for 4 Components

    jooeee
      My application outline is as follows:

      Main Application File

      <ViewStackMain contains three main components immediately below>

      Component A Component B Component C

      <ViewStackSub for 4 below>

      SubComponent A1
      SubComponent A2
      SubComponent A3
      SubComponent A1

      My application runs fine except for one problem. I can navigate between three main components fine using my main navigation buttons. When I navigate to Component A, SubComponent A1 is the one that I want to present everytime a user navigates to Component A and it does that fine. I then have a menu of four buttons to navigate between the four SubComponents and that works fine while I stay within Component A. Envision now that I navigate to Component A and then to SubComponent A3, but then I decide to navigate via the main menu to Component C while I am located at Component A > SubComponent A3. I am successful navigating to Component C. I then decide to navigate to Component A again. Component A presents fine but it presents SubComponent A3 (the sub location I last left Component A to go to Component C). What I want to happen is when a user leaves Component A from any SubComponent presenting position(A1, A2, A3, or A4) and goes to another main Component (B or C), and then returns to Component A via the main menu, SubComponent A1 is the presenting positon every time.

      I have been trying ViewStack navigation as well State navigation but without success. Everything else in the application works fine. I am going crazy!!!!!!!!!!!! Help someone, please. Joe Kerenick
        • 1. Re: Navigating via View Stack for 4 Components
          ntsiii Level 3
          Use the "show" event of each child view component to set its ViewStack.selected index = 0;

          Tracy
          • 2. Re: Navigating via View Stack for 4 Components
            jooeee Level 1
            Hi Tracy

            Could you be a bit more detailed my code is below.

            <?xml version="1.0" encoding="utf-8"?>

            <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" label="Theatre" height="460" backgroundColor="#ffffff" width="779" y="121" x="285" showEffect="{myFade}" xmlns:comp="components.*">

            <mx:Fade id="myFade" duration="2000"/>

            <mx:Canvas height="400" id="theatreRtMain" backgroundColor="#FFFFFF" borderColor="#CC0033" borderStyle="solid" borderThickness="1" cornerRadius="25" width="350" y="30" fontFamily="Verdana" color="#000000" horizontalScrollPolicy="off" x="399" verticalScrollPolicy="off">

            <mx:HBox x="35" y="8" width="278" height="20" horizontalAlign="center" borderColor="#000000" borderThickness="1" backgroundColor="#CC0033" horizontalScrollPolicy="off" id="hbox1">
            <mx:LinkButton label="Curriculum" fontFamily="Verdana" fontWeight="normal" fontSize="10" color="#ffffff" textAlign="center" textRollOverColor="#808080" themeColor="#c0c0c0" click="vStackTheatre.selectedChild=theatrecurriculum"/>
            <mx:LinkButton label="Photos" fontFamily="Verdana" fontWeight="normal" fontSize="10" color="#ffffff" textRollOverColor="#808080" themeColor="#c0c0c0" click="vStackTheatre.selectedChild=theatrephotos"/>
            <mx:LinkButton label="About Us" textAlign="center" fontFamily="Verdana" fontWeight="normal" fontSize="10" textRollOverColor="#808080" color="#ffffff" themeColor="#c0c0c0" id="linkbutton1" click="vStackTheatre.selectedChild=theatreaboutus"/>

            </mx:HBox>
            <mx:HBox x="35" y="372" width="278" height="20" horizontalAlign="center" borderColor="#000000" fontFamily="Verdana" fontWeight="normal" backgroundColor="#CC0033" id="hbox2">
            <mx:LinkButton label="Awards 07-08" fontWeight="normal" fontSize="10" color="#FFFFFF" fontFamily="Verdana" textRollOverColor="#808080" themeColor="#c0c0c0" click="vStackTheatre.selectedChild=theatreawards0708"/>
            <mx:LinkButton label="Awards 06-07" fontStyle="normal" fontWeight="normal" fontSize="10" color="#FFFFFF" fontFamily="Verdana" textRollOverColor="#808080" themeColor="#c0c0c0" click="vStackTheatre.selectedChild=theatreawards0607"/>
            </mx:HBox>


            <mx:Canvas x="8" y="36" width="340" height="328" id="rtContentWrapper">










            <mx:ViewStack id="vStackTheatre">
            <comp:TheatreAboutUs id="theatreaboutus" width="334" backgroundColor="#CC0033"/>
            <comp:TheatrePhotos id="theatrephotos"/>
            <comp:TheatreAwards0708 id="theatreawards0708"/>
            <comp:TheatreAwards0607 id="theatreawards0607"/>
            <comp:TheatreCurriculum id="theatrecurriculum"/>
            </mx:ViewStack>
            </mx:Canvas>

            </mx:Canvas>



            <mx:Canvas width="350" height="400" id="visualArtsLeftMain" backgroundColor="#CC0033" borderColor="#000000" borderStyle="solid" borderThickness="1" left="30" top="30" cornerRadius="25">
            <mx:Canvas x="8" y="36" width="95%" height="329" id="leftMainWrapper">
            <mx:Image width="329" horizontalAlign="center">
            <mx:source>assets/still_images/theatre_stills/honk_01_theatre_hp_121707.jpg</mx:source>



            </mx:Image>
            </mx:Canvas>

            </mx:Canvas>


            </mx:Canvas>