# Tween Class Problem

**URL:** <https://forum.kirupa.com/t/tween-class-problem/206947>\
**Category:** flash\
**Created:** [November 13, 2006, 1:15pm UTC](https://forum.kirupa.com/t/tween-class-problem/206947 "2006-11-13T13:15:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Balala](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Balala](https://forum.kirupa.com/u/Balala)\
**Post date:** [November 13, 2006, 1:15pm UTC](https://forum.kirupa.com/t/tween-class-problem/206947/1 "2006-11-13T13:15:25Z")

</div>

Hi all!

Im having a little trouble using the Tween Class. What im trying to do is, a simple menu, when i roll over a button, it will expand and move the others itens to the left.

Take a look at this sample:  
[http://www.fonix.com.br/test.swf](http://www.fonix.com.br/test.swf)

If i move the mouse slowly, no problems, the big deal happen when i roll over a button, when still the previous Tween movement.

I alredy have tryied to stop the current Tween using Tween::stop(), still the same problem ☹

Thanks in advance.  
:p:

---- Code

```auto
stop();

easeType = mx.transitions.easing.None.easeNone;
var i:Number;
var target:MovieClip;
var mc:MovieClip;
var frames:Number = 10;

for(i = 1; i <= 4; i++)
{
	mc = this["btn_" + i];
	mc.i = i;
	mc.iniX = mc._x;
	
	mc.onRollOver = function()
	{
		new mx.transitions.Tween(this, "_width", easeType, this._width, 156, frames);
		for(i = 1; i < this.i; i++)
		{
			target = this._parent["btn_" + i];
			new mx.transitions.Tween(target, "_x", easeType, target._x, target.iniX - 120, frames);
		}
	}
	
	mc.onRollOut = mc.onReleaseOutside = function()
	{
		new mx.transitions.Tween(this, "_width", easeType, this._width, 36, frames);
		for(i = 1; i < this.i; i++)
		{
			target = this._parent["btn_" + i];
			new mx.transitions.Tween(target, "_x", easeType, target._x, target.iniX, frames);
		}
	}
}

```
