Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

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

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

We do not recommend Flash Lite development on current Nokia devices, and all Flash Lite articles on this wiki have been archived. Flash Lite has been removed from all Nokia Asha and recent Series 40 devices and has limited support on Symbian. Specific information for Nokia Belle is available in Flash Lite on Nokia Browser for Symbian. Specific information for OLD Series 40 and Symbian devices is available in the Flash Lite Developers Library.

Article Metadata
Code ExampleArticle
Created: chall3ng3r (31 May 2007)
Last edited: hamishwillee (14 May 2013)

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)

This page was last modified on 14 May 2013, at 06:04.
54 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×