as 动态(dynamic)类:
//动态类的实例可以动态地添加成员
//---------------------------------
package {
public dynamic class CTest {
public const Name = "CTest";
}
}
//---------------------------------
var obj:CTest = new CTest();
trace(obj.Name); //CTest
obj.A = 123;
trace(obj.A); //123
obj.B = function () { trace("CTest B"); };
obj.B(); //CTest B
function myFunc() { trace("myFunc"); }
obj.C = myFunc;
obj.C(); //myFunc