Hi guys, I was wondering if anyone here would have the knowledge to help me out. I am trying to make a flash navigation menu across the top of my site. To make the long story short I have already made an effect that activates based on a ROLL_OVER mouse event. This effect works, but there is a small problem with it. When i move my mouse over the movie clip area, that is designated to be the button, it does the rollover action. But if i move the mouse into that area and keep moving it it repeats the action until i stop moving the mouse. Basically what I am trying to ask is why does it repeat the Rollover action when the mouse keeps moving. To further explain my situation in detail:
- If I move my mouse into the rollover area and stop mouse, everything works fine.
- If I move my mouse into the rollover area and keep moving the mouse slowly before the animation finishes, then it repeats itself from the beginning.
- If I then stop my mouse at any point, the animation will play out and then I can move my mouse as much as I want and nothing will happen like it is supposed to.
I just want the animation effect to play once soon as mouse touches it and not play again until mouse leaves the hit area.
This is my code:
homebtn.buttonMode = true;
homebtn.addEventListener(MouseEvent.ROLL_OVER, over, false, 10, true);
homebtn.addEventListener(MouseEvent.MOUSE_DOWN, link);
function over(e:MouseEvent):void
{
homebtn.removeEventListener(MouseEvent.ROLL_OVER,over);
e.currentTarget.gotoAndPlay(“over”);
homebtn.addEventListener(MouseEvent.ROLL_OUT, out);
}
function out(e:MouseEvent):void
{
homebtn.removeEventListener(MouseEvent.ROLL_OUT,out);
e.currentTarget.gotoAndPlay(“out”);
homebtn.addEventListener(MouseEvent.ROLL_OVER, over);
}
function link(e:MouseEvent):void
{
var request:URLRequest = new URLRequest (‘default.html’ );
navigateToURL(request, ‘_self’);
}
I added the “remove event listener” and it made it much better, but again, if I enter the hit area and don’t stop moving the mouse it repeats the action over and over making the effect look like its spazzing or glitching. Any commentary would be appreciated. Thank You