AS3 dispatchEvent不在类上工作

时间:2014-07-11 13:23:36

标签: actionscript-3 events dispatchevent

我创建了这个事件类:

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。

1 个答案:

答案 0 :(得分:1)