0
我正在制作游戏。该游戏基于一个非常小的时间间隔(你只有5个时间做动作)。我的计时器在Flash Player中很棒,我做了5次。在网页浏览器(firefox,safari ..)中,5秒计时器现在为8秒钟。Flash游戏:getTimer不准确
如何解决这个问题? 这里是我的代码,我显示时间:
private function updateTimer(e:TimerEvent)
{
if (this.timer.currentCount < 500)
{
var centiemes:int = 100 - Math.floor(this.timer.currentCount) % 100;
var secondes:int = 4 - Math.floor(this.timer.currentCount/100) % 60;
this.txtTemps.text = ToolBox.zeroFill(secondes.toString(), 2) + ":" + ToolBox.zeroFill(centiemes.toString(), 2);
}
else
{
this.txtTemps.text = "00:00";
this.timer.stop();;
}
}
谢谢你!
同样的问题呢? http://stackoverflow.com/questions/1014009/as3-how-accurate-are-the-gettimer-method-and-the-timer-class – MrKiane 2012-01-17 18:02:36
不,看来Adobe必须有正确的。似乎Timer已经被放置,因为帧率基于处理器并且可以不同。 – 2012-01-18 09:26:50