Posted By

adehaas on 03/15/13


Tagged


Versions (?)

HNK_Animation_Hover


 / Published in: Other
 

  1. package nl.hnk.animations
  2. {
  3. import com.greensock.TweenLite;
  4. import com.greensock.easing.Sine;
  5.  
  6. import flash.display.Sprite;
  7.  
  8. /**
  9. * @author alexanderdehaas
  10. */
  11. public class ContentHover extends Sprite
  12. {
  13. public function ContentHover()
  14. {
  15. with(graphics)
  16. {
  17. beginFill(0x666666);
  18. drawRect(0, 0, 300, 120);
  19. endFill();
  20. }
  21.  
  22. x = y = 125;
  23. }
  24.  
  25. public function startHover():void
  26. {
  27. TweenLite.to(this, 3, {delay: 0.5, y: 140, ease:Sine.easeInOut, onComplete: hoverUp});
  28. }
  29.  
  30.  
  31. private function hoverUp():void
  32. {
  33. TweenLite.to(this, 3, {delay: 0.5, y: 110, ease:Sine.easeInOut, onComplete: startHover});
  34. }
  35. }
  36. }

Report this snippet  

You need to login to post a comment.