Guest User

Untitled

a guest
Jun 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. package alecmce.anim
  2. {
  3. import org.osflash.signals.ISignal;
  4.  
  5. /**
  6. * Describes an Animation in general terms.
  7. */
  8. public interface Anim
  9. {
  10.  
  11. /**
  12. * attempt to play the animation (equivalent to setting speed = 1)
  13. *
  14. * @return Whether play is successful. It will fail if the Anim is already atEnd
  15. */
  16. function play():Boolean;
  17.  
  18. /**
  19. * stop playing the animation
  20. */
  21. function stop():void;
  22.  
  23. /**
  24. * attempt to play the animation in reverse (equivalent to speed = -1)
  25. *
  26. * @return Whether reverse is successful. It will fail if the Anim is already atStart
  27. */
  28. function reverse():Boolean;
  29.  
  30. /**
  31. * @return the current speed of the animation
  32. */
  33. function get speed():Number;
  34.  
  35. /**
  36. * set the speed of the animation. Speed is understood to be the change
  37. * of proportion per frame
  38. *
  39. * @param value A value between -1 and 1
  40. */
  41. function set speed(value:Number):void;
  42.  
  43. /*
  44. * @return the position of the animation between start and end as a proportion
  45. */
  46. function get proportion():Number;
  47.  
  48. /**
  49. * set the position of the animation between start and end as a proportion
  50. *
  51. * @param value A value between 0 and 1
  52. */
  53. function set proportion(value:Number):void;
  54.  
  55. /**
  56. * @return A signal which dispatches the Anim instance when the animation reaches
  57. * the end of the animation (when proportion == 1)
  58. */
  59. function get atEnd():ISignal;
  60.  
  61. /**
  62. * @return A signal which dispatches the Anim instance when the animation reaches
  63. * the start of the animation (when proportion == 0)
  64. */
  65. function get atStart():ISignal;
  66.  
  67. }
  68. }
Add Comment
Please, Sign In to add comment