Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > NetStream > currentFps (NetStream.currentFps property) | |||
public currentFps : Number [read-only]
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.
Availability: ActionScript 1.0; Flash Player 7 - Note: This property is also supported in Flash Player 6 when used with Flash Media Server. For more information, see the Flash Media Server documentation.
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);
}
If your SWF file includes a version 2 component, use the version 2 components' DepthManager class instead of the MovieClip.getNextHighestDepth() method, which is used in this example.
Flash CS3