# Combine onRelease and onKeypress

**URL:** <https://forum.kirupa.com/t/combine-onrelease-and-onkeypress/232760>\
**Category:** flash\
**Created:** [July 17, 2007, 3:52pm UTC](https://forum.kirupa.com/t/combine-onrelease-and-onkeypress/232760 "2007-07-17T15:52:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![artriste](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@artriste](https://forum.kirupa.com/u/artriste)\
**Post date:** [July 17, 2007, 3:52pm UTC](https://forum.kirupa.com/t/combine-onrelease-and-onkeypress/232760/1 "2007-07-17T15:52:00Z")

</div>

Hello,

I would like to add an [COLOR=Black]on(keyPress “\<Enter\>”) [/COLOR]functionality to the following code:

```auto
_root.nextimageButton.onRelease = function() {
    if (_root.nextimageInput.text = 9) {
        _root.status.text = "You are now seeing image 9! ";

```

On the main stage, I have a button “nextimageButton”  
and a text input to enter the image number, “nextimageInput”  
When you click the button after typing in a number, it shows you the image corresponding to this number. I want to be able to also have the option to hit Enter .

I did use the on(release), on(kePress) combination before, but only on a button…  
How could I integrate/combine the Enter key pressed to my code ( which is on a frame)?

Thanks
