我有一个AS3应用程序类,例如(伪代码)
public class MyApp extends Application
{
protected function onRender():void
{
trace("frameRate = "+frameRate);
}
}然后,应用程序MXML对此进行了扩展:
<MyApp width="100%" height="100%" frameRate="30" enterFrame="onRender()">
...
</MyApp>这个应用程序的运行速度似乎是正确的,但是在MyApp.onRender()中,frameRate被看作是NaN (如果我通过调试器的话)。为什么会这样呢?如何获取应用程序的FPS属性?
发布于 2011-01-11 21:39:10
语言引用在应用程序类中为frameRate提供了以下说明:
Note:该属性不能由ActionScript代码设置;它必须在MXML代码中设置。
如果在跟踪中使用stage.frameRate,它应该会给出分配给应用程序的框架。您可能需要在try-catch周围抛出一个trace语句,因为enterFrame事件可以在实例化stage之前分派。
https://stackoverflow.com/questions/4662750
复制相似问题