UPDATE: http://www.flashfuck.it/fps-monitor/

Here’s some (usefull i hope :) ) source..

fpsmonitor.png

I’ve made a little fps monitor for my projects (for both as3 and flex)… so, here’s some souce and some howtos about…

There are 2 classes, FPSMonitor is made for as3 (or flash) projects, the other one, FlexFPSMonitor is made expecially for use in Flex.

Usage AS3:

?View Code ACTIONSCRIPT
import it.flashfuck.debugger.FPSMonitor;
//[...]
addChild(new FPSMonitor());

Usage Flex:

?View Code ACTIONSCRIPT
// new xmlns in application tag
xmlns:debugger="it.flashfuck.debugger.*"
//then add the tag, remember to add it at the end of your app so it's appearing in front of everything

quite simple hm? :D
The main difference between these classes’ results is dragging. Flex one is draggable over the application stage, the other one is not draggable (just edit the code if you want to bring it away among the screen :) )….

Features
FPSMonitor (as the flex one) is monitoring
- OS, Player type, version, and “is debugger”
- FPS
- Memory usage (note: this parameter tells you the memory usage by ALL flash player instances you’re running, so if you’re running more than 1 player at once this value is altered!…even in 2 firefox tabs or a standalone and a browser player)

Graph:
FPSMonitor is displaying in a graph 2 values: FPS (white) and memory usage (black) (same note for this value :) )
Everything is blended with BlendMode.INVERT so you can see the monitor in quite every condition.

I hope you enjoy.
Download here both classes FPSMonitor.as and FlexFPSMonitor.as

….just a note: feel free to use this code anywhere, if you’re improving functionalities, adding more features or anything else please just send me a smoke signal or a pidgeon with a message so i can update the source :)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Live
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Related

Tags:

8 Responses to “FPSMonitor for AS3 and Flex projects”

  1. Krystian Majewski Says:

    Thanks! This is awesome!

  2. pigiuz Says:

    made in italy is not only fashion :P

    thx, i hope you enjoy

  3. Niklas Says:

    Hi there!

    Love this one – but I have a question regarding the numbers for the memory usage… What are they representing – Mb, Kb or?
    Like this graph because it’s so easy to setup and it is very useful!!

    All the best, Niklas

  4. Tobias Says:

    Thx! This is really nice.

  5. pigiuz Says:

    sorry niklas, i didn’t highlight memory usage is in megabytes :)
    anyway i have to specify that memory usage is not relative to “that swf” but to “flash player” actual memory usage: System.totalMemory in fact shows only that data.

  6. mindfocker Says:

    thanks for this! very useful indeed.

  7. Nifty FPS/CPU monitor class Says:

    [...] Link. [...]

  8. Carmine Says:

    Grazie!

    But I used this in Flex 3, and found that the component call should be do go with the capitalized files.

    Forza ASurri

Leave a Reply