TextFields are created in AS3 basically like most other objects, by first defining and then instantiating them:

Actionscript:
  1. </code>
  2.  
  3. package {
  4. import flash.display.Sprite;
  5. import flash.text.*;
  6. public class whynot extends Sprite{
  7. private var display_txt:TextField;
  8.  
  9. public function whynot(){
  10. display_txt = new TextField();
  11. display_txt.text = "a text";
  12. addChild(display_txt);
  13. }
  14. }
  15. }

Here the code of a function I use for creating my textfields. still basic, but displays the most common settings needed for your dynamic textField. assumingyou have a font added in the library with the class instance name "_tahoma":

Actionscript:
  1. private function makeTextField():void {
  2.  
  3. var tahoma:Font = new _tahoma();
  4.  
  5. TFFormat = new TextFormat();
  6.  
  7. TFFormat.font =tahoma.fontName;
  8. TFFormat.color = "0xFFFFFF";
  9. TFFormat.size = 11;
  10.  
  11. TextField = new TextField();
  12. TextField.width = 200;
  13. TextField.height = height;
  14. TextField.x = 42;
  15. TextField.y = 10;
  16. TextField.wordWrap = true;
  17. TextField.selectable = false;
  18. TextField.border = true;
  19. TextField.multiline = false;
  20. TextField.embedFonts = true;
  21. TextField.autoSize = TextFieldAutoSize.LEFT;
  22. TextField.antiAliasType = AntiAliasType.ADVANCED;
  23.  
  24. addChild(alertTextField);
  25.  
  26. alertTextField.setTextFormat(alertTFFormat);
  27.  
  28. };

One issue I discovered that I can't really explain, is that I often have to reassign the textFormat to the TextField when changing the fields content:

Actionscript:
  1. alertTextField.text = myString;
  2. alertTextField.setTextFormat(alertTFFormat);

setting the focus on an input field:

http://livedocs.adobe.com/flex/201/langref/flash/display/Stage.html#focus

in AS3, it's now a property rather than a function that you call. Also, you don't use the text name value of the field, but a reference to the actual field itself...

would look something like:

Actionscript:
  1. myObj.stage.focus = myTextField;