# eventListener on a text box issue

**URL:** <https://forum.kirupa.com/t/eventlistener-on-a-text-box-issue/296498>\
**Category:** flash\
**Created:** [September 15, 2009, 5:39pm UTC](https://forum.kirupa.com/t/eventlistener-on-a-text-box-issue/296498 "2009-09-15T17:39:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cry4dawn](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@cry4dawn](https://forum.kirupa.com/u/cry4dawn)\
**Post date:** [September 15, 2009, 5:39pm UTC](https://forum.kirupa.com/t/eventlistener-on-a-text-box-issue/296498/1 "2009-09-15T17:39:35Z")

</div>

I am trying to set up a listener when the user changes the text in a text box.

I’ve tried:

```auto

myTextField.addEventListener(TextEvent.TEXT_INPUT, textChange);

public function textChange(event:TextEvent):void 
{
 trace("text changed");
}

```

as well as:

```auto

myTextField.addEventListener(Event.CHANGE, textChange);

public function textChange(event:Event):void 
{
 trace("text changed");
}

```

When I attempt to compile either way I get:  
‘1046: Type was not found or was not a compile-time constant: TextEvent.’

I’ve got import fl.events.\*; so what else am I missing to make this work? Any help would be appreciated.
