Jump to content
Search Community

MouseEnabled issues

bdavey311 test
Moderator Tag

Recommended Posts

Hola,

 

Once the skipIntro function is called I want the button to fadeout to 0 and then be disable or invisible so it can't be clicked again. The button isn't clickable but the alpha gets stuck at .5 and doesn't fade out all the way. What am I missing? ;) It should go to 0!

 

skipButton.buttonMode = true;
skipButton.addEventListener(MouseEvent.ROLL_OVER, overHandler);
skipButton.addEventListener(MouseEvent.ROLL_OUT, outHandler);
skipButton.addEventListener(MouseEvent.CLICK, skipIntro);

TweenLite.to(skipButton, 1, {autoAlpha:.5, ease:Quad.easeOut});

function overHandler(event:MouseEvent):void {
TweenLite.to(skipButton, .3, {autoAlpha:1, ease:Quad.easeOut});
}
function outHandler(event:MouseEvent):void {
TweenLite.to(skipButton, .5, {autoAlpha:.5, ease:Quad.easeOut});
}
function skipIntro(event:MouseEvent):void {
TweenLite.to(skipButton, .5, {autoAlpha:0, ease:Quad.easeOut});
tl.gotoAndPlay("endFrame");
skipButton.mouseEnabled = false;
}

 

Thanks!

Link to comment
Share on other sites

It probably goes to alpha:0.5 because that's what you set up in your ROLL_OUT handler. Put a trace() in your rollOut method and I bet you'll see it fire. Remove your ROLL_OVER/ROLL_OUT listeners if you don't want it to trigger those.

 

As for disabling the button and fading it out at the 22 second point, just TweenLite.to(mc, 1, {autoAlpha:0}) then. And remove your listeners if you want to disable it (or set mouseEnabled = false). Were you asking how to delay that from happening until 22 seconds elapses? If so, just use a TweenLite.delayedCall() to call a method at that point where you run your conditional logic. Or put it on your timeline. Lots of options.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...