我创建了这个事件类:
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。
答案 0 :(得分:1)
另一个类应该扩展EventDispatcher
类。
请参阅:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/EventDispatcher.html