addFrameScript 函數使用

package 
{
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();
}


}

}
發佈了26 篇原創文章 · 獲贊 3 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章