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

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -