# Button + spacebar

**URL:** <https://forum.kirupa.com/t/button-spacebar/41742>\
**Category:** Uncategorized\
**Created:** [February 1, 2004, 2:02pm UTC](https://forum.kirupa.com/t/button-spacebar/41742 "2004-02-01T14:02:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![frenzy](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@frenzy](https://forum.kirupa.com/u/frenzy)\
**Post date:** [February 1, 2004, 2:02pm UTC](https://forum.kirupa.com/t/button-spacebar/41742/1 "2004-02-01T14:02:17Z")

</div>

I need help. I got a character to move. I want the player to be able to move the character to a button then press spacebar on it. Which will take them to another frame.

This is the code I got for the button but the trouble is u can press spacebar anywhere to go to the next frame.

on (keyPress “\<Space\>”) {  
\_root.gotoAndPlay(23);  
}
