【问题标题】:Do you know 1024 Overriding a function error on flex (flash )in action script 3?你知道 1024 Overriding a function error on flex (flash) in action script 3 吗?
【发布时间】:2009-05-08 06:22:10
【问题描述】:

在我的项目中,我使用了以下函数

    public function createIconMenu():NativeMenu{
        var iconMenu:NativeMenu = new NativeMenu();
iconMenu.addItem(new NativeMenuItem("", true));//Separator
        if(NativeApplication.supportsSystemTrayIcon){
            iconMenu.addItem(showCommand);
            showCommand.addEventListener(Event.SELECT, onShowCommand);      
            iconMenu.addItem(new NativeMenuItem("", true));//Separator      
            var exitCommand: NativeMenuItem = iconMenu.addItem(new NativeMenuItem("Exit"));
            exitCommand.addEventListener(Event.SELECT, exit);   
        }       


            return iconMenu;
    }

    public function exit(event:Event):void{
        NativeApplication.nativeApplication.exit();
    }

但在这个公共函数退出显示错误,如 1024: 覆盖未标记为覆盖的函数。

我做错了什么代码? .你能解释一下吗?

【问题讨论】:

    标签: javascript apache-flex flash actionscript-3 air


    【解决方案1】:

    exit 函数重命名为其他名称。这与系统提供的全局命名空间中的另一个函数发生冲突,用户无法覆盖。

    【讨论】:

    • 如果你重命名退出函数然后不工作 exitCommand.addEventListener(Event.SELECT, exit);如何退出 NativeApplication ..
    • 我明白了。非常感谢你。对我很有用
    【解决方案2】:

    Reset.addEventListener(MouseEvent.CLICK, play);

    函数播放(事件:鼠标事件):无效{ gotoAndPlay(1); }

    这个简单的代码我也遇到了同样的问题

    【讨论】:

      猜你喜欢
      • 2022-12-02
      • 1970-01-01
      • 1970-01-01
      • 2021-09-16
      • 1970-01-01
      • 1970-01-01
      • 2020-03-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多