Wednesday 29 June 2011

how to change the frame rate of the flash player on runtime (from inside your code)

it is not so easy as you think!

to set it 60 call:

Object(FlexGlobals.topLevelApplication).stage.frameRate=60;

or... create this setter
public static function set frameRate(framerate:int):void{
    Object(FlexGlobals.topLevelApplication).stage.frameRate=framerate;
}
and call
frameRate=60;

you may also define it in mxml 
frameRate="60"

The default value of the player is 25; increasing the frame rates you consume more cpu! don't forget that you application will run in a slower computer than yours!

No comments:

Post a Comment