flash做一个时钟遇到问题

[复制链接]
查看11 | 回复1 | 2008-9-11 15:30:45 | 显示全部楼层 |阅读模式
做一个时钟,功能是拖动时针旋转时分针不动,拖动分针旋转时,时针要跟著转动,分针转一周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;

}
}

回复

使用道具 举报

千问 | 2008-9-11 15:30:45 | 显示全部楼层
time=new Date()//取得系统时间的小时,保证其时间以“00”而不是“0”显示。 hour=time.getHours(); if (length(hour)<2){hour="0"+hour;} //取得系统时间的分钟数,保证其时间以“00”而不是“0”显示。 minute=time.getMinutes(); if (length(minute)<2){minute="0"+minute;} //取得系统时间的秒数,保证其时间以“00”而不是“0”显示。 second=time.getSeconds(); if (length(second)<2){second="0"+second;} ...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行