2 Replies Latest reply on Jan 27, 2010 5:22 AM by NThaKa1

    Navigation in Flex

    NThaKa1

      Hi Experts,

      I am new to Flex. I am developing one game application. When user play game I have to provide the gaming interface in Flex.

      Game have 4-5 stages. In first stage I will show Game starting, in second Welcome page with user name, in third stage user will play game and in last stage result will be declared.

      Now, when playing game, I want to move user from one stage to other. I want to achieve this within one .swf file. One approach I found is to use "VIEWSTACK" navigation. But in this case I have to place one Viewstack on the page and all 4-5 "mx:Canvas" for different stages. In this way my page will become heavy, more complicated design and confusing.

      So I want to develop this in a way like we are doing "Response.Redirect" in other application.

      Please provide me your experience, expertise and ideas to make this happen. Also provide sample code if you have.

      Any kind of help, suggestions would be greatly appreciated.

        • 1. Re: Navigation in Flex
          archemedia Level 4

          I wouldn't suggest redirect. I would use a viewstack.

          You don't have to put all base components in this stack though, just create custom components for each view (5):

           


              <mx:ViewStack width="100%" height="100%">
                   <components:StartPage/>
                  <components:WelcomePage/>
                   <components:MainGame/>
                   <components:Results/>
              </mx:ViewStack>

           

          You can then build each component which can include other custom components...

          There are good tutorials in the Flex help files on building simple and complex custom components

           

          Dany

          1 person found this helpful
          • 2. Re: Navigation in Flex
            NThaKa1 Level 1

            Hi archemedia,

             

            Thank you very much for your assistance. You made my day.

             

            I will implement this approach, Will consult you if need any further help regarding this.