Cairngorm Event


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /** *******************************************************************
  2. * MySnippets
  3. * Free for use
  4. *
  5. * @author Jonnie Spratley
  6. * @contact [email protected]
  7. ******************************************************************* */
  8. package
  9. {
  10. /**
  11. * Cairngorm provides a singleton Cairngorm Event Dispatcher that works with the Front Controller class.
  12. * Whenever you want to dispatch Cairngorm events, you use the Cairngorm Event Dispatcher.
  13. *
  14. * The following code shows how to broadcast a Cairngorm event using
  15. * the Cairngorm Event Dispatcher:
  16. *
  17. * <code>
  18. * var evt:YourEvent = new YourEvent( YourEvent.NAME_OF_EVENT );
  19. * evt.dispatchEvent();
  20. *</code>
  21. *
  22. * The dispatchEvent() method of the Cairngorm Event Dispatcher singleton takes a parameter of
  23. * type flash.events.Event. This event is dispatched and the corresponding command is executed.
  24. *
  25. * This is how the Front Controller, Cairngorm Event Dispatcher, Command patterns, and
  26. * Cairngorm Events work together with the Cairngorm Event, the Model Locator, and VO
  27. * patterns to create an immersive experience for the user of an RIA.
  28. *
  29. */
  30. import com.adobe.cairngorm.control.CairngormEvent;
  31. import flash.events.Event;
  32.  
  33. public final class GetEvent extends CairngormEvent
  34. {
  35. public static const GET_EVENT:String = "GET_EVENT";
  36.  
  37. public function GetEvent()
  38. {
  39. super( GET_EVENT );
  40. }
  41.  
  42. override public function clone():Event
  43. {
  44. return new GetEvent();
  45. }
  46. }
  47. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.