# Want Enter key in inputbox trigger button click

**URL:** <https://forum.kirupa.com/t/want-enter-key-in-inputbox-trigger-button-click/210527>\
**Category:** flash\
**Created:** [December 19, 2006, 6:43pm UTC](https://forum.kirupa.com/t/want-enter-key-in-inputbox-trigger-button-click/210527 "2006-12-19T18:43:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![artcoder](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@artcoder](https://forum.kirupa.com/u/artcoder)\
**Post date:** [December 19, 2006, 6:43pm UTC](https://forum.kirupa.com/t/want-enter-key-in-inputbox-trigger-button-click/210527/1 "2006-12-19T18:43:04Z")

</div>

I have a stripped down FLA here: [[COLOR=#0055bb]http://www.webmarksonline.com/temp/detectenter.fla[/COLOR]](http://www.webmarksonline.com/temp/detectenter.fla)

where if you click the button, a label saying “Button clicked” will display. This was accomplished using the following actionscript attached to the button…

on(release) {  
display.\_visible =true;  
}

Now I want to make it so that when the enter key is pressed in the edit field, the same thing happens.

On the button actionscript, I have used …

on (keyPress “\<Enter\>”) {  
display.\_visible = true;  
}

But does not work. Why not? Google search says that this should work. I’m on Flash 8, by the way.
