Creating a view state

You can use Flex Builder to create a view state for an application or a component defined in an MXML file. First, you create a base state for the application or component, and then you create a second state based on the base state.

To create a state:

  1. Using the layout tools in Flex Builder, design the layout of the base state of your application or component.

    For more information, see Building a Flex User Interface.

  2. In the States view (Window > States), click the New State button in the toolbar.


    States view

    The New State dialog box appears. The default option is to base the new state on the initial state.


    New State dialog box

  3. Enter a name for the new state, and click OK.

    The name of the new state appears in the States view.

  4. Use the layout tools in Flex Builder to modify the appearance of the state.

    You can edit, move, add, or delete components. As you make changes, the changes defining the new state become part of the MXML code.

  5. Define an event handler that lets the user switch to the new state.

    For more information, see Switching states at run time.

Related topics


Flex 2.01

Take a survey