actionscript 3 - Event listener to keyboard event not listening in a module -
actionscript 3 - Event listener to keyboard event not listening in a module -
i doing within module containing viewstacks , childs. calling oninit() on creationcomplete of module.
when within 1 of childs of viewstack of module , press enter, doesnt not invoke listener function @ (bp within not hit).
private function oninit():void{ this.addeventlistener(keyboardevent.key_down, keypressed); } private function keypressed(evt:keyboardevent):void {//this breakpoint never gets nail on pressing key in screen if (evt.keycode == keyboard.enter) { //do } }
you should add together key listeners stage objects:
private function oninit():void{ this.stage.addeventlistener(keyboardevent.key_down, keypressed); }
actionscript-3 flex flex3
Comments
Post a Comment