javascript to actionscript keypress passing utility?

后端 未结 4 1368
你的背包
你的背包 2020-12-16 07:25

Is there an existing javascript library for relaying key press events in the browser (or certain divs) into flash? I am hoping there might be a library kind of like this on

4条回答
  •  清歌不尽
    2020-12-16 08:00

    When the SWF has focus, you can just listen in actionscript for keypresses. And if you want, you can send them to Javascript as well.

    addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
    
    private function onKeyDown(e:KeyboardEvent):void 
    {
       // handle key down,
    }
    

提交回复
热议问题