[英]AS3 dispatchEvent not working on class
i created this event class: 我创建了这个事件类:
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);
}
}
}
and on other class (Not main) im writed: 而在其他类(不是主要的)上我写道:
dispatchEvent(new clientEvent(clientEvent.connectionSucceeded, new Object()));
Im import the class and its return this error: 1180: Call to a possibly undefined method dispatchEvent. 我导入该类并返回此错误:1180:调用可能未定义的方法dispatchEvent。
The other class should extend EventDispatcher
class. 另一个类应该扩展
EventDispatcher
类。
See: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/EventDispatcher.html 请参阅: http : //help.adobe.com/zh_CN/FlashPlatform/reference/actionscript/3/flash/events/EventDispatcher.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.