简体   繁体   English

AS3 dispatchEvent在类上不起作用

[英]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。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM