PDA

View Full Version : Make flash relenquish focus


jlacivita
03-03-2006, 09:58 PM
Hi guys,

I am switching a site from a complete self contained flash movie to a mix of HTML/CSS/JavaScript and Flash.

One big problem I'm having is this: When you click on one of the flash components, that flash component takes the focus and all keyboard events (and i'm guessing scrollwheels) are absorbed by flash. This is anoying because you can no longer press pagedown on your keyboard to scroll the site.

Anyone hava a javascript or actionscript way to get focus away from the flash movie after its clicked?

I'd like to avoid having ActionScript pass all these events to javascript and then having the javascript do the scrolling.

jlacivita
03-09-2006, 05:53 PM
put this in your flash movie on frame 1:


var listener = new Object();
listener.onMouseUp = function() {
getURL("javascript:flashMouseDown();");
}

Mouse.addListener(listener);


and put this javascript in your HTML:


function flashMouseDown() {
this.focus();
}


works in IE (win) Firefox(win) but not on safari or firefox for mac =(

any ideas on how to make this work on Mac browsers?

I guess the flash plugin on mac handles focus differently.