Flash FPS Monitor AS2,AS3

LabsAS3AS2Adobe Flash 19.Oct 12:24 am by wissarHome »

fps.jpg

Script to display currently framerate of flash movie for flash-developer.

AS2 version featured:

  • Display graph of framerate in the period of time. This graph is usually be the green but when the framerate is drop it will change the color to yellow and red.
  • TE (Time Elapsed) Use for examination the speed in millisecond of each single frame.
  • Enlarge mode and Compact mode
  • Changing its position, top-left and top-right
  • FPS isn’t reset, this helps you to test the looping movie.
  •   

    AS3 version include a featured:

    Display memory usage and its graph.

    Example:

    This is 3D enginge of flash 8 which is AS2 version. This will generate 30 pieces of object with blur effect to test a performance.
    See the graph while you toggle the blur effect, you’d see the different.

    flash

    AS2 version usage:

    import com.lifeztream.debug.FPS;
    //FPS.start (movieFPS:Number [,alignment:String="left"]);
    FPS.start (31,"left");
    

    alignment “left” or “right”, “left” is default.

    AS3 version usage:

    import com.lifeztream.debug.FPS;
    //var fps:FPS = new FPS([iAlign:String = "left"]);
    var fps:FPS = new FPS("left");
    addChild(fps);
    

     * version    1.3 - Auto-start when added to stage and auto-stop when it’s removed
     *             - Fix Bug from StageAlignments
     *            Minor Improve Coding Speed
     * version    1.2 - Dispose unused bitmapData and variables for garbage collector to free up ram.

    FPSMonitor Class AS2 (521)
    FPSMonitor Class AS3 (1212) version 1.3

    8 Responses to “Flash FPS Monitor AS2,AS3”

    1. Nicholas Says:

      AS2 class it’s not working properly when compiled using MTASC. The “graphic” doesn’t chance. But still a great class. If you correct this bug, let me know.

      Regards.
      Nicholas

    2. Exey Says:

      tried using AS3, Error:
      1172: Definition com.lifeztream.utils:BitmapContainer could not be found.

    3. wissar Says:

      import com.lifeztream.utils:BitmapContainer;
      Just delete this line.

    4. Carm Says:

      Thanks for this, works great in CS4 (once you delete the Bitmap util import)

    5. Rickson Says:

      hi, this is awesome class!!
      I tried to integrate FPSmonitor, however, there seemed not to have “com.lifeztream.utils.BitmapContainer.as” in zip file.
      Could you please attach that class or where can I find it on your website?
      thanks in advance.

    6. acetin Says:

      Thank you for a such great utility.

      For the AS3 library, I think the expression
      currentMemory*0.00001
      should be
      currentMemory*0.000001

      Thank you again :)

    7. Maloblanco Says:

      Hi wissar,

      Thank you very much for the script, it works really well and it’s amazingly helpful

    8. Dd Says:

      Hello, got some issues … :(

      C:\Data\Dev\Flash\(…)\src\com\lifeztream\debug\FPS.as(133): col: 9 Warning: variable ‘mcEnterFrame’ has no type declaration.

      And this is the same with the following functions (bOver,bOut, …)

      I have just copied the lib into my src folder (with the “com” folder) and created a new class in the Main. I’m currently using flashdevelop and I thing your code will only work in the flash IDE ? (need of the Stage maybe)

      If it speaks to you I need some enlightenment :).
      This feature seems very neat and I want to use it !

      Thx

    Leave a Reply


    Special thanks to Ndesign-Studio.
    Entries RSS Comments RSS Login