stage.addEventListener(KeyboardEvent.KEY_DOWN , onKey) function onKey(e:KeyboardEvent):void { if(e.keyCode == Keyboard.ENTER) imfun(null); }