# On(keyPress)....on(keyup)?

**URL:** <https://forum.kirupa.com/t/on-keypress-on-keyup/204028>\
**Category:** Uncategorized\
**Created:** [October 16, 2006, 4:25pm UTC](https://forum.kirupa.com/t/on-keypress-on-keyup/204028 "2006-10-16T16:25:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![richter](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@richter](https://forum.kirupa.com/u/richter)\
**Post date:** [October 16, 2006, 4:25pm UTC](https://forum.kirupa.com/t/on-keypress-on-keyup/204028/1 "2006-10-16T16:25:43Z")

</div>

Hello all, this shouldnt be too hard… but i couldnt do it…

I have a movie clip call ‘bob’. When I press the ‘a’ key on the computer keyboard I want ‘bob’ to gotoAndStop at frame 5. Then when I release the ‘a’ key I want movie clip ‘bob’ to gotoAndStop at frame 1.

The problem is that unlike when using the pair on(press) on(release) for the mouse, on (keyPress “a”) doesn’t have a on (keyup) handler for the keyboard buttons as far as I can tell.

You help is very much appreciated.  
Cheers, R

on (keyPress “a”) {  
\_root.bob.gotoAndStop(5);  
}  
on (??? “a”) {  
\_root.bob.gotoAndStop(1);  
}
