So I’m having an issue with rolling over a movie clip. The MC is just a textfield with a black square behind it (with the alpha turned down, so the the mouse doesn’t need to be on the thin text, but this problem also happens without this box (and the text field enabled…see code)).
Right now, what happens (according to trace) is that the event is firing anywhere from 2-5 times each time I roll over (it’s different each time, with no discernible pattern). This is more obvious when I have a little “tick” sound that plays when I roll over, and now it plays 2-5 times.
Part of the “on roll over” event is scaling up the mc, which I’m pretty sure is what’s causing the problem (I took it out and it works fine). However, not scaling isn’t an option here.
This also happens with MouseEvent.MOUSE_OVER/OUT
Here’s the code I have:
rollovermc.addEventListener(MouseEvent.ROLL_OVER, doOver);
rollovermc.addEventListener(MouseEvent.ROLL_OUT, doOut);
rollovermc.text_field.mouseEnabled = false; //So only the hitbox recieves the events...?
private function doOver(e : MouseEvent) {
trace("ROLL OVER: "+e.currentTarget.name); //This appears 2-5 times
new TickSound().play() //just a small rollover tick sound, this plays 2-5 times
var currMC = e.currentTarget;
currMC.scaleX = currMC.scaleY = 1.3;
}
private function doOut(e : MouseEvent) {
var currMC = e.currentTarget;
currMC.scaleX = currMC.scaleY = 1;
}