Date计时的办法

      Flash 2005-2-3 20:51
我看见论坛里有人做钟表的时候,实现即时时间的方法是
onEnterFrame = function()
{
   var da = new Date();
   da.getHours();
   da.getMinutes();
   da.getSeconds();
}

这样每enter frame一次就new一个Date感觉不是很好,发现这样做要好的多


da = new Date();
startTime = da.getTime();
onEnterFrame = function()
{
   da.setTime( startTime + getTimer() );
   da.getHours();
   da.getMinutes();
   da.getSeconds();
}


标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}

注册5D通行证,立刻拥有自己的博客发表留言

用户:  密码: 匿名
内容:
加粗 下划线 文本颜色 居中 插入链接 建立Google搜索链接 插入图片 引用文本
 
汗 喜欢 骄傲的笑 哭 酷! 愤怒 黑线 什么? 猥琐 偷笑 无语 晕 吃惊 诱惑
smile frown redface biggrin wink rolleyes mad eek 禁止笑脸转换
zoom inzoom out
验证: checkcode 换一个