# \[mx\]Basics- onkeyPress events

**URL:** https://forum.kirupa.com/t/mx-basics-onkeypress-events/43822
**Category:** flash
**Created:** [February 26, 2004, 6:05am UTC](https://forum.kirupa.com/t/mx-basics-onkeypress-events/43822 "2004-02-26T06:05:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ukiran](https://avatars.discourse-cdn.com/v4/letter/u/c2a13f/32.png) [@ukiran](https://forum.kirupa.com/u/ukiran)
#### Post date: [February 26, 2004, 6:05am UTC](https://forum.kirupa.com/t/mx-basics-onkeypress-events/43822/1 "2004-02-26T06:05:00Z")

</div>

Hi !!

I was just trying out this code

```auto

on(keyPress "<Enter>")
{
	
	message.text="You pressed a Key";
}

```

This is the action on a button named b1. “message” is a dynamic text field.

This code does not work for certain keys (backspace,esc,delete and enter keys…)for all others it works…What could the reason be?

Also…onClipEvent on a movieclip m1 (for any parameter)also does not work…

The movieclip,textfield and button are on frame 1 on different layers…I’m trying to learn the basics and I’ll be happy if anyone can help me on this…Thanks!
