Posted By

jeffnehlsen on 02/08/11


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

merritt212


AS3 Revised Custom Event Class


 / Published in: ActionScript 3
 

  1. package
  2. {
  3. import flash.events.Event;
  4.  
  5. /**
  6. * ...
  7. * @author Jeff Nehlsen
  8. */
  9. public class CustomEvent extends Event
  10. {
  11. // Event types.
  12. public static const EVENT_DEFAULT:String = "event1";
  13. public static const EVENT_CUSTOM:String = "event2";
  14.  
  15. public function CustomEvent(type:String = CustomEvent.EVENT_DEFAULT, bubbles:Boolean = false, cancelable:Boolean = false)
  16. {
  17. super(type, bubbles, cancelable);
  18. }
  19.  
  20. override public function clone():Event {
  21. // Return a new instance of this event with the same parameters.
  22. return new CustomEvent(type, bubbles, cancelable);
  23. }
  24. }
  25. }

Report this snippet  

You need to login to post a comment.