Firefox 3.6 Mac bug with MouseEvent
Posted by: Romuald in talking, tags: as3, experiment, flash, html, javascriptFirefox 3.6 introduced a very annoying bug, and only on a Mac.
If you're using somewhere a MouseEvent.ROLL_OUT or MouseEvent.MOUSE_OUT, this event will fired even if you only click on a object without leave the object with the mouse.
The select box in the middle of the page doesn't work because a roll out event is fired when you click on it.
I didn't try yet to find a fix with MOUSE_UP and MOUSE_DOWN, but the problem is, all the existing sites that are using those events might be broken...
I believe Firefox is, or not firing the right event, or removing and putting back the flash so it loses the focus, meaning roll out is fired... A friend told me that the same things happen with java applet, didn't verify it yet.
To test it, paste this as a document class:
-
package com.soundstep.baseui.demo {
-
import flash.events.MouseEvent;
-
import flash.display.Sprite;
-
public class Main extends Sprite {
-
public function Main() {
-
var s:Sprite = new Sprite();
-
s.graphics.beginFill(0xFF0000);
-
s.graphics.drawRect(0, 0, 100, 100);
-
s.addEventListener(MouseEvent.MOUSE_OUT, test);
-
addChild(s);
-
}
-
private function test(e:MouseEvent):void {
-
trace("ok");
-
}
-
}
-
}
Click on the square and you'll see that the MOUSE_OUT is fired...
I hope they'll fix soon or I'll have to find a hack and change everything that is live.
Romu



Entries (RSS)
March 5th, 2010 at 6:29 pm
I was running into a similar issue and it gave me a headache for quite some time.
The fix however was simple (if you or anyone even still needs it):
Replace all instances of .CLICK with .MOUSE_DOWN, replace all .MOUSE_OVER with .ROLL_OVER and .MOUSE_OUT with .ROLL_OUT
March 5th, 2010 at 6:33 pm
I had the same issue with both MOUSE_OUT and ROLL_OUT. It might be different depending of the code.
Romu
March 5th, 2010 at 6:36 pm
I would think the same idea as my fix above would apply, use ROLL instead of MOUSE for the hover events. Also, make sure you're not mixing ROLL_OUT with MOUSE_OVER and such, keep 'em consistent.
March 5th, 2010 at 6:57 pm
Just read your bug report on the firefox site and got a bit more clarity on your problem. I think what will ultimately fix it for you is changing the .CLICK to .MOUSE_DOWN. My scenario was almost identical to yours upon further review.
Hope this helps!
March 6th, 2010 at 6:23 pm
i guess you just need to add this little line to your css:
object { outline:none; }
even if this doesn't work for your problem - you need to add this to your css since ff 3.6 to prevent the outline around your flash content. especially in fullflash sites.
March 9th, 2010 at 7:44 pm
i too can confirm this annoying bug!
this code:
package {
import dk.esk.display.Square;
import flash.display.Sprite;
import flash.events.MouseEvent;
public class mouseevents extends Sprite {
//constructor
public function mouseevents() {
var button:Square = new Square(100, 100); //this is just a sprite with a rect graphic that has a width of 100 and a height of 100
addChild(button);
button.addEventListener(MouseEvent.MOUSE_OVER, over);
button.addEventListener(MouseEvent.MOUSE_OUT, out);
button.addEventListener(MouseEvent.MOUSE_DOWN, click);
}
//private methods
private function over(e:MouseEvent):void {
trace("OVER");
}
private function out(e:MouseEvent):void {
trace("OUT");
}
private function click(e:MouseEvent):void {
trace("Click");
}
}
}
also traces:
CLICK
OUT
OVER
when i click the button.
i did add: object { outline:none; }, it doesn't work.
i did try with ROLL_OVER and ROLL_OUT, it doesn't work.
March 9th, 2010 at 8:53 pm
yes it's right the css fix doesn't fix the mousebug.
and the bug is getting even stranger:
I am working on a macbook pro with a second monitor.
when I'm tracing out the event.stageY and event.stageY values on the right (extra) monitor - its tracing me the right values and the bug doesn't exist.
when i move the browser over to my macbook monitor - when i click the rollout event is fired and the coordinates show: -1 and -1 !!!!
really strange this one.
March 9th, 2010 at 10:56 pm
Really really strange!! Anybody found a temporary hack? I have opened posts on both Kirupa.com and gotoandlearn.com, hoping to attract some other people with the same issues
March 10th, 2010 at 10:05 am
The one px. focus border can be removed by adding:
a:focus, object:focus {
outline: none;
-moz-outline-style: none;
}
to your css in the html file.
Error still occurs tho.
March 12th, 2010 at 10:35 pm
This is very annoying. We had this problem with one of our major projects. Here is what I did as a work around:
I created a private variabled called _isClickEvent and typed it as a Boolean. Then in my clickHandler I wrote _isClickEvent = true; Then in the mouseOutHandler I wrote if (_isClickEvent) {_isClickEvent = false; return;} . Not the prettiest solution but it did the trick. Basically what I am doing is setting a Boolean to true in the click handler, then in the outHandler which gets fired right away (for no reason) I catch it and return the method, leaving all the code intact for when we actually call it.
Hope this helps some people. Sorry if any of my spelling is wrong, still working, quick post
March 17th, 2010 at 5:13 pm
I'm having the same problem. I worked around it by using getTimer() to measure the time between the last mouse up event and the roll out. If it's < 100, it's probably a "fake" roll out generated by the Firefox bug and I ignore it.
March 17th, 2010 at 8:01 pm
Hej.
http://bugs.adobe.com/jira/browse/FP-4145
+ http://groups.google.com/group/ruflash/browse_thread/thread/c9a239638e7ecd0d here's approx translation:
The click bug also presents under some browsers on PC, but I can't check.. and people seems can't really get the bug =| If the click bug is more annoying, then second & third are quite critical to user experience I would say!
March 23rd, 2010 at 10:15 am
Solved with 3.6.2
Romu
March 23rd, 2010 at 10:46 am
That would be awesome!
March 23rd, 2010 at 10:58 am
1 & 3 looks like fixed, yes. But rendering bug still presents, Romuald, can u confirm?
March 23rd, 2010 at 11:03 am
Not sure about the other.
May 9th, 2011 at 11:35 pm
Is it just me or has this bug been re-introduced? I'm running Mac 10.6.7, Firefox 4.0.1