PDA

View Full Version : Flex States Question


theGuru
06-24-2009, 11:15 AM
How can i know what state i am viewing in Flex.

<mx:states>
<mx:State name="state1">

</mx:AddChild>
</mx:State>

<mx:State name="state2">

</mx:AddChild>
</mx:State>

</mx:states>

If i am viewing state2, how can i get the value dynamic.

charlesshoults
06-24-2009, 10:03 PM
currentState

Make a label and when you change from one state to another, say stateLabel.text = currentState;

<mx:transitions>
<mx:Transition fromState="*" toState="*">
<mx:Sequence effectEnd="stateLabel.text = currentState"/>
</mx:Transition>
</mx:transitions>