Not sure how to resolve glitchy (on my part) rollover
I have been working on an animated button that uses an if / else condition for it's display graphics. I actually have gotten it to work exactly how I want it to... for the most part, just need advice on final clean-up.
You can view the animation I am struggling with here: www.midnyc.com
So, as you will see, the rollover is constant, and the rollOut and the Click states both incorporate an if / else condition. The idea being, that the button switches graphics on click, and has two rollOut States to accomodate that.
It works fine, but I notice that if you move your mouse across it quickly, the second rollover state (the sentence graphic) is visible... which should not be occuring since there was never a click, and I am not really sure how to remedy that. Below is my code if anyone can determine the issue:
btn_disHit.buttonMode = true
btn_disCase.buttonMode = true
btn_disHit.addEventListener (MouseEvent.MOUSE_OVER, disOver);
btn_disHit.addEventListener (MouseEvent.CLICK, disClick);
btn_disHit.addEventListener (MouseEvent.MOUSE_OUT, disOut);
function disOver (e:MouseEvent):void{
btn_disCase.gotoAndPlay ("disOver");
}
//10=end of over//16=disClick//17=disClickB//45=disOut//55=disOutB//
function disClick (event: MouseEvent):void
{
if (btn_disCase.currentFrame == 10)
{
btn_disCase.gotoAndPlay (17);
}
else
{
btn_disCase.gotoAndPlay (10);
}
}
function disOut (event: MouseEvent):void
{
if (btn_disCase.currentFrame == 10)
{
btn_disCase.gotoAndPlay (45);
}
else
{
btn_disCase.gotoAndPlay (55);
}
}