import flash.text.TextField;
import flash.events.Event;
//以下脚本创建三个文本,其中两个为输入文本,一个为动态文本,实现的是一个加运算
var a:TextField=new TextField();
a.type = TextFieldType.INPUT;
a.x = 100,a.y = 200;
a.width = 40,a.height = 20;
a.border = true;
var b:TextField=new TextField();
b.height = 20,b.width = 40;
b.border = true;
b.type = TextFieldType.INPUT;
b.x = 180,b.y = 200;
var c:TextField=new TextField();
c.width = 40,c.height = 20;
c.border = true;
c.x = 280,c.y = 200;
addChild(a);
addChild(b);
addChild(c);
var voale:Number;
b.addEventListener(Event.CHANGE,onInputText);
function onInputText(evt:Event):void
{
c.text = "";
voale = Number(a.text) + Number(b.text);
c.text = String(voale);
}