试一下
徐宝吧
全部回复
仅看楼主
level 6
十二纹章 楼主
。。。
2008年09月18日 03点09分 1
level 6
十二纹章 楼主
u nction
2008年09月25日 11点09分 2
level 6
十二纹章 楼主
`
2008年09月25日 11点09分 3
level 6
十二纹章 楼主
f
2008年09月25日 11点09分 4
level 6
十二纹章 楼主
fction
2008年09月25日 11点09分 5
level 6
十二纹章 楼主
//Animal类的方法Test.Animal.prototype = { get_Name: fun() { return this._name; }, set_Name: fun() { return this._name; }, eat: fun() { Sys.Debug.trace("Animal eats."); }}//注册Test.Animal类Test.Animal.registerClass("Test.Animal");//声明子类FishTest.Fish = fun(name) { //初始化父类 Test.Fish.initializeBase(this, [name]);}Test.Fish.prototype = { eat: fun() { Sys.Debug.trace("Fish eat"); }}//注册Test.Fish类Test.Fish.registerClass("Test.Fish", Test.Animal);//声明接口InterfaceTest.IRunnable = fun() { }Test.IRunnable.prototype = { run: fun() { }}Test.IRunnable.registerInterface("Test.IRunnable");//Dog类实现了Test.IRunnable接口Test.Dog = fun(name) { Test.Dog.initializeBase(this, [name]);}Test.Dog.prototype = { eat: fun() { Sys.Debug.trace("Dog eats."); }, run: fun() { Sys.Debug.trace("Dog running."); }}Test.Dog.registerClass("Test.Dog", Test.Animal, Test.IRunnable);//声明一个枚举Test.Position = fun() { };Test.Position.prototype = { Center:0, Top: 1, Bottom: 2, Left: 3, Right:4}Test.Position.registerEnum("Test.Position");
2008年09月25日 11点09分 6
level 6
十二纹章 楼主
//声明命名空间Type.registerNamespace("Test");//Animal类的字段Test.Animal = fun(name) {  this._name = name;}//Animal类的方法Test.Animal.prototype = {  get_Name: fun() {    return this._name;  },  set_Name: fun() {    return this._name;  },  eat: fun() {    Sys.Debug.trace("Animal eats.");  }}//注册Test.Animal类Test.Animal.registerClass("Test.Animal");//声明子类FishTest.Fish = fun(name) {  //初始化父类  Test.Fish.initializeBase(this, [name]);}Test.Fish.prototype = {  eat: fun() {    Sys.Debug.trace("Fish eat");  }}//注册Test.Fish类Test.Fish.registerClass("Test.Fish", Test.Animal);//声明接口InterfaceTest.IRunnable = fun() { }Test.IRunnable.prototype = {  run: fun() { }}Test.IRunnable.registerInterface("Test.IRunnable");//Dog类实现了Test.IRunnable接口Test.Dog = fun(name) {  Test.Dog.initializeBase(this, [name]);}Test.Dog.prototype = {  eat: fun() {    Sys.Debug.trace("Dog eats.");  },  run: fun() {    Sys.Debug.trace("Dog running.");  }}Test.Dog.registerClass("Test.Dog", Test.Animal, Test.IRunnable);//声明一个枚举Test.Position = fun() { };Test.Position.prototype = {  Center:0,  Top: 1,  Bottom: 2,  Left: 3,  Right:4}Test.Position.registerEnum("Test.Position");
2008年09月25日 11点09分 7
1