Copy link to clipboard
Copied
Every time I roll out away from the button, the movie clip alpha resets to 1 after about a second. Here is the script:
import fl.transitions.Tween;
import fl.transitions.easing.*;
b1.addEventListener(MouseEvent.MOUSE_OVER, b1over);
b1.addEventListener(MouseEvent.MOUSE_OUT, b1out);
mc1.alpha = 0;
function b1over(event:MouseEvent):void
{
var tween1:Tween = new Tween(mc1,"alpha",Strong.easeOut,0,1,2,true);
}
function b1out(event:MouseEvent):void
{
var tween2:Tween = new Tween(mc1,"alpha",Strong.easeOut,1,0,1,true);
}
I've tried putting "mc1.alpha = 0;" in at every opportunity, as well as making the movie clip invisible from the stage or whatever it's called, but nothing is working.
Hi.
This is probably happening because you have concurrent tweens going on.
A way of solving this is to use only one variable for both tweens and also to stop the tween from the mouse over event before creating another one. Like this:
...import fl.transitions.Tween;
import fl.transitions.easing.*;
var tween:Tween;
function b1over(event:MouseEvent):void
{
tween = new Tween(mc1, "alpha", Strong.easeOut, 0, 1, 2, true);
}
function b1out(event:MouseEvent):void
{
tween.stop();
tween = new Tween(mc1,
Copy link to clipboard
Copied
Hi.
This is probably happening because you have concurrent tweens going on.
A way of solving this is to use only one variable for both tweens and also to stop the tween from the mouse over event before creating another one. Like this:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var tween:Tween;
function b1over(event:MouseEvent):void
{
tween = new Tween(mc1, "alpha", Strong.easeOut, 0, 1, 2, true);
}
function b1out(event:MouseEvent):void
{
tween.stop();
tween = new Tween(mc1, "alpha", Strong.easeOut, 1, 0, 1, true);
}
mc1.alpha = 0;
b1.addEventListener(MouseEvent.MOUSE_OVER, b1over);
b1.addEventListener(MouseEvent.MOUSE_OUT, b1out);
Regards,
JC
Copy link to clipboard
Copied
Thanks so much! It works perfectly now.
Copy link to clipboard
Copied
Excellent! You're welcome!