Pay for Hesitation: Display Frame Rate
Pay for Hesitation
Ideas are Worthless Unless Acted Upon
Pages
Home
Authors
2010年8月27日 星期五
Display Frame Rate
1. create a TextField named "frameRate_txt"
2. put following codes in the first frame of a flv file.
var designatedFrameRate :Number = stage.frameRate;
var lastFrameTime :Number;
this.addEventListener(Event.ENTER_FRAME, showFrameRate);
function showFrameRate(event:Event):void
{
var now :Number = getTimer();
var elapsed :Number = now - lastFrameTime;
var framePerSecond :Number = Math.floor(1000/elapsed);
lastFrameTime = now;
frameRate_txt.text = "Frame Rate: " + String(framePerSecond) + " / " + String(designatedFrameRate);
}
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言