# Enter key ascii code

**URL:** <https://forum.kirupa.com/t/enter-key-ascii-code/69599>\
**Category:** Uncategorized\
**Created:** [November 5, 2004, 6:10pm UTC](https://forum.kirupa.com/t/enter-key-ascii-code/69599 "2004-11-05T18:10:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lomelino](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lomelino](https://forum.kirupa.com/u/lomelino)\
**Post date:** [November 5, 2004, 6:10pm UTC](https://forum.kirupa.com/t/enter-key-ascii-code/69599/1 "2004-11-05T18:10:52Z")

</div>

I am finding it difficult to get the .swf player to perform a function call when the user hits the enter key. It’s a simple implementation really… with information in an input text box, when the user has typed information and they hit enter, the function is called.

this code probably won’t work if copied/pasted… just meant to illustrate what I can’t quite get working…

```auto
myListener = new Object();

myListener.onKeyUp = function () {
	
trace("Key pressed ascii code = " + Key.getAscii());
trace(Key.getAscii());

  
  if (Key.getCode() == 13) {
      enterKey(); //function call to enter key code
  }
  
Key.addListener(myListener);

function enterKey() {
	keyText.text="made it to enterKey()"; //debug
}

```

Suggestions?
