# Keylistener or onClipEvent?

**URL:** https://forum.kirupa.com/t/keylistener-or-onclipevent/245792
**Category:** Uncategorized
**Created:** [December 4, 2007, 6:01am UTC](https://forum.kirupa.com/t/keylistener-or-onclipevent/245792 "2007-12-04T06:01:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![four4swords](https://avatars.discourse-cdn.com/v4/letter/f/87869e/32.png) [@four4swords](https://forum.kirupa.com/u/four4swords)
#### Post date: [December 4, 2007, 6:01am UTC](https://forum.kirupa.com/t/keylistener-or-onclipevent/245792/1 "2007-12-04T06:01:10Z")

</div>

hi!

I want something that checks for which keys are pressed down and does something according to which keys…

I’ve got a choice between

keylisteners… orr… the onClipEvent …

Which should i use?

My keylistener works… but since it’s an object… I can’t seem to trace it’s \_parent.\_name… even though I made that object INSide a movieclip…

```auto
KeyListener = new Object();
KeyListener.onKeyDown = function() {
        trace(this._name);
};
Key.addListener(KeyListener);

```

Soo… Maybe “onClilpevent(keyDown){}” would be better…

These two would achieve the same effect… but would one be better than the other?  
( The game will probably have lots of keys being pressed… like fighting combos…)

Thanks
