Search code examples
apache-flexfadeeffectstransitionstates

flex smooth transition between states


i have the states defined below:

<s:states>      
    <s:State name="DoorState"/>
    <s:State name="TvState"/>
    <s:State name="LightsState"/>
    <s:State name="BlindsState"/>
    <s:State name="BedState"/>              
</s:states>

Each of them fires a component to appear, what should i do to achieve a smooth transition between them no matter the fromState and toState? maybe a fadeOut-fadeIn effect or so??

<s:transitions>
    <s:Transition fromState="*" toState="*">
        ???
    </s:Transition>
</s:transitions>

Solution

  • i used the transition below

    <s:transitions>
        <s:Transition fromState="*" toState="DoorState">
                <s:Move xFrom="1366" xTo="0" duration="500" target="{doorComponent}"/>
        </s:Transition>
        <s:Transition fromState="*" toState="LightsState">
            <s:Move xFrom="1366" xTo="0" duration="500" target="{lightsComponent}"/>
        </s:Transition>
        <s:Transition fromState="*" toState="BedState">
            <s:Move xFrom="1366" xTo="0" duration="500" target="{bedComponent}"/>
        </s:Transition>
        <s:Transition fromState="*" toState="BlindsState">
            <s:Move xFrom="1366" xTo="0" duration="500" target="{blindsComponent}"/>
        </s:Transition>
        <s:Transition fromState="*" toState="TvState">
            <s:Parallel>                
                <s:Move xFrom="1366" xTo="0" duration="500" target="{tvComponent}"/>
            </s:Parallel>
        </s:Transition>
    </s:transitions>
    

    its like slide in/out..