Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppressing the Enter key

Status
Not open for further replies.

clemrock

Programmer
May 20, 2004
118
US
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 );
//------------------------------------------------------------------------


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top