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
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
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);
}
}
}