Posted By

shalomfriss on 09/16/10


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

PixelJuice
bobbym245


Analog Clock


 / Published in: ActionScript 3
 

  1. this.addEventListener("enterFrame",clockHandler);
  2. function clockHandler(e:Event) {
  3.  
  4. // set hour
  5. var time = new Date();
  6. var hourHand = time.getHours();
  7. var minuteHand = time.getMinutes();
  8. var secondHand = time.getSeconds();
  9. // rotatia acelor
  10. hourHand_.rotation = 30 * hourHand + minuteHand / 2;
  11. minuteHand_.rotation = 6 * minuteHand;
  12. secondHand_.rotation = 6 * secondHand;
  13. }

Report this snippet  

You need to login to post a comment.