key pressed?

"Laurent Cocea" <[email protected]> Sun, 19 Oct 2003 08:17:49 -0700 (PDT)
Newsgroups gmane.comp.web.ming.general
Message-ID <20031019081750.9647.h012.c009.wm@mail.canada.com.criticalpath.net>
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);";