做一个时钟,功能是拖动时针旋转时分针不动,拖动分针旋转时,时针要跟著转动,分针转一周360度后,时针就要转动30度了,
下面是部分代码
function minAndHouRotation() {
if (canRotation == true) {
this.onEnterFrame = function() {
angle = Math.atan2(_ymouse, _xmouse)*(180/Math.PI)+90;
//houAngle=?
//houAngle就是代表时针的度数,这个度数要怎麼计算呢?
sec._rotation = angle;
hou._rotation = houAngle;
};
} else {
delete this.onEnterFrame;
}
}
|