/src/away3d/events/AnimatorEvent.as

http://github.com/away3d/away3d-core-fp11 · ActionScript · 56 lines · 25 code · 8 blank · 23 comment · 0 complexity · 23c3d9f943862c0992abc6c331afa37e MD5 · raw file

  1. package away3d.events
  2. {
  3. import away3d.animators.*;
  4. import flash.events.*;
  5. /**
  6. * Dispatched to notify changes in an animator's state.
  7. */
  8. public class AnimatorEvent extends Event
  9. {
  10. /**
  11. * Defines the value of the type property of a start event object.
  12. */
  13. public static const START:String = "start";
  14. /**
  15. * Defines the value of the type property of a stop event object.
  16. */
  17. public static const STOP:String = "stop";
  18. /**
  19. * Defines the value of the type property of a cycle complete event object.
  20. */
  21. public static const CYCLE_COMPLETE:String = "cycle_complete";
  22. private var _animator:AnimatorBase;
  23. /**
  24. * Create a new <code>AnimatorEvent</code> object.
  25. *
  26. * @param type The event type.
  27. * @param animator The animator object that is the subject of this event.
  28. */
  29. public function AnimatorEvent(type:String, animator:AnimatorBase):void
  30. {
  31. super(type, false, false);
  32. _animator = animator;
  33. }
  34. public function get animator():AnimatorBase
  35. {
  36. return _animator;
  37. }
  38. /**
  39. * Clones the event.
  40. *
  41. * @return An exact duplicate of the current event object.
  42. */
  43. override public function clone():Event
  44. {
  45. return new AnimatorEvent(type, _animator);
  46. }
  47. }
  48. }