i have a movieclip that is at the top of my movie and it checks for events such as mousedown and mousereleased which work fine but when i try to get keydown event nothing happens unless i highlight text that is in said movieclip then (even after unhighlighted) the keyboard event works perfectly…seems kinda strange to me… heres my code.
public function Outline(g:,yGame){
game = g;
this.addEventListener(MouseEvent.MOUSE_DOWN,mouseDown);
this.addEventListener(MouseEvent.MOUSE_UP,mouseUp);
this.addEventListener(KeyboardEvent.KEY_DOWN,onKeyDown);
this.addEventListener(MouseEvent.DOUBLE_CLICK,doubleClick);
}
private function mouseDown(event:MouseEvent):void{
trace("mouseDown");
game.dispatchEvent(event);
}
private function mouseUp(event:MouseEvent):void{
game.dispatchEvent(event);
}
private function onKeyDown(event:KeyboardEvent):void{
trace("key: "+event.charCode+ " OUTLINE");
game.dispatchEvent(event);
}
any help would be appreciated.
oh and this class is linked to a movieclip within flashcs3