Skip to main content
paul_james123
Inspiring
September 28, 2013
Answered

Can I reverse a tween created with the GUI ...with actionscript?

  • September 28, 2013
  • 1 reply
  • 1614 views

Hi All,

I'm newer to Flash so don't take much for granted. I have big gaps in my understanding.

I've created a motion tween (by right clickingon a movieClip on the timeline and choosing 'create motion tween'). Now I want to reverse it (using the 'yoyo' term) when the sound file is done playing. I know how to do this with a tween (using tween class) that was created with actionscript in the first place. How can I cause it to reverse if the tween isn't already (named and included) my actionscript?

Thanks

This topic has been closed for replies.
Correct answer Aaron Beall

If you tween is in a MovieClip you can effectively play the MovieClip backwards like this:

addEventListener(Event.ENTER_FRAME, enterFrame);

function enterFrame(e:Event):void {

      prevFrame();

}

I do this all the time.

-Aaron

1 reply

Aaron BeallCorrect answer
Inspiring
September 28, 2013

If you tween is in a MovieClip you can effectively play the MovieClip backwards like this:

addEventListener(Event.ENTER_FRAME, enterFrame);

function enterFrame(e:Event):void {

      prevFrame();

}

I do this all the time.

-Aaron

paul_james123
Inspiring
September 28, 2013

Thanks for your reply, Aaron.

How do I use that? (IOW: Where do I put that script?, How do I indicate the name of the movie clip it's controlling?)

So, for example: I'm starting the tween in my movie clip by making it visible (its an image that fades up because it's alpha state is tweened) : "myMovieClip.visible = true"

When that  image completely fades up, the image stays visible (100% of alpha state) for an indetermined amount of time then, I want a soundtrack cue to cause it to fade back down (tween back to 0% alpha).

This just happens once (not repeatedly).

Any help is appreciated.

paul_james123
Inspiring
September 29, 2013

Ok I realized that I put that in the frame script.

Thanks Aaron.