问:如何制作一个像时钟样旋转的动画,而且这个时钟的指针可以用鼠标移动到指定的刻度上?
终极讨厌:给楼主示范了一个点击数字,分针能有相应的动作。先看下效果:
var fnum:Number = new Number();
Miao = 0;
Fen = 0;
Shi = 0;
function clock_func() {
with (this.clock_mc.zhen_mc) {
SHand._rotation = Miao*6;
MHand._rotation = Fen*6;
HHand._rotation = Shi*30+30*Fen/60;
}
}
clock_func();
clearInterval(ID);
for (var d:Number = 11; d>=0; d--) {
this["mc"+d].num = d;
this["mc"+d].onRelease = function() {
this.num*5<=fnum ? Fen -= 60 : 终极讨厌;
fnum = this.num*5;
clearInterval(ID);
ID = setInterval(function () {
clock_func();
if (Fen>=fnum) {
clearInterval(ID);
}
Fen>=60 ? Fen=0 : Fen++;
}, 10);
};
}
stop();
源文件: 时钟.rar