Re: key pressed?
David Marceau <[email protected]> Sun, 19 Oct 2003 14:30:50 -0400
| Newsgroups | gmane.comp.web.ming.general |
|---|---|
| Message-ID | <[email protected]> |
Laurent Cocea wrote:
>
> Hi all-
>
> I am using ming-dev and I added a key listener to may main timeline
> actionscript (see code below). Surprisingly, I need to click once in the
> browser window running the applet for the thing to work, even if the
> window is already active. Same thing if I click on another window, and
> then I get back to my ming applet window -- I need to click once inside
> the window to get the key lister working again. I would have expected
> this step to be unnecessary. Am I missing something?
>
> Any help will be greatly appreciated.
>
> -Laurent
>
> listenForKey = new Object();
> listenForKey.onKeyDown = function() {
> if (key.getCode() == 33) {
> _root.myKey = 'PAGEUP';
> }
> };
> listenForKey.onKeyUp = function() {
> _root.myKey = '';
> };
> Key.addListener(listenForKey);";
Maybe there is FocusTraversalPolicy in actionscript.
FocusTraversalPolicy does what you want in java/javascript IMHO.
If you want to have proper "TAB key"(focus) behaviour along with the
proper window capturing your pageup pagedown keys you will need to
master the javascript/java focustraversalpolicy stuff and be vigiliant
that it is working properly on all target os's :) Another suggestion is
to have "focus display area hints" showing which of your flash thingy's
have focus :) A simple example of focus-display-area-hinting is the
dashed lines(marquee boxes) being drawn in the current focus area.
Cheers,
David Marceau