# Key Listeners

**URL:** <https://forum.kirupa.com/t/key-listeners/320605>\
**Category:** flash\
**Created:** [March 28, 2011, 10:07am UTC](https://forum.kirupa.com/t/key-listeners/320605 "2011-03-28T10:07:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![handemmet](https://avatars.discourse-cdn.com/v4/letter/h/cdc98d/32.png) [@handemmet](https://forum.kirupa.com/u/handemmet)\
**Post date:** [March 28, 2011, 10:07am UTC](https://forum.kirupa.com/t/key-listeners/320605/1 "2011-03-28T10:07:55Z")

</div>

Hi

I’m trying to use Key Listeners to solve my problem.  
I don’t know much about key liseners so can somebody help me out.

I have the following on a keyframe yet it still wont jump to the certain frames when I press the relevent keys. Am I missing something?

stop();  
KeyListener = new Object();  
KeyListener.onKeyDown = function() {  
if (Key.getAscii() == 38) { // UP key  
gotoAndStop(89);}  
if (Key.getAscii() == 40) { // DOWN key  
gotoAndStop(91);}  
if (Key.getAscii() == 37) // LEFT key  
gotoAndStop(88);}  
if (Key.getAscii() == 32) { // SPACEBAR key  
loadMovie(“application\_01.swf”, “container”);}
