# {Flash 5} Controlling buttons by pressing keys?

**URL:** <https://forum.kirupa.com/t/flash-5-controlling-buttons-by-pressing-keys/9398>\
**Category:** flash\
**Created:** [December 11, 2002, 1:18am UTC](https://forum.kirupa.com/t/flash-5-controlling-buttons-by-pressing-keys/9398 "2002-12-11T01:18:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToddziLLa](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@ToddziLLa](https://forum.kirupa.com/u/ToddziLLa)\
**Post date:** [December 11, 2002, 1:18am UTC](https://forum.kirupa.com/t/flash-5-controlling-buttons-by-pressing-keys/9398/1 "2002-12-11T01:18:46Z")

</div>

(Flash 5)

I have 12 different buttons that are keyboard keys that play a sound when you click on them. I am wondering if, in addition to that, one could hit, for instance, the ` key for this first one, the 1 key for the second one, the 2 key for the third one, etc…etc…

Is there a script for that, in addition to the click?

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 11, 2002, 1:13pm UTC](https://forum.kirupa.com/t/flash-5-controlling-buttons-by-pressing-keys/9398/2 "2002-12-11T13:13:14Z")

</div>

Hi,

you can use this in a button:

```auto

on (release, keyPress"1") {
     doSomething();
}

```

or you can use this in a (controller) movieClip:

```auto

onClipEvent(keyDown){
   if(key.getCode == 49){ //49 is the key code for number 1
      doSomething();
   }
}

```

Find the the key codes in the Flash help.

Cheers

SHO
