Skip to content

Flash Preload Profiler

May 15, 2010

In the last few weeks I started to use more and more the mm.cfg feature « preloadSWF »
This enables you to start a SWF before any SWF launched by FlashPlayer and have much information on the launched SWF. It also enables you to “hook” on the launched SWF and manipulate it’s display list.

I then decided to try making my own profiler for flash in a way that it could be started for any web site without having an interface too invasive. FlashPreloadProfiler is born.

FlashPreloadProfiler is an open source multi-purpose profiler designed to help productivity and stability during development by exposing “under the hood” representation of any flash scene.
The main goal is to help expose and diagnose problems before they get too big.

It enables developers, artists, designer or testers to see what sometimes “cannot be seen” such as:

  • What is the current FPS and memory statistics of a SWF
  • Where are all mouse event listeners objects
  • What is the global scene overdraw
    • How many sprites are contained in the scene and may be one over the others
  • What is the life cycle of all the display objects on the stage
    • Instanciation, AddedToStage, RemovedFromStage, Garbage Collection

    Want to know more?

    Full description and download here!

    *the profiler is on the top-left corner of the application

    From → general

    12 Comments
    1. Looks nifty! I can’t wait to try it out on Monday!

    2. Vabi permalink

      That name is a trademark, see http://de.wikipedia.org/wiki/FlexRay

      • Thanks a lot!
        I will change it then!
        Painful! 🙂

      • Project renamed (originaly) FlashPreloadProfiler
        Only the videos still need to be changed
        Thanks ctrl+a, ctrl+h

    3. canab permalink

      Hello!
      I found a little issue.
      In flashplayer [mouseEnabled=false] on parent does not prevent children to receive mouse events.

      Hovwever, “MouseListeners” profiler does not show shapes for sprites, if container of this sprites has
      mouseEnabled=false.

      This is a reproduce code:


      package
      {
      import flash.display.Sprite;
      import flash.events.MouseEvent;
      import flash.text.TextField;
      public class Profiler extends Sprite
      {
      public function Profiler()
      {
      var sprite:Sprite = createInteractiveSprite();
      sprite.addEventListener(MouseEvent.MOUSE_OVER, onOver);
      addChild(sprite);
      // With this line mouseListeners profiler does not show any shape
      // However, sprite is stil reacting on mouse events
      mouseEnabled = false;
      }
      public function createInteractiveSprite():Sprite
      {
      var sprite:Sprite = new Sprite();
      sprite.graphics.beginFill(0x0000FF);
      sprite.graphics.drawRect(50, 50, 100, 50);
      sprite.graphics.endFill();
      return sprite;
      }
      private function onOver(e:MouseEvent):void
      {
      Sprite(e.currentTarget).scaleX += 0.1;
      }
      }
      }

      view raw

      gistfile1.as

      hosted with ❤ by GitHub

    4. canab permalink

      Thanks for the quick reply!
      Last version works perfectly.

    5. Tommy Reilly permalink

      Hi,

      I wrote the Sampler and the preload swf functionality. Glad to see its being put to good use. Can you email me, I’d love to hear your thoughts on the Sampling API and how we can make it better. Cheers,

      Tommy

    Trackbacks & Pingbacks

    1. Flash Preload Profiler | Flash Player roundup
    2. T.Suriyathep » AIR iOS Memory Management Unavoidable

    Comments are closed.