# Rewinding the tween class

**URL:** <https://forum.kirupa.com/t/rewinding-the-tween-class/309700>\
**Category:** flash\
**Created:** [May 21, 2010, 7:44pm UTC](https://forum.kirupa.com/t/rewinding-the-tween-class/309700 "2010-05-21T19:44:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sherm](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@sherm](https://forum.kirupa.com/u/sherm)\
**Post date:** [May 21, 2010, 7:44pm UTC](https://forum.kirupa.com/t/rewinding-the-tween-class/309700/1 "2010-05-21T19:44:09Z")

</div>

Hi everyone,

I am making a button have a tween effect (using the tween class) on MOUSE\_OVER. Then, on MOUSE\_OUT, I want the button tween back to it’s original position. It works right now, but if I hover over and then quickly hover out (before the hover over tween finishes), the tween jumps.

So, how do I make the tween rewind itself? I tried tween.rewind() but couldn’t get it to work.

Here’s my code:

```auto
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

this.addEventListener (MouseEvent.MOUSE_OVER, linkHover);
this.addEventListener (MouseEvent.MOUSE_OUT, linkOut);
var thisX:Number = this.txtHolder.x;

function linkHover (e:MouseEvent):void {
	var aTween:Tween = new Tween(txtHolder, "x", Strong.easeOut, thisX, (thisX - 15), 5, true);
	var bTween:Tween = new Tween(newsBg, "height", Strong.easeOut, 0, 20.55, 5, true);
}

function linkOut (e:MouseEvent):void {
	var aTween:Tween = new Tween(txtHolder, "x", Strong.easeOut, thisX, (thisX - 15), 5, true);
	var bTween:Tween = new Tween(newsBg, "height", Strong.easeOut, 0, 20.55, 5, true);
}

```
