/src/org/osflash/signals/natives/INativeDispatcher.as

http://github.com/robertpenner/as3-signals · ActionScript · 40 lines · 14 code · 6 blank · 20 comment · 0 complexity · a680dfca1e29f67757928d04b0d54add MD5 · raw file

  1. package org.osflash.signals.natives
  2. {
  3. import org.osflash.signals.IPrioritySignal;
  4. import flash.events.Event;
  5. import flash.events.IEventDispatcher;
  6. /**
  7. * Similar to IDispatcher but using strong types specific to Flash's native event system.
  8. */
  9. public interface INativeDispatcher extends IPrioritySignal
  10. {
  11. /**
  12. * The type of event permitted to be dispatched. Corresponds to flash.events.Event.type.
  13. */
  14. function get eventType():String;
  15. /**
  16. * The class of event permitted to be dispatched. Will be flash.events.Event or a subclass.
  17. */
  18. function get eventClass():Class;
  19. /**
  20. * The object considered the source of the dispatched events.
  21. */
  22. function get target():IEventDispatcher;
  23. function set target(value:IEventDispatcher):void;
  24. /**
  25. * Dispatches an event to listeners.
  26. * @param event An instance of a class that is or extends flash.events.Event.
  27. * @throws ArgumentError <code>ArgumentError</code>: Event object is <code>null</code>.
  28. * @throws ArgumentError <code>ArgumentError</code>: Event object [event] is not an instance of [eventClass].
  29. * @throws ArgumentError <code>ArgumentError</code>: Event object has incorrect type. Expected [eventType] but was [event.type].
  30. * @throws ArgumentError <code>ArgumentError</code>: Target object cannot be <code>null</code>.
  31. */
  32. function dispatchEvent(event:Event):Boolean;
  33. }
  34. }