# KeyboardEvent.Key\_Down focus problems

**URL:** <https://forum.kirupa.com/t/keyboardevent-key-down-focus-problems/229754>\
**Category:** flash\
**Created:** [June 19, 2007, 11:19pm UTC](https://forum.kirupa.com/t/keyboardevent-key-down-focus-problems/229754 "2007-06-19T23:19:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pi3rc3](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pi3rc3](https://forum.kirupa.com/u/pi3rc3)\
**Post date:** [June 19, 2007, 11:19pm UTC](https://forum.kirupa.com/t/keyboardevent-key-down-focus-problems/229754/1 "2007-06-19T23:19:53Z")

</div>

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.

```auto
		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
