3 Replies Latest reply on Apr 28, 2010 2:26 PM by Chet Haase

    Effects: Sequence / Parallel, correct reverse execution?

    variuse

      Hello,

       

      I'm new to Flex4 and currently experimenting with effects. Here's a short excerpt from my test MXML file regarding transitions between two states:


      <s:states>

         <s:State name="normal"/>

         <s:State name="info"/>

      </s:states>

      <s:transitions>

         <s:Transition>


            <s:Sequence>


               <s:Parallel target="{infoPanel}">

                  <s:Fade/>

                  <s:Resize/>

               </s:Parallel>


               <s:Fade targets="{[eMailLabel, phoneLabel]}"/>


            </s:Sequence>


         </s:Transition>

      </s:transitions>

       

      When my application now does a state transition from "normal" to "info" the sequence is executed correctly: An infoPanel appears by fading and resizing and after that two labels appear by fading within that panel. Nice one!

      But when doing a state transition back from "info" to "normal" the labels and the panel are both fading parallel. The expected behavior would be the two labels disappear and when they're gone completely, then the panel should begin fading and resizing.

       

      How can I achieve that?

       

      Thanks a lot for your help!

       

      Regards,

      F.C.

        • 1. Re: Effects: Sequence / Parallel, correct reverse execution?
          Chet Haase Level 3

          There's nothing that automatically reverses an effect when the transition is played for the reverse state change. To get the effect you want, you need to create a separate transition for both directions, using the fromState/toState properties of Transition, and specify effects that are mirrors. So for the transition effect going back to "normal", you would specify a Sequence where the item Fade happens first, then the panel Fade/Resize.

          • 2. Re: Effects: Sequence / Parallel, correct reverse execution?
            variuse Level 1

            Ah okay... that's what I thought.
            My first idea was that leaving out fromState / toState properties would automatically define a transition to work to both "sides".

             

            Thanks a lot!

             

            Regards,
            F.C.

            • 3. Re: Effects: Sequence / Parallel, correct reverse execution?
              Chet Haase Level 3

              We're actually considering future capabilities around auto-reversing a transition (being able to play its effect backwards). But even if that came to pass, you'd still need to tell the transition which direction was forwards. That is, if you don't specify the from/to information, then it will just be used as the default transition for any state change, and there's no information in the transition to tell it what's forwards or backwards, so it wouldn't always just play in the direction specified in the effect.

               

              Anyway, glad you got it working.

               

              Chet.