//************************************************************ // HelloWorld - TextField() // とりあえず文字を書き出してみる。 // package { import flash.display.*; import flash.text.*; public class Main extends Sprite { //------------------------------------------------------------ // Mainコンストラクタ // public function Main() { //h1 TextFormat() を定義 var tf_h1:TextFormat = new TextFormat(); tf_h1.color = 0x666666; tf_h1.size = 30; tf_h1.font = 'Times New Roman'; tf_h1.align = TextFieldAutoSize.CENTER; //titleを定義 var title:TextField = new TextField(); title.text = 'HelloWorld!! - TextField()'; title.width = stage.stageWidth; title.height = 40; title.x = 0; title.y = (stage.stageHeight/2); title.setTextFormat( tf_h1 ); title.background = true; title.backgroundColor = 0xEEEEEE; //stageに要素を追加 stage.addChild( title ); } } } hellloWorld - TextField()