【问题标题】:AS3 dispatchEvent not working on classAS3 dispatchEvent 在课堂上不起作用
【发布时间】:2014-07-11 13:23:35
【问题描述】:

我创建了这个事件类:

package com.site {
    import flash.events.Event;

    public class clientEvent extends Event {
        public static const connectionSucceeded: String = "connectionSucceeded";

        public var prams: Object;

        public function clientEvent(type: String, prams: Object) {
            super(type);
            this.prams = prams;
        }
        override public function clone(): Event {
            return new clientEvent(type, prams);
        }
    }
}

在我写的其他类(非主类)上:

dispatchEvent(new clientEvent(clientEvent.connectionSucceeded, new Object()));

我导入该类并返回此错误: 1180: 调用一个可能未定义的方法 dispatchEvent。

【问题讨论】:

  • 进行调度的类是否也有import flash.events.Event;?或者试试import flash.events.*;

标签: actionscript-3 events dispatchevent


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2013-08-03
    • 2016-11-15
    • 2016-03-23
    • 2012-08-08
    • 1970-01-01
    • 2015-01-12
    • 1970-01-01
    • 1970-01-01
    • 2014-07-09
    相关资源
    最近更新 更多