# Suppressing the Enter key

**URL:** <https://forum.kirupa.com/t/suppressing-the-enter-key/194106>\
**Category:** flash\
**Created:** [July 20, 2006, 3:57pm UTC](https://forum.kirupa.com/t/suppressing-the-enter-key/194106 "2006-07-20T15:57:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![clem\_c\_rock](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@clem\_c\_rock](https://forum.kirupa.com/u/clem_c_rock)\
**Post date:** [July 20, 2006, 3:57pm UTC](https://forum.kirupa.com/t/suppressing-the-enter-key/194106/1 "2006-07-20T15:57:27Z")

</div>

Hello,

I have a problem in a flash project which is being developed as a stand alone application that will be played from a cd. At any point in the application where the user hits the enter key, the program will jump to the text frame.

Is there a way to suppress this?

I’ve tried this line of code but it doesn’t respond:

var myListener:Object = new Object();  
myListener.onKeyDown = function()  
{  
if( Key.getCode() == Key.ENTER )  
{  
\_root.gotoAndStop( \_root.\_currentframe ); //keeps the program on the current frame  
}  
}

Key.addListener( myListener );
