# addEventListener to textbox

**URL:** https://forum.kirupa.com/t/addeventlistener-to-textbox/195252
**Category:** flash
**Created:** [July 30, 2006, 3:34am UTC](https://forum.kirupa.com/t/addeventlistener-to-textbox/195252 "2006-07-30T03:34:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kdd](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@kdd](https://forum.kirupa.com/u/kdd)
#### Post date: [July 30, 2006, 3:34am UTC](https://forum.kirupa.com/t/addeventlistener-to-textbox/195252/1 "2006-07-30T03:34:39Z")

</div>

**problem soloved**  
i’ve an input text with instance name: temp

and this is the code:

ActionScript Code:

[FONT=Courier New][LEFT][COLOR=#000000] **var** [/COLOR] tempListen = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]Object[/COLOR]COLOR=#000000[/COLOR];\</p\>

\<p\>tempListen.[COLOR=#000080]focusIn[/COLOR] = [COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR]\</p\>  
\<p\>[COLOR=#000000]{[/COLOR]\</p\>  
\<p\> [COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“i’ve been clicked”[/COLOR][COLOR=#000000])[/COLOR];\</p\>  
\<p\>[COLOR=#000000]}[/COLOR]\</p\>  
\<p\>temp.[COLOR=#000080]addEventListener[/COLOR]COLOR=#000000[/COLOR];[/LEFT]

[/FONT]

this doesn’t work…  
first of all, can we add an eventListener to a textbox? if yes, can you please tell me what’s wrong with this code? it is supposed to trace “i’ve been clicked” when i type something in the input textbox. thanks.
