
Код AS1/AS2:
var b:Examp = new Examp();
b.setNames("good bye");
this.addChild(b);

Код AS3:
package
{
import flash.text.*;
import flash.display.*;
public class Examp extends Sprite
{
public function Examp()
{
super();
var f:TextFormat = new TextFormat();
f.font = "Tahoma";
a = new TextField();
a.type = "dynamic";
a.text = "Привет";
a.textColor = 0xff0000;
a.border = true;
a.background = true;
a.backgroundColor = 0x00ff00;
a.setTextFormat(f);
a.defaultTextFormat = f;
a.autoSize = TextFieldAutoSize.LEFT;
addChild(a);
setNames("Hellow");
}
private var a:TextField;
public function setNames(nameText:String):void
{
a.text = nameText;
}
}
}
Не заметно.