Hori76
asked on
Animate a Movieclip in AS3 with Tweener by MouseOver and MouseOut
I have 4 buttons, when I roll over a button it needs to fade-in a text on stage. When I roll-out it needs to fade out the text.
I did the fade-in and fade-out with the tweener class, but it only works 1 time, after that, the instance of the text stays on stage and doesn't fade-out anymore.
I don't want to do this with the timeline in the MovieClip, because I need more control over the MovieClip.
This is the script I already have, like I said, it only works once. Can someone tell me what I'm doing wrong?
I did the fade-in and fade-out with the tweener class, but it only works 1 time, after that, the instance of the text stays on stage and doesn't fade-out anymore.
I don't want to do this with the timeline in the MovieClip, because I need more control over the MovieClip.
This is the script I already have, like I said, it only works once. Can someone tell me what I'm doing wrong?
nav.zwembaden.addEventListener(MouseEvent.MOUSE_OVER, zwembaden_MOUSEOVER);
nav.zwembaden.addEventListener(MouseEvent.MOUSE_OUT, zwembaden_MOUSEOUT);
function zwembaden_MOUSEOVER(e:MouseEvent):void
{
var mcLink:MovieClip = new mc_links();
mcLink.linktext.text = "ZWEMBADEN";
mcLink.name = "mcLink_zwembaden";
addChild(mcLink);
mcLink.alpha = 0;
mcLink.blendMode = BlendMode.LAYER;
Tweener.addTween(mcLink, {alpha:1, time:1, transition:"easeInSine"});
}
function zwembaden_MOUSEOUT(e:MouseEvent):void
{
Tweener.addTween(getChildByName("mcLink_zwembaden"), {alpha:0, time:1, transition:"easeInSine"});
//stage.removeChild(stage.getChildByName("mcLink_zwembaden"));
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Unfortunately it's not my swimming pool... :)
Open in new window