2 Replies Latest reply on Aug 19, 2010 8:00 AM by jimmyoneshot

    Playing a move effect in reverse after it has finished

    jimmyoneshot Level 1

      I've been experimenting with move effects and I've noticed that it only seems possible to reverse an effect whilst it is actually playing. Is there any way to reverse a move effect AFTER it has finished?


      I have an effect called "moveCoverImage2" and the syntax moveCoverImage2.play() makes it play perfectly but the syntax moveCoverImage2.reverse() doesn't seem to make it play in reverse.


      Can anyone suggest anything?


      I have specified by xfrom and xto coordinates for the effect.

        • 1. Re: Playing a move effect in reverse after it has finished
          injpix Level 3

          I believe there are a few ways to accomplish this in Flex 4, but without seeing your code it is hard to say where it is doing something different then you expect.  Here is an example of an animation that does a reverse.

          http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/effects/Animate.h tml#includeExamplesSummary


          Also note that if you have a value of 0 for repeatCount, it will play the animation indefinitely.  And if it has a value of 1 it will play it once.

          1 person found this helpful
          • 2. Re: Playing a move effect in reverse after it has finished
            jimmyoneshot Level 1

            Hi the code wouldn't really matter to be honest as basically I have the move effect I'm talking about takes place upon creation complete of my application. I have a button which once clicked should play this effect in reverse. This does work AS LONG As the effect is currently playing so I know the effect itself is ok however I want to be able to reverse the effect AFTER it's finished. If I click the button after the effect is actually finished nothing happens. It seems reverse() can only be applied during animations presumably to interrupt animations for certain reasons.


            I suppose I could simply create another move effect which does the same thing except in reverse but I plan to include a lot of similar animations in my app and this seems like a waste of code when I could somehow play one effect forwards and backwards but it doesn't seem possible.