MACROMEDIA FLASH |
ACTIONSCRIPT: FPS SPEEDOMETER |
what is "fps"?
fps, or frames per second, is the setting in flash that dictates to the flash player how fast to play back a movie. the default setting is 12, meaning that each frame is displayed on-screen for one twelfth of a second. fps can be set from 0.01 to 120, causing frames to be displayed at the rate of as little as 1 frame every hundred seconds to as many as 120 frames in a single second. in theory, anyway. in reality, most experienced flash developers will at some point have created a movie on their sweet developer box and then cringed as they watched it trickle along on a p90 or a 604 132. the problem is that their own machine plays the movie back at a different frame rate than the slower machine. why? because in flash the "fps" setting doesn't actually stay the same between different machines. fps is like a speed limit: you can tell a movie not to play faster than the specified fps, and all machines will obey, but you can't tell a movie to stay above a certain frame rate. if a machine doesn't have the processing power to render the frames at the specified fps, the movie will simply run more slowly. so, the question for developers has always been *how much slower*?
determining the actual fps
thanks to a little actionscript, we're finally going to find out how fast flash movies actually play back. with the "moock fps speedometer" we can see the actual framerate of any movie as it runs on any machine. here's what it looks like in action:
> view the moock fps speedometer
by using the speedometer above, you can test the basic maximum framerate of flash on any machine. the frame rate of the fps speedometer is set to 30. you'll likely never see 30 though because the movie itself requires some processing power from flash. but you're probably more interested in the frame rate of your own movies, which is what the fps speedometer is really made for. follow the directions below to add a speedometer to an existing movie. once you've added the speedometer to a movie, you should determine its framerate while it is running on the slowest machine you expect your users to have. then set your frame rate to be slightly higher than that to ensure uniform playback on all machines.