请帮助我
I am trying to show input text to another text field on run time. I want to show the
myOutputBox
with in a movie clip. The code is below:
行动3
package
页: 1
import flash.display.Sprite;
import flash.display.Stage;
import flash.text.*;
import flash.events.*;
public class CaptureUserInput extends Sprite
页: 1
private var myTextBox:TextField = new TextField();
private var myOutputBox:TextField = new TextField();
private var myText:String = "Type your text here.";
public function CaptureUserInput()
页: 1
captureText();
iii
public function captureText():void
页: 1
myTextBox.type = TextFieldType.INPUT;
myTextBox.background = true;
addChild(myTextBox);
myTextBox.text = myText;
myTextBox.addEventListener(TextEvent.TEXT_INPUT, textInputCapture);
iii
public function textInputCapture(event:TextEvent):void
页: 1
var str:String = myTextBox.text;
createOutputBox(str);
iii
public function createOutputBox(str:String):void
页: 1
myOutputBox.background = true;
myOutputBox.x = 200;
addChild(myOutputBox);
myOutputBox.text = str;
iii
iii
iii