I have an AS3 App class e.g (pseudo code)
public class MyApp extends Application
{
protected function onRender():void
{
trace("frameRate = "+frameRate);
}
}
and this is then extended by the app MXML:
<MyApp width="100%" height="100%" frameRate="30" enterFrame="onRender()">
...
</MyApp>
The app appears to be running at the right speed, but in MyApp.onRender(), frameRate is seen as NaN (in the debugger too if I step through).
Why is this? How should I be obtaining the application’s FPS property?
The Language Reference has this note for
frameRatein the Application class:If you use
stage.frameRatein your trace it should give you the framerate you assigned to the Application. You might need to throw atry-catchstatement around thetrace, since theenterFrameevent can be dispatched beforestageis instantiated.