3 Replies Latest reply on Dec 7, 2006 6:25 PM by ntsiii

    Multiple Form Application

    Paul_abcdef
      Hi,
      I'm very new to flex and am trying to evaluate if it is suitable for creating a particular application. At the moment my big hurdle is how do I handle multiple 'screens'? I come from a .net background and the application would be built with multiple forms.
      In it's simplest case the user logs in and is presented with a menu. I how do I setup a flash project so that each menu option takes the user to a different screen? All the tutorials I have found are based on single screen apps.

      Paul
      oh on and another note, what would be the flex way of storing the user's login credentials.......
        • 1. Re: Multiple Form Application
          ntsiii Level 3
          The Flex paradigm is very different from the HTML way. HTML is page-based an you change the visible view by calling an url that either navigates to a page or has instructions on how the server should generate the page. In Flex, we almost never call an url. Instead, an HTML wrapper instantiates the FlashPlayer, and our application is defined in a SWF file that is rendered by the player.

          A flex app generally starts with some navigator container component, like a ViewStack, or a TabNavigator. Screens, or views in flex are defined as children of these containers, and often are implemented as components, in their own files.

          You change views or screens by setting a property on the navigator container. ViewStack, for instance has no visual representation alone, but is an abstract stack in which youb place your views. You switch views by calling myViewStack.selctedIndex = 1; //or whatever. TabNavigator comes with a visual set of folder-like tabs that you can click on to change views.

          Since we never call an url, and the Flash Player instance stays in memory, we can store state, like user credentials, on the client itself, and do not need to worry about sessions and cookies and the like. Our data, once on the client, is always available.

          Post back if you have any specific questions.

          Tracy
          • 2. Re: Multiple Form Application
            Paul_abcdef Level 1
            Thank you for taking the time to answer my question. I was slowly forming the idea that I was approaching the solution in the wrong way and your reply clarifies my thinking. All I need to do now is separate my code out into different files a bit otherwise it's one BIG mess.
            Thanks again

            Paul
            • 3. Re: Multiple Form Application
              ntsiii Level 3
              Absolutely. Typically, flex apps are built of components, which are implemented in ActionScript or mxml files. Those components can be extremely complex, encapsulating as much functionality as you want.

              Tracy