Applying view states

You can set the view state of any Flex component, including the Application component. A component can have different view states at different times, but is in only one view state at a time.

The following example code lets the user change between two view states by clicking Button controls; button b1 sets the view state to the newButton state, and button b2 sets the view state to the base state.

<mx:Button id="b1" label="Add a Button" click="currentState='newButton';"/>
<mx:Button id="b2" label="Remove Added Button" click="currentState='';"/>

Flex 2.01

Take a survey