2 Replies Latest reply on Feb 26, 2010 6:46 AM by Chet Haase

    Effect that zooms out but doesn't come back in

    nikos101 Level 2

      I have an effect that zooms out but doesn't come back in again even with the   repeatBehavior

       

      <s:Parallel id="rotateY360_GlowBlurZoomOut" effectEnd="effectEndHandler(event)">
                  <s:Rotate3D angleYFrom="0" angleYTo="360" duration="1400" autoCenterTransform="true"
                              />
                 
                  <s:Move3D  duration="700"
                             zBy="2000" repeatCount="2"
                             repeatBehavior="{RepeatBehavior.REVERSE}"
                             autoCenterTransform="false"
                            
                             />

                 
                 
                  <s:Sequence>
                     
                     
                      <mx:Blur  duration="800"
                                blurXFrom="0" blurXTo="5"
                                blurYFrom="0" blurYTo="5"/>
                      <mx:Blur  duration="800"
                                blurXFrom="5.0" blurXTo="0.0"
                                blurYFrom="5.0" blurYTo="0.0"/>
                  </s:Sequence>
                 
                 
                  <s:Sequence>
                     
                     
                      <mx:Glow  duration="1000"
                                alphaFrom="1.0" alphaTo="0.3"
                                blurXFrom="0.0" blurXTo="50.0"
                                blurYFrom="0.0" blurYTo="50.0"
                                color="0xccccff"/>
                      <mx:Glow duration="4000"
                               alphaFrom="0.3" alphaTo="1.0"
                               blurXFrom="50.0" blurXTo="0.0"
                               blurYFrom="50.0" blurYTo="0.0"
                               color="0xccccff"/>
                  </s:Sequence>
              </s:Parallel>

       

      any ideas friends?

        • 1. Re: Effect that zooms out but doesn't come back in
          radikalFish

          Hi

           

          It's very strange, i noticed that the second effects (the Move3D in your example) effectEnd handler is never called...!!??

          So it never can reverse your Move3D.

           

          If you switch your Rotate and Move effect positions so that the Move3D is in first position (becoming first child of the Parallel effect) it works ....

           

          so long

          • 2. Re: Effect that zooms out but doesn't come back in
            Chet Haase Level 3

            The problem is that the transform effects don't interact well with repetition. Check out the ASDocs for AnimateTransform, which explain the situation more, but basically all transform effects get combined internally into a single transform effect instance, so repetition on any one of the effects would create problems for the combined effect.

             

            Repetition does actually work on these effects when they are the only transform effect running, because the system takes the shared properties (such as repetition as well as autoCenterTransform) from the first effect declared. This also means that if you set repetition on the first effect (Rotate3D in your example), then that will kick in for all transform effects. This isn't what you want in many situations (such as yours - you don't want to repeat the Rotate3D), so it's easier to just avoid using them when running more than one transform effect in parallel.

             

            In this case, you need to set up two effects to do the job:

             

                        <s:Move3D  duration="700" zBy="2000"

                                   autoCenterTransform="false"/>

                        <s:Move3D  duration="700" zBy="-2000" startDelay="700"

                                   autoCenterTransform="false"/>

             

            Chet.