This.focus () does not work as expected in Firefox
I am using an ExternalInterface call to activate from a flex app embedded in my html document. The call goes to the javascript function which does
function documentFocus() {
this.focus();
}
Everything works like a charm, except that Firefox doesn't focus the document body to 100%. It stops listening for onkeyup events (it still registers onkeydown).
Very strange behavior. Does anyone know what's going on?
Try it here: http // www.willemdemmers.com / dplxr /
Steps to reproduce: Try the arrow buttons to see normal behavior (arrow images turn red when pressed and stop when a key is pressed) Press the flash at the bottom of the window to remove focus from the document body and trigger a function call. Try the arrow buttons again and see the new behavior.
Key-events are triggered using the arrow keys (left and right).
Thanks!
a source to share
I think the problem is that the flash is greedy on the keyboard when it clicks and grabs it from you.
You can see this in action on ie youtube. when you select a video, you can use the up and down arrows to scroll up and down the page. But when you click on the flash area (video), you can no longer do that. Since the flash takes over the keyboard.
a source to share
Check it out: http://code.google.com/p/custom-context-menu/
This is a project that disables right-clicking with javascript and tells flash when it does. Plus, it works with a very large number of browsers.
not a 100% solution, but you should be able to adapt your JS code to your needs