public class test extends MovieClip
{
public function test()
{
var txt:TextField;
txt = new TextField();
txt.text = "Hello!";
txt.x = 20;
txt.y = 20;
txt.visible = true;
this.addChild(txt);
}
}
}
これで画面にHello!と出ました。
AS3.0からは、MovieClip/TextFiledなどを new MovieClip()とやって作成できるようになったし、親オブジェクトを自由に変更できるようになったので、今までより分かりやすくプログラムが作れそう。