Creating a state based on an existing state

You can use Flex Builder to create a state based on a state that is not the base state.

To create a state based on another state:

  1. Ensure that the MXML file contains at least one state that is not the base state.

    For more information, see Creating a view state.

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

    The New State dialog box appears.

  3. Enter a name for the new state.
  4. From the Based On pop-up menu, select the state on which to base the new state.

    The pop-up menu lists the states defined in the current document.

  5. Click OK.

    The new state appears in the States view.

  6. Use the layout tools in Flex Builder to change the layout.

    You can modify, move, add, or delete components. As you make changes to the state, they're recorded in the MXML code.

  7. Define an event handler to switch to the new state.

    For more information, see Switching states at run time.

Related topics


Flex 2.01

Take a survey