NetStream.currentFps
Availability
Flash Player 7.
Note: This property is also supported in Flash Player 6 when used with Flash Communication Server.
For more information, see the Flash Communication Server documentation.
Usage
my_ns.currentFps:Number
Description
Read-only property; the number of frames per second being displayed. If you are exporting FLV
files to be played back on a number of systems, you can check this value during testing to help
you determine how much compression to apply when exporting the file.
Example
The following example creates a text field that displays the current number of frames per second
that video1.flv displays.
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("video1.flv");
this.createTextField("fps_txt", this.getNextHighestDepth(), 10, 10, 50, 22);
fps_txt.autoSize = true;
var fps_interval:Number = setInterval(displayFPS, 500, stream_ns);
function displayFPS(my_ns:NetStream) {
fps_txt.text = "currentFps (frames per second):
"+Math.floor(my_ns.currentFps);
}
634
Chapter 2: ActionScript Language Reference
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers