• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Code Fix!

keyboardListener = new Object();
keyboardListener.onKeyDown = function ()
{
    trace("You squashed a key.");
}
keyboardListener.onKeyUp = function ()
{
    trace("You released a key. ");
}

Key.addListener(keyBoardListener);

What the Sam Hill?

See what's going on? We create an empty object and set it up as a listener for the Key object, which continually scans the keyboard to see if the user is banging on it.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint