实时改变影片帧频-ActionScript 3 Tips and Tricks

由于ActionScript 3 Tip of the Day(ActionScript3 Tips and Tricks)一文原帖地址实在太慢,准备从今天起,慢慢将原帖转到Blog上,以免以后哪天原帖不能访问了,我还可以拿来参考。

本文是ActionScript3 Tips and Tricks系列阅读笔记之一Change the frame rate of your movie,这里是原文地址

实时改变影片帧频(Change the frame rate of your movie)

使用ActionScript3中的Stage类,可以动态改变影片的帧频。

Stage类可以通过主影片中sprite或影片剪辑的stage属性访问(也可以通过位于同一安全沙箱其他影片中的相关属性访问)。stage对象有一个frameRate属性,可以包含0.1至1000之间的任何值。改变这个属性的值,可以让Flash Player实时改变被播放的影片的帧频。

1// 改变帧频到12帧/秒
2stage.frameRate = 12;

原文内容:

Using ActionScript 3, you can dynamically change the frame rate of your movie using the Stage class.

The Stage class (flash.display.Stage) is the class assigned to the stage object which is accessible from your main movie sprite/movie clip (or others within the same security sandbox) using the stage property. The stage object has a frameRate property which can contain any value between 0.01 and 1000 and determines the frame rate at which the Flash player plays back your movie. Changing this value lets you change the frame rate at runtime.

1// change frame rate to 12 fps:
2stage.frameRate = 12;

原文地址