Skip to main content
Participant
October 30, 2008
Question

Rotating Dial

  • October 30, 2008
  • 1 reply
  • 294 views
Hey guys,

I am a Senior VCD major at University of Hartford and a project we have is on interfaces and making them functional. We have designed the interface but as for flash....Im quite an amateur but Im familiar with all scripting besides this. I have a dial on the stage, I want to write a script so you can click and drag the dial around and when I off click it, it will stay where it is. Does anyone know where I could find script for this or help me out in writing it?
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
October 30, 2008
use a central reg pt for your dial. create a mousedown listener for your dial that creates a mousemove listener. in the mousemove listener update the dials rotation property (using the Math.atan2() function and the difference between the mouse position and dial) if the mouse is over the dial. create a mouseup listener that removes the mousemove listener.