While working on an AIR / HTML project I needed to fire an event if the mouse left the window. This seemed fairly straight forward. Just add a mouseout to the html body.

view plain print about
1<body onmouseout="somefunction();" >

However, the onmouseout never fired. Adding the same onmouseout to a div also failed. So, I then tried to use jQuery's events to catch the mouseout

view plain print about
2     //something here
3     });

Unfortunately, this had the same result; the event never fired.

I then started looking into AIR specific functions to see if there was something to accomplish this. To my non-surprise AIR has this handled.

view plain print about
2     // some js here
3    });
5    window.nativeWindow.stage.addEventListener('mouseOver',function(e){
6     // some js here
7    });

Till next time..