Hi, wonder if anyone is able to help with this one.
I am using the following code (found at http://www.foundation-flash.com/tutorials/as3rotation/ - so thanks go to them for that) to rotate a movie clip according to the position of the mouse:
stage.addEventListener(Event.ENTER_FRAME ,rotate);
function rotate(e:Event) {
var dX:int = mouseX - theArrow.x;
var dY:int = (mouseY - theArrow.y) * -1;
var rad:Number = Math.atan2(dY,dX);
var angle:Number = rad*(180/Math.PI);
theArrow.rotation = angle*-1;
}
What I would like to be able to do is measure one complete (360 degree) revolution of the arrow (clockwise, in this case); and from there, count and/or time the revolutions.
But the first step is to detect one complete revolution. Could anyone give some hints as to how that could be achieved?