Using a filter in Transition
<?xml version="1.0" ?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="700">
<mx:states>
<mx:State name="Two">
<mx:SetProperty target="{p1}" name="visible" value="false" />
<mx:SetProperty target="{p2}" name="visible" value="true" />
<mx:SetProperty target="{p2}" name="x" value="0" />
<mx:SetProperty target="{p2}" name="y" value="0" />
</mx:State>
</mx:states>
<mx:transitions>
<mx:Transition fromState="*" toState="*">
<mx:Sequence targets="{[p1,p2]}">
<mx:Sequence id="sequence1" filter="hide">
<mx:WipeUp />
<mx:SetPropertyAction name="visible" value="false" />
</mx:Sequence>
<mx:Move filter="move" />
<mx:Sequence id="sequence2" filter="show">
<mx:SetPropertyAction name="visible" value="true" />
<mx:WipeUp />
</mx:Sequence>
</mx:Sequence>
</mx:Transition>
</mx:transitions>
<mx:Canvas id="pm" width="100%" height="100%">
<mx:Panel id="p1" title="A" x="0" y="0" width="100" height="100" click="currentState=''">
<mx:Label text="One" />
</mx:Panel>
<mx:Panel id="p2" title="B" x="0" y="110" width="100" height="100" click="currentState='Two'">
<mx:Label text="Two" />
</mx:Panel>
</mx:Canvas>
</mx:Application>
Related examples in the same category