View States : State « Effects « Flex






View States

View States
          
<?xml version="1.0" ?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#FFFFFF">  
  <mx:states>
    <mx:State name="Description">
      <mx:AddChild relativeTo="{hbox1}" position="before">
        <mx:TextArea width="200" height="180" borderStyle="none" text="this is a test"/>
      </mx:AddChild>
      <mx:RemoveChild target="{descButton}"/>
      <mx:AddChild relativeTo="{hbox1}" position="before">
        <mx:Button label="Close Description" click="this.currentState=''"/>
      </mx:AddChild>
    </mx:State>
  </mx:states>
  <mx:VBox id="vbox1">
    <mx:Label text="Product Name" fontWeight="bold" />
    <mx:Button label="Open Description" click="this.currentState='Description'" id="descButton"/>
    <mx:HBox id="hbox1">
      <mx:NumericStepper id="qty" minimum="1" maximum="10" stepSize="1"/>
        <mx:Button label="Add to Cart"/>
    </mx:HBox>
  </mx:VBox>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Add child to StateAdd child to State
2.Add child before in a StateAdd child before in a State
3.Add child to position in a StateAdd child to position in a State
4.Add or remove childrenAdd or remove children
5.Using different creation policiesUsing different creation policies
6.Setting overrides on component propertiesSetting overrides on component properties
7.Change the enabled property for two Button controls, setting one false, and the other trueChange the enabled property for two Button controls, setting one false, and the other true
8.View defining two states
9.Setting event handlers with StateSetting event handlers with State
10.Change control property in state changingChange control property in state changing
11.Remove a child in state changingRemove a child in state changing
12.Create State based on existing StateCreate State based on existing State
13.Set current state to nullSet current state to null
14.Change control color in StateChange control color in State
15.Add child relative to an existing control in StateAdd child relative to an existing control in State
16.Use two statements in click event inlineUse two statements in click event inline
17.Add child and change property when state changedAdd child and change property when state changed
18.Change view stateChange view state
19.Creating a simple view stateCreating a simple view state
20.Set Transition stateSet Transition state
21.Two statements in the click attributeTwo statements in the click attribute
22.Adding and removing components with StateAdding and removing components with State
23.Adding and removing components by changing stateAdding and removing components by changing state
24.Adding and removing components in State with RemoveChildAdding and removing components in State with RemoveChild
25.Applying statesApplying states
26.Using states to control the display of the popup component.Using states to control the display of the popup component.
27.Validate either a United States ZIP code or a Canadian postal codeValidate either a United States ZIP code or a Canadian postal code
28.Define StatesDefine States
29.States Event HandlersStates Event Handlers
30.States Includes and ExcludesStates Includes and Excludes
31.Deferred view state, and you cannot access it until after the first switch to the Deferred view stateDeferred view state, and you cannot access it until after the first switch to the Deferred view state
32.Use the Reset button to restore the collection view to its original state.Use the Reset button to restore the collection view to its original state.