# How do I make a button's overstate trigger from keyboard detection?

**URL:** https://forum.kirupa.com/t/how-do-i-make-a-buttons-overstate-trigger-from-keyboard-detection/281911
**Category:** flash
**Created:** [February 15, 2009, 3:13am UTC](https://forum.kirupa.com/t/how-do-i-make-a-buttons-overstate-trigger-from-keyboard-detection/281911 "2009-02-15T03:13:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sdendenden](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@sdendenden](https://forum.kirupa.com/u/sdendenden)
#### Post date: [February 15, 2009, 3:13am UTC](https://forum.kirupa.com/t/how-do-i-make-a-buttons-overstate-trigger-from-keyboard-detection/281911/1 "2009-02-15T03:13:45Z")

</div>

```auto
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKeys)

function checkKeys(event:KeyboardEvent):void {
	if(event.keyCode == 48) {
		zero_mc.gotoAndPlay(2);
	}

}

zero_btn.addEventListener(MouseEvent.CLICK, launchZero);
function launchZero(event:MouseEvent):void {
	zero_mc.gotoAndPlay(2);
}

```

When I press the ‘0’ key it makes the movie play. When I click the actual button it also makes the movie play. But how do I make it so that when I type ‘0’ the overstate of the button becomes activated? In this way keyboard detection and mouse\_down would work together.

Thanks for any help.
