Chapter 15. Managing View States

Flex applications define view states as particular presentations of a visual component. In each moment of the user's interactions with the application, each visual component presents itself in a particular form known as its current view state. Flex allows you to define as many different view states as you like for the Application and for each of its custom MXML components using declarative code, and then it lets you switch easily between states by setting the Application or custom components currentState property.

View state management in Flex is designed primarily for application scenarios where the Application or component uses a significant portion of its33presentation in multiple situations and makes incremental changes to its presentation for each new situation. This sort of incremental change is different from application navigation, where the user moves between multiple different layers, or views, that don't share content with each other.

You can declare view states in MXML or ActionScript, although the MXML approach is used much more often. The ActionScript code to declare view states is long and verbose. I'll describe it later in this chapter so you have the syntax available, but I strongly recommend using MXML for view state management unless you have a very strong reason to work programmatically

When you switch view states at runtime, you can make the change abruptly, or through the use of transitions, you can choreograph the change with ...

Get Adobe® Flex® 3 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.