Hi all,
I’m creating a teaching material that teaches children learn to read the time. I currently have a clock with both hour and minute hands draggable independently, but WHAT IF I want the hour-hand to move (ie. rotate) according to the movement of the minute-hand, just like how we adjust the clock in reality by moving (ie. dragging in this case) the minute-hand?
Many Thanks!
The code that I have got so far as follows;
mcMinute.onPress = function() {
this.onMouseMove = function() {
var angle:Number = Math.atan2(
mcFace._ymouse - mcFace._height / 50,
mcFace._xmouse - mcFace._width / 50
);
this._rotation = (angle * 180 / Math.PI) +90;
};
};
mcMinute.onRelease = function() {
delete this.onMouseMove;
};
mcMinute.onReleaseOutside = mcMinute.onRelease;
mcHour.onPress = function() {
this.onMouseMove = function() {
var angle:Number = Math.atan2(
mcFace._ymouse - mcFace._height / 50,
mcFace._xmouse - mcFace._width / 50
);
this._rotation = (angle * 180 / Math.PI) +90;
};
};
mcHour.onRelease = function() {
delete this.onMouseMove;
};
mcHour.onReleaseOutside = mcHour.onRelease;