Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 23:59, 31 May 2007.

FPS-Meter for Adobe Flash Lite v1.1, 2.0 and 2.1

From Forum Nokia Wiki

Contents

Overview

FPS-Meter (Frames Per Second) v2.0 is very simple but extremely useful component for Adobe Flash Lite v1.1, 2.0 and 2.1. It will help you in optimizing Flash Lite animations for smooth playback. I released first version of this component on my blog sometime ago.

Here you will find full source-code of this component and compiled .MXP (Adobe Extension Manager Package) file.

FPS-Meter in CleverBunny game

Sources

Click the filename below to download.

Media:FPS-Meter_v2.zip

The Code

  • Create a MovieClip with 11 frames and make KeyFrames on frame numbers 1, 2 and 11.

MovieClip with KeyFrames

  • On 1st KeyFrame initialize timer variable.
var timer:Number = 0;
  • On 2nd KeyFrame, calculate the FPS (Frames Per Second) value and display it.
txtFPS = Math.round(10 / ((getTimer() - timer) / 1000));
timer = getTimer();
  • On 3rd KeyFrame, make a jump to KeyFrame number 2 to make it continuous loop
gotoAndPlay(2);

End Notes

You can also use same frame-based timers for doing other tasks, such as timely updating Battery Meter, Network Signal Strength Meter or reloading data from Internet.

Source-code for Flash Lite v1.1 is also included in the download and it is done in similar manner.

I hope this little piece of code will be helpful to you in your daily Flash Lite development.

--chall3ng3r 23:59, 31 May 2007 (UTC)

Related Discussions
Thread Thread Starter Forum Replies Last Post
E50 and custom Flash Lite screensaver ladjack Flash Lite on Nokia Devices 3 2008-01-03 13:20
I want to detect which application is installed . chirag_cel General Symbian C++ 4 2006-11-27 10:53
Stand-alone Python app not launched correctly from other native app bercobeute Python 2 2005-03-04 14:30
FL player memory allocations Newtz_2001 General Discussion 5 2007-08-11 23:37
Virtual World API with Flash Lite joaach Flash Lite on Nokia Devices 0 2008-03-09 18:35
 
Powered by MediaWiki