Powered by dead dinosaurs

Flash AS3: Track SWF memory usage and framerate with SWFProfiler

This is just a quick post to let you know about another essential AS3 class you should download right now. It’s called SWFProfiler and it adds this slick memory usage and framerate monitor to your SWF:

SWFProfiler Shane McCartney

Shane McCartney has built this clever component and released it for free. It is completely self-contained in it’s own class file. So, using it only requires 2 lines of code:

import com.lia.utils.SWFProfiler;
SWFProfiler.init(stage, this);

I should also mention that it is automatically added to the context menu of your SWF, so you just right-click to show it or hide it.

To see the SWFProfiler in action, go to Shane’s blog.

You can download the most recent version of the SWFProfiler class from google code. Shane has a few other goodies there as well.

Previous

Flash AS3: check if an AS3 method exists

Next

Flash AS3: Stop using “Automatically Declare Stage Instances”

3 Comments

  1. Gaian Helmers

    Thank you very much for the link, very very useful utility.

  2. Carl

    To get the graph to run from right to left make the following changes in the update function of the ProfilerContent class

    in the two for loops change
    vec.moveTo(0, -value * height);
    to:
    vec.moveTo(width, -value * height);

    and
    vec.lineTo(i * inc, -value * height);
    to:
    vec.lineTo(width-(i * inc), -value * height);

  3. Boris

    Good stuff! Thank you!

Powered by WordPress & Theme by Anders Norén