Posted By

arpo on 01/27/09


Tagged


Versions (?)

Who likes this?

9 people have marked this snippet as a favorite

psychoinca
enajenkins
vkord
iamgowan
abbey
TrentSkunk
zoo
burnandbass
albertomori


Hide something if the mouse hasn't moved.


 / Published in: ActionScript 3
 

  1. import flash.utils.Timer;
  2.  
  3. this.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
  4.  
  5. var myTimer:Timer = new Timer(1000,1);
  6. myTimer.addEventListener("timer", function() {
  7. //Do what ever you want. Like tween away a movie control using tweenmax.
  8. TweenMax.to(control, 1, { alpha:0, ease:Linear.easeNone } );
  9. });
  10. myTimer.start();
  11.  
  12.  
  13.  
  14. private function onMouseMove(e:Event):void
  15. {
  16. control.alpha = 1;
  17. myTimer.reset();
  18. myTimer.start();
  19. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: abbey on February 20, 2010

add a semicolon, after myTimer.start();

Posted By: arpo on February 10, 2011

Done ;)

You need to login to post a comment.