# AS3 and TweenMax and reverse() function

**URL:** <https://forum.kirupa.com/t/as3-and-tweenmax-and-reverse-function/296924>\
**Category:** flash\
**Created:** [September 22, 2009, 7:20pm UTC](https://forum.kirupa.com/t/as3-and-tweenmax-and-reverse-function/296924 "2009-09-22T19:20:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![soatman](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@soatman](https://forum.kirupa.com/u/soatman)\
**Post date:** [September 22, 2009, 7:20pm UTC](https://forum.kirupa.com/t/as3-and-tweenmax-and-reverse-function/296924/1 "2009-09-22T19:20:29Z")

</div>

I am trying to get my animation to play in reverse order and this is a pain in my leg.

I have most of it figured out, this script below. I need to know if and how do I get this forward function to stop at a labled frame or key frame and not just use a number of px. In this example I have x: “100”. I need this to just play till it reaches a stop actions / lable frame or key frame. Any and all help will be very helpful. I have been trying to get this animation to play in reverse order for about a week now and I came across the TweenMax and it has a lot of good subclasses, but not much information online about the reverse subclass.

stop()  
// importing the classes TweenMax and easing  
import gs.TweenMax;  
import fl.motion.easing.\*;

var myTween:TweenMax; //Can be access from anywhere within “this” scope.

forward\_btn.addEventListener(MouseEvent.CLICK, forward);  
backward\_btn.addEventListener(MouseEvent.CLICK, backward);

function forward(e:MouseEvent):void {  
myTween = new TweenMax(box\_mc, 1, {x: “100”});  
};

function backward(e:MouseEvent):void {  
trace(“testing”)  
myTween.reverse();  
};

soatman
