Adobe Flex 3 Help

Creating a view state

You 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.

  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.

    New State button

    The New State dialog box appears. The newly created state is based on the selected state in the States view.

    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.