# TextField in Actionscript HELP

**URL:** <https://forum.kirupa.com/t/textfield-in-actionscript-help/251963>\
**Category:** flash\
**Created:** [February 14, 2008, 12:35pm UTC](https://forum.kirupa.com/t/textfield-in-actionscript-help/251963 "2008-02-14T12:35:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hrbi](https://avatars.discourse-cdn.com/v4/letter/h/f475e1/32.png) [@hrbi](https://forum.kirupa.com/u/hrbi)\
**Post date:** [February 14, 2008, 12:35pm UTC](https://forum.kirupa.com/t/textfield-in-actionscript-help/251963/1 "2008-02-14T12:35:39Z")

</div>

Hi guys…

So i want a simpel textfield where a user write their name and hit the enter key. After hit of the enterkey, the textfield removes and another one is set, with the word Hi + the name.

Please help me figure this out.

My code:

```auto
 
var textBox:TextField= createTextField("yourname", this.getNextHighestDepth(), 200,200,150,20);
 
var messAge:TextField= createTextField("message", this.getNextHighestDepth(), 200,200,150,20);
textBox.border=true;
textBox.type= "input";
textBox.text="PUT YOUR NAME HERE"
 
textBox.onSetFocus=function(){
 this.text= "";
}
 
if(textBox.text==(Key.isDown(Key.SPACE)){
 
}

```

I know my if sentece is not in a function, and it will be outputtet incorrect in the output panel. But it´s just to give a feeling on what i was triyng to do. please help…

Regards Hamid
