8 Replies Latest reply on Oct 29, 2009 7:32 AM by Ned Murphy

    rotation help

    ana.valente

      hi there,

       

      i'm trying to create an analog clock... my code gives me no errors, but my pointers don't rotate. here's my code:

       

      function updateClock (evt:Event):void {
           var time:Date = new Date();
           var mil = time.getMilliseconds();
           var s = time.getSeconds();
           var m = time.getMinutes();
           var h = time.getHours();
          
           s.DisplayObject.rotation = s*6+(mil/(1000/6));
           m.DisplayObject.rotation = m*6+(s/10);
           h.DisplayObject.rotation = h*30+(m/2);
          
      stage.addEventListener(Event.ENTER_FRAME, updateClock);
      }

       

      am i missing something??

       

      thanks