【问题标题】:AS3 - how to extend this functionAS3 - 如何扩展此功能
【发布时间】:2015-08-13 09:44:25
【问题描述】:

这是具有“gordz()”函数的第一类

public class Model extends Object implements IModel
   {

     public static function gordz() : void
      {
          newobject = gallas.pop();
      }

}

现在我尝试重写该函数,但我仍然希望执行旧代码...如何正确扩展此函数?

 public class LOL extends Model
   {
       override public static function gordz() : void
       {
         ... //New code + execute old code
       }  

   }

【问题讨论】:

  • 为什么这个方法是静态的? newobject 是什么? gallas 是什么?

标签: function actionscript-3 extend


【解决方案1】:

都不是超级

You cannot use the super statement in a static method.

也不覆盖

You cannot use the override attribute on any of the following:

[...]

静态方法

可以在静态方法中使用。

无论您尝试做什么,都应该以不同的方式完成。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-12
    • 1970-01-01
    • 1970-01-01
    • 2018-09-27
    • 2021-08-23
    • 2020-02-05
    • 2019-06-23
    • 2020-07-02
    相关资源
    最近更新 更多