3 Replies Latest reply on Oct 19, 2006 2:24 PM by ntsiii

    Application View States -vs- Windows

    FatManF31
      Hello,
      I'm a new Flex user, and have just gotten started using Flex 2. I have lots of experience developing web apps using ASP.NET. I have poured over all the downloadable documentation, and most of what I see in the docs are single window samples. I have a flex application to develop that will probably end up being about 25 different screens. I am wondering what the proper way to partition the source code should be. Do I need to create one "MXML Applicaton" per screen? If so, that would result in a different SWF file for each screen, right? When I move from screen to screen, is it going to keep the same session object so I can retain the context of the user's actions? Or, is it the standard practice to try to cram all of the screens into a single MXML Application file as different "View States" and have the entire application load up when they hit the huge single SWF file?
        • 1. Re: Application View States -vs- Windows
          World_Traveler
          I have the same question !!

          I too have to develop a rather complex Ordering-Production-Shipping-Billing application. Many screens and lots of business logic.

          I will use ColdFusion for the backend and lots of data logic will be in the database and CFC. Flex will handle the user interface part.

          But I am not quite sure how to handle the windows part and also the "modal" aspect of the interface.

          For now my prototype uses ViewStacks and some panels uses states depending on customer type or product type selected. The user needs to be at the top most view of a main function to access other main functions like Production or Shipping. If a user digs into a main function I remove the options (using states) to jump to other main functions.I want them to close the transactions before jumping to other things in the application.

          The main MXML file contains the application bar and MainViewStack. Each main function is in a separate MXML file (as per examples in the documentation).

          The swf is likely to be large but I do not mind so much, it will be used on the Intranet on a 1gb network.

          Steve

          • 2. Re: Application View States -vs- Windows
            FatManF31 Level 1
            Hello..........hello.............hello
            Echo..........echo.............echo!
            • 3. Re: Application View States -vs- Windows
              ntsiii Level 3
              First, this is a Flex question and so should go in the General discussion forum, not here in the Flex Builder forum.

              You will be better served if you do not think in terms of "files" but rather in terms of "components". Organization of source code does not directly relate to the run-time structure of an app. A single swf app can be compiled from many individual component files in any desired folder structure.

              A Flex app is comprised of components, rendered in the Flash Player. How you choose to instantiate the components depends on many factors including users bandwidth, the type of app it is, etc.

              Components can be compiled into the swf, which is the easiest to do, but results in a large swf. Other options include Loader, which allows you to load swfs at will. You can also use actionscript to programmatically instantiate controls at run time. Each method has tradeoffs and limitations and most large apps use a combination.

              So there is no simple answer.

              Consider using the Cairngorm Framework for a large app.

              Tracy