# Need help detecting simple key press - stuck!

**URL:** https://forum.kirupa.com/t/need-help-detecting-simple-key-press-stuck/252002
**Category:** Uncategorized
**Created:** [February 14, 2008, 7:20pm UTC](https://forum.kirupa.com/t/need-help-detecting-simple-key-press-stuck/252002 "2008-02-14T19:20:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![steviespin](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/steviespin/32/657_2.png) [@steviespin](https://forum.kirupa.com/u/steviespin)
#### Post date: [February 14, 2008, 7:20pm UTC](https://forum.kirupa.com/t/need-help-detecting-simple-key-press-stuck/252002/1 "2008-02-14T19:20:18Z")

</div>

This must be a common problem but i can find the asnwer online. I need to have a movie play when the right cursor is pressed, and go to the first frame with the left is pressed. Can’t be too hard but can’t get it 😛

I tried the below and it works but doesnt detect a specific key.

any help much appreciated!!!

onKeyDown = function() {}

var keyListener:Object = new Object();  
keyListener.onKeyDown = function() {  
trace("DOWN -\> Code: “+Key.getCode()+” ACSII: “+Key.getAscii()+” Key: "+chr(Key.getAscii()));  
};  
keyListener.onKeyUp = function() {  
trace("UP -\> Code: “+Key.getCode()+” ACSII: “+Key.getAscii()+” Key: "+chr(Key.getAscii()));  
};  
Key.addListener(keyListener);
