FullScreen OnMouseMove Bug

stinkbugHere’s an interesting fact: Going to FullScreen mode causes Flash to temporarily stop executing all onMouseMove events.

I’m sure if someone from Adobe was pressed hard enough they might be able to provide some convoluted ~logical~ reasons why going into full-screen mode stops all onMouseMove events but I’m not buying it. I wasted a few frustrating hours figuring this out and when I searched the web to confirm my suspicions I found no mention of this “feature” so I’m calling it what it is, a BUG.

Here, take a look at this ugly SWF (move your mouse around to draw a line whenever the OnMouseMove event is fired and then press the blue square to toggle fullScreen mode). All mouseEvents are halted until the “Press Esc to exit full screen mode” message fades out.

Get Adobe Flash player

This is all of the code used to create the above SWF:

//
//
function toggleFullScreen(){
    if(Stage["displayState"] == "fullScreen"){
        Stage["displayState"] = "normal";
    }else{
        Stage["displayState"] = "fullScreen";
    }
}
//
//
createEmptyMovieClip("Box", 10);
with(Box){
    beginFill(0x4080AA);
    lineTo(50, 0);
    lineTo(50, 50);
    lineTo(0, 50);
    lineTo(0, 0);
}
Box.onPress = toggleFullScreen;
//
//
lineStyle(0);
onMouseMove = function (){
    lineTo(_xmouse, _ymouse);
}
//
//

If you think you know why Flash temporarily halts onMouseMove events while displaying the “Press Esc” message I’d love to hear it. Until Adobe fixes this you should use an OnEnterFrame event or SetInterval to get around this particular bug when going full-screen in Flash.

14 Responses to “FullScreen OnMouseMove Bug”

  1. f00768500 says:

    It could be that the layer the “Press ESC” msg is attached to has some kind of default code which disables the mouse. There should be some way to change this default setting…

    Just a thought…

  2. Matthew says:

    I agree that its a bug. Don’t see why adobe would stall “onMouseMove” and not “onEnterFrame”.

  3. crusher says:

    For me it does not work even after “Press ESC” faded away.
    I need to return to “windowed” mode to get it back.

  4. brandon says:

    PixelWit,

    Worked fine here, except for the popup message (press esc to exit full screen mode); while that was visible the SWF wouldn’t draw the line.

    • Pixelwit says:

      Hi Brandon. That’s the point. The onMouseMove event should fire every time the mouse moves, even when the “Pres Esc” message is displayed. If onMouseMove isn’t fired every time the mouse moves then it’s not “fine”, it’s broken. 😉

      • Illusion Sector says:

        Hey, Pixelwit.
        It is a nuisance, no doubt about it. It could, though, have been done by design to call full attention to the message, you know, to avoid/reduce chances of having the less computer savvy of us scream “Flash trapped me! I had to restart my computer to get out of it!” …that kind of stuff. I’m just guessing and playing devil’s advocate here is all. XD

  5. Luke says:

    Yes. Very annoying. I had to work around it with an onEnterFrame.

  6. AlexG says:

    I got the same issue on my sites, for example on http://alexgphoto.info
    When you go FullScreen the mouse events are not propagated. It is made in AS3.0
    I saw sites that works fine in fullscreen.
    So, does anybody know what is the mistake?

  7. Alex G. says:

    It didn’t worked for me until the “Press Esc to exit full screen” message faded out, but… the mouse cursor remained as a hand, not an arrow. And when I exited fullScreen, it still remained a hand.

  8. Pixelwit says:

    @Alex T., I use AS2 because that’s what my clients need. No, I haven’t tried this in AS3, does it work? If so, there’s still no excuse for this not to work in AS2.

    @Larsen, did it work while the “Press Esc to exit full screen” message was visible?

  9. Larsen says:

    This actually worked for me in full screen mode.

  10. Alex T. says:

    Did you try that in AS 3.0? For that matter, why are you still using AS2?

Leave a Reply

PixelWit.com's Comment Guidelines


Warning: Undefined variable $user_ID in /home2/pixelwit/public_html/blog/wp-content/themes/fvariant2/comments.php on line 57

You must be logged in to post a comment.

© Sean O'Shell 2007-2024