小编Kev*_*wan的帖子

为什么AS3中的定时器功能不能足够快地更新0.05秒?

一直让我困惑的事情,直到今天仍然如此,为什么AS3中的Timer类不能更快地更新到更低的毫秒数?

我似乎记得读过Flash能够每20毫秒最多推送一次更新到计时器(推荐) - 我为最近一次游戏创建的计时器每50毫秒更新一次,但即便如此也是如此.在本地,它工作正常,在在线环境中,它没有.

有没有具体的东西我在这里做错了,或者Flash是否真的无法在在线环境中快速更新来做一秒钟的两位小数?

再次,这在本地工作正常.

我的计时器代码在这里:

package src.gameShared {

import flash.display.Sprite;
import flash.utils.Timer;
import flash.events.TimerEvent;
import src.main;


public class timer extends Sprite {

    private var _updateAmount:int = 50;                     // MUST give a whole number if divided by 1000 and less than 100. Recommended above 20. Gives 25, 40 or 50.
    private var _timer:Timer = new Timer(_updateAmount,0);
    private var _count:int = new int();

    public function startTimer():void{
        _timer.addEventListener(TimerEvent.TIMER, updateText, false, 0, true);
        _timer.start();
    }

    public function stopTimer():void{
        _timer.stop();
        // Add to …
Run Code Online (Sandbox Code Playgroud)

flash actionscript-3

1
推荐指数
1
解决办法
914
查看次数

标签 统计

actionscript-3 ×1

flash ×1