How to create a Flash Performance Calculator in AS3
This is a simple AS3 performance calculator I created..
/*********************************************************\
|*Thanks for using Fighterlegends performance Calculator!*|
\*********************************************************/
var documentFPS = stage.frameRate;
var lastTime = getTimer();
var samples = new Array(30);
var frameCounter = 0;
stage.addEventListener(Event.ENTER_FRAME, update);
function update(event:Event) {
var currentTime = getTimer();
var timeDif = (currentTime-lastTime)/1000;
lastTime = currentTime;
var actualFPS = 1/timeDif;
samples[frameCounter % 30] = actualFPS;
frameCounter++;
var averageFPS = 0;
for (var i = 0; i < 30; i++) {
averageFPS += samples[i];
}
averageFPS /= 30;
var performance = Math.round(averageFPS/documentFPS *100);
var lag = 100-performance;
fps.text = Math.round(averageFPS) + " fps\n" + documentFPS + " target fps\n" + performance +
"% performance\n" + lag + "% lag\n";
}
Just create this dynamic box on the stage:
Instance: fps
width: 140
height: 84
Hope you give me credit!
UPDATE:
I got a new, and better update of the script from WarKry on Kongregate!
AS3 video player =D
I made a video player in AS3..
I want to know how you all like it!
http://fighterlegend.com/thax/videoPlayer/
Your browser does not support iframes.
Chat up!
I put up a chat!
Well, an Instant Messenger.. But you get the idea..
http://chat.fighterlegend.com
=D
WEBSITE TEMPLATE IS UP!
I successfully made my very first template for a website!
More will come!
Making the template to my website!
I'm creating the template to my website.
Next, I'm going to add a template of my own to the Forums.
Then to this blog ;D
Car Physics AS3
http://fighterlegend.deviantart.com/art/AS3-car-physics-Top-View-133523129
There ya are! It's my newest car physics test!
Making multiplayer car game
I'm creating a multiplayer car game =D
It's going to use my own physics engine, and yeah..
I think it's going to be a cool thing..
I got the multiplayer thing, and the car sim. Just gotta make all the graphics and all... Then connect the variables to send to the other players.
Forums updated
Forums almost complete! Just gotta add some more addons, and I'm basically done!
Forums up and in the making!
I just got the forums up.
They're working, and right now, I'm working on them.
I might need to have more mods >=D
http://forums.fighterlegend.com
Hello world!
Hello to all who is visiting my first, and very, website.
And blog post =D
I successfully set up my site with the help of the very kind Fat Cow customer assistance group..
I'm going to update this every single day..
I hope I get more people on this blog and Forums!
http://forums.fighterlegend.com
Your's truly,
Fighterlegend
