This content has been marked as final. Show 3 replies
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.
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.
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.