嗨,我有一个闪光的cs4倒计时时钟,但我想在计时器达到小时0,分钟0,秒0时播放声音。例如,新年作为目标时间有什么想法吗?
附注:这是使用actionscript 3
发布于 2009-12-14 03:54:06
var delay:uint =计算到新年的时间,单位为毫秒var timer:Timer =新计时器(delay,1);timer.addEventListener(TimerEvent.TIMER_COMPLETE,newYearCallback);
function newYearCallback(e:TimerEvent):void
{
playYourSound();
}发布于 2009-12-14 03:55:43
我已经在Flash中构建了几个不同的计时器应用程序,我必须告诉你,Flash的计时并不完美……我总是遇到漂移,甚至在几分钟的时间跨度。
但如果你真的觉得有必要..。请在此处查看回复:Add days to Date in ActionScript
要播放声音,请尝试如下所示:
var sound:Sound = new Sound();
sound.attachSound("mySound");
sound.start(0,0);https://stackoverflow.com/questions/1897506
复制相似问题