welcome to the dark side of the moon

here's why I am the way I am...

Tuesday, August 23, 2011

Stage class in AS3

here's what I learned earlier this week...

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.

you can do this without the script of course, but it's a handy tip.

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

No comments:

Post a Comment