/ Published in: ActionScript 3
Whenever you press on a remote control button (through wireless), Flash can detect what button is being pressed
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler); // Key Handling public function onKeyDownHandler( e:KeyboardEvent ):void { trace("Key Down:" + e.charCode + ":" + e.keyCode); switch( e.keyCode ) { case 16777227: // rev break; case 16777226: // fwd break; case 16777223: // play case 13: // ok,enter break; case 16777225: // stop break; case 16777224: // pause break; case 16777220: // ch+ case 38: // up break; case 16777221: // ch- case 40: // down break; case 62720: // A - remote case 65: // A - keyb case Keyboard.RIGHT: break; case Keyboard.LEFT: break; } }