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 に答える