ulfben

isKeyDown

Oct 30th, 2015
11,544
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private var _hash:Object = {};
  2.  
  3. private function onKeyReleased(event:KeyboardEvent):void {
  4.     delete _hash[event.keyCode];
  5. }
  6.  
  7. private function onKeyPressed(event:KeyboardEvent):void {
  8.     _hash[event.keyCode] = 1;
  9. }
  10.  
  11. private function isKeyDown(code:int):Boolean {
  12.     return _hash[code] !== undefined;
  13. }
  14.  
  15. stage.addEventListener(KeyboardEvent.KEY_UP, onKeyReleased);
  16. stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
Advertisement
Comments
  • User was banned
  • Rteuixl
    217 days
    # text 0.21 KB | 0 0
    1. Best t33n active cpx link daily updates!
    2.  
    3. Copy and paste the link in a new browser tab and then hit enter!
    4.  
    5. https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
    6.  
    7. Remove the @
  • User was banned
  • Comment was deleted
Add Comment
Please, Sign In to add comment