3 Replies Latest reply on Dec 3, 2006 6:56 PM by James Newton, ACP

    making a sweeping second hand

    twheatlet
      Hi,

      I want to make a sweeping second hand (analog clock). To do so, I basically want to animate one end of a short line while the other end is locked in place. That way I can sweep the line around just like a second hand. This seems relatively straightforward (in my head) but I can't figure out how to do it. Any suggestions would be greatly appreciated. Thanks!!!

      Thalia
        • 1. Re: making a sweeping second hand
          Level 7
          The easy way is to animate each second across a frame span of 60 seconds
          using a vector shape...it's a lot cleaner than a bitmap and it animates more
          efficiently. This would minimize the Lingo needed although if you wanted to
          do it in one frame you would just change the angle of the vector once a
          second using a time like

          property pEndTime

          on beginSprite me
          pEndTime = the milliseconds + 1000
          end

          on exitFrame me
          if the milliseconds >= pEndTime then
          pEndTime = pEndTime + 1000
          --change the rotation property of the vector here by 6 degrees (360
          / 60)
          end if
          end


          --
          Craig Wollman
          Lingo Specialist
          Word of Mouth Productions
          212-928-9581

          www.wordofmouthpros.com
          "twheatlet" <webforumsuser@macromedia.com> wrote in message
          news:ekv3f9$h7i$1@forums.macromedia.com...
          > Hi,
          >
          > I want to make a sweeping second hand (analog clock). To do so, I
          > basically
          > want to animate one end of a short line while the other end is locked in
          > place.
          > That way I can sweep the line around just like a second hand. This seems
          > relatively straightforward (in my head) but I can't figure out how to do
          > it.
          > Any suggestions would be greatly appreciated. Thanks!!!
          >
          > Thalia
          >
          >


          • 2. Re: making a sweeping second hand
            twheatlet Level 1
            Thanks for your help!
            • 3. Re: making a sweeping second hand
              James Newton, ACP Level 3
              There's an Analog Clock behavior in the Controls panel of the Library Palette, which you can access via the menu item Window | Library Palette. You can drop this on a sprite to make it rotate once per minute (like a second hand), once per hour (like a minute hand), or once every twelve hours. It synchronizes with the internal clock on the user's machine.