Textfield issus.. HELP!

Hi folks…

I am new to AS, and intead of using flash tools enviroment, to make a input and a dymanic textfield, i want to make it in code.

It´s really simpel: I want to create a textfiel. With a input option. After one has entered theri name, the message " Hi" + name should appear on the same textfield.

I dont know how to approch this, so i created two textfields, with exactaly the same properties,( to make the other textfield appear on the same spot) where i made the one invisble if the other one is showing. But that is no good.

Anyway here is some code:

 
 
navn2._visible=false;
 
this.onEnterFrame= function(){
 if(Key.isDown(Key.LEFT)){
  navn2.text= " Hej" +  navn;
  navn2._visible=true;
  trace("LEFT");
  navn._visible= false;
 }
}
var navn:TextField = createTextField("profil_mc", this.getNextHighestDepth(), 20, 100, 120,20);
navn.border=true;
navn.type= "input";
navn.text= "Put name here:";
navn.onSetFocus= function(){
 this.text= "";
 this.password= false;
}
 

var navn2:TextField = createTextField("profil2_mc", this.getNextHighestDepth(), 20, 100, 120,20);
navn2.border=true;
navn2.type= "Dynamic";
navn2.text= "HI"

navn2.onSetFocus= function(){
 this.text= "";
 this.password= false;
}


Please help me!!! I cant understand or make any progress. Also, how can i make the enter key function to work, after one has entered the name, they should be able to hit the enter key to see next step…

Regards Hamid