# Make mouse event active in keyboard event

**URL:** https://forum.kirupa.com/t/make-mouse-event-active-in-keyboard-event/286960
**Category:** flash
**Created:** [April 23, 2009, 2:35pm UTC](https://forum.kirupa.com/t/make-mouse-event-active-in-keyboard-event/286960 "2009-04-23T14:35:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![LeventKA](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/leventka/32/2160_2.png) [@LeventKA](https://forum.kirupa.com/u/LeventKA)
#### Post date: [April 23, 2009, 2:35pm UTC](https://forum.kirupa.com/t/make-mouse-event-active-in-keyboard-event/286960/1 "2009-04-23T14:35:27Z")

</div>

I’m making a flash game.

When game starts, the car runs automatically.  
Then we click the SPACE button, movement of car stops.  
And the door of structure near car is available to CLICK.

But in coding I got this error code:  
_TypeError: Error #2007: Parameter listener must be non-null.  
at flash.events::EventDispatcher/addEventListener()  
at shfg\_fla::MainTimeline/key\_pressed()_

This is some part of my game code…

case **Keyboard.SPACE** :  
[COLOR=“Magenta”]removeEventListener/COLOR;  
–[COLOR=“Red”]street\_mc.[/COLOR][COLOR=“Teal”]bluehome\_mc[/COLOR].[COLOR=“SeaGreen”]door\_btn[/COLOR].[COLOR="#ff00ff"]addEventListener/COLOR;  
–function door\_ready(en:MouseEvent):void {  
----trace(“Door CLICK active”);  
–}
