小菜AS3之路

2012.2.17
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年3月1日

摘要: /**call的参数是一个对象的实例call的参数是一个函数,即一个对象创建一个基类对象作为子类原型的原型共享基类prototype的方法为函数动态地增加属性、方法为函数prototype的属性添加方法*/this.name="window";functionClass1(){this.name="class1";//设置对象名----若Call调用后在给实例化对象赋值!!this.showTxt=function(){alert(this.name)}}Class1.prototype.say=function(){alert(this.name);} 阅读全文

posted @ 2012-03-01 13:53 枫雨 阅读(1681) 评论(0) 推荐(0)

摘要: 1.Call对象冒充 继承基类的构造函数的属性,方法2.创建一个基类对象作为子类原型的原型 共享基类prototype的方法functionPolygon(size){this.size=size;}Polygon.prototype.getArea=function(){return0;}/**矩形*/functionRectangle(width,height){Polygon.call(this,4);this.width=width;this.height=height;if(typeof(Rectangle._initialize=="undefined")){R 阅读全文

posted @ 2012-03-01 13:51 枫雨 阅读(159) 评论(0) 推荐(0)