Немного исправил ваш код и добавил кое-что, надеюсь, это поможет вам:
public class CaptureUserInput extends Sprite
{
private var initialText:String = "Type your text here.";
public var myTextBox:TextField = new TextField();
public var myOutputBox:TextField = new TextField();
public function CaptureUserInput()
{
captureText();
}
public function captureText():void
{
createInputBox();
createOutputBox();
myTextBox.text = initialText;
//reset input field so user can write
myTextBox.addEventListener(FocusEvent.FOCUS_IN, focusInputIn);
//capture text
myTextBox.addEventListener(TextEvent.TEXT_INPUT, textInputCapture);
}
//this is almost your code, refactored in a function for clarity
public function createInputBox():void
{
myTextBox.type = TextFieldType.INPUT;
myTextBox.background = true;
myTextBox.y = 100;
addChild(myTextBox);
}
//just set the text of the output to the contents of the input
public function textInputCapture(event:TextEvent):void
{
myOutputBox.text = myTextBox.text;
}
public function createOutputBox():void
{
myOutputBox.y = 200;
addChild(myOutputBox);
}
public function focusInputIn(event:Event):void
{
if(myTextBox.text == initialText)
myTextBox.text ="";
}
}