0

我创建了这个事件类:

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。

4

1 回答 1

1

另一个类应该扩展EventDispatcher类。

请参阅:http ://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/EventDispatcher.html

于 2014-07-11T13:28:35.853 回答