0

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.

Razdom
  • 13
  • 2
  • Doe the class that does the dispatch also have an `import flash.events.Event;`? Or just try it like `import flash.events.*;` – VC.One Jul 11 '14 at 19:53

1 Answers1

1

The other class should extend EventDispatcher class.

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

Petr Hrehorovsky
  • 1,153
  • 2
  • 14
  • 16