Flex navigation issue - ViewStack, states or something else?
I have a little doubt about my application which is being built using the Mate framework. The first thing the user needs to do is log in, so I created the Login.mxml view. After successful login, I need to display the main view with an applicationControlBar at the top and a workspace below. I have two separate views at the moment, so if I understand correctly it makes sense with a ViewStack.
Thing is, I would like to also show some kind of panel with buttons on top of the workspace after login - here is a screenshot.After clicking on the button, the panel should disappear. To complicate things a bit, chances are that this panel will change state. Clicking on a specific button may display a progress bar at the bottom of the panel.
I feel like I should create a separate view, MenuDialog.mxml, and put buttons, progress bar and status there, but how do I display it at the top of the workspace? Hope my problem is clear enough :)
a source to share
Assuming that perhaps you don't need a login style modal bar (which many of these apps are avoiding these days), you should absolutely use states and not ViewStacks.
States are a much cleaner way to differentiate between different ones, by asserting that your UI can be in -LOGGED_IN, LOGGED_OUT, etc.
It may take a little getting used to working with states, but once you do, you never come back. :-)
a source to share