I made a block that everytime the user rolls the mouse over, a shape will fade in and when the user rolls out, the shape fades out. It works fine, but it won’t if the user rolls out the mouse sooner than the end of the tweening.
here is a link to that flash animation:
http://www.warplayart.com/page/navigation.html
here is my code very simple.
import fl.transitions.Tween;
import fl.transitions.easing.*;
var inTween:Tween;
var outTween:Tween;
var currAlpha:Number;
import flash.events.MouseEvent;
alphaOver_mc.addEventListener(MouseEvent.MOUSE_OVER, fadeout);
alphaOver_mc.addEventListener(MouseEvent.MOUSE_OUT, fadein);
function fadein(event:MouseEvent):void
{
inTween = new Tween(alphaOver_mc, "alpha",Regular.easeOut,0,1,1,true);
}
function fadeout(event:MouseEvent):void
{
outTween = new Tween(alphaOver_mc, "alpha", Strong.easeOut,1,0,1,true);
}
The thing I’d like to do is record the value where the inTween has gone to and use that number as the starting number for the fadeout outTween.
Why do i want to do that, because when you move out the mouse quickly, it messes up the animation.
I do not know why the fade in and out get messed up when the mouse passes over the logo. The logo in inside the alphaOver_mc movieClip.