Guest User

Untitled

a guest
Aug 22nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. package ca.autotrader.mediators
  2. {
  3. import flash.events.Event;
  4. import flash.events.EventDispatcher;
  5. /**
  6. * @author Jay Moretti
  7. *
  8. * Copyright - Jay Moretti - 2010
  9. *
  10. * ca.autotrader.mediators
  11. */
  12. public class EventMediator
  13. {
  14. private static var dispatcher : EventDispatcher = new EventDispatcher();
  15.  
  16. public static function addEventListener(p_type : String, p_listener : Function, p_useCapture : Boolean = false, p_priority : int = 0, p_useWeakReference : Boolean = false) : void {
  17. dispatcher.addEventListener(p_type, p_listener, p_useCapture, p_priority, p_useWeakReference);
  18. }
  19.  
  20. public static function removeEventListener(p_type : String, p_listener : Function, p_useCapture : Boolean = false, p_priority : int = 0, p_useWeakReference : Boolean = false) : void {
  21. dispatcher.removeEventListener(p_type, p_listener);
  22. }
  23.  
  24. public static function dispatchEvent(p_event : Event) : void {
  25. dispatcher.dispatchEvent(p_event);
  26. }
  27. }
  28. }
Add Comment
Please, Sign In to add comment