{
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFormat;
/**
* ...
* @author huyuguo
*/
public class TextInputExample extends Sprite
{
private var _tt:TT;
private var _textField:TextField;
private var _textFormat:TextFormat;
public function TextInputExample():void
{
_tt = new TT();
_tt.x = 200;
_tt.y = 200;
_tt.addFrameScript(5, test);
_textFormat = new TextFormat();
_textFormat.font = "黑體";
_textFormat.color = 0x8B0000;
_textFormat.bold = true;
_textFormat.size = 48;
_textFormat.align = "center";
_textField = new TextField();
_textField.text = "Chinese";
_textField.setTextFormat(_textFormat);
_textField.defaultTextFormat = _textFormat;
_textField.name = "textFieldTest";
_tt.addChild(_textField);
trace(TextField(_tt.getChildByName("textFieldTest")).text);
addChild(_tt);
}
private function test():void
{
trace("In test function");
_tt.stop();
}
}
}