Home > Quick Tip > Quick Tip – Flex Profiler Issue

Quick Tip – Flex Profiler Issue

September 2nd, 2010 brupp Leave a comment Go to comments

Flex profiler is one of the biggest advantage of using Flex Builder IDE. It works wonders for developer who want to understand the nuances of flash player. If you want to write clean code and avoid memory and performance issues, use profiler.

Read more about profiler here: http://livedocs.adobe.com/flex/3/html/help.html?content=profiler_1.html

Okay, so the post is not about what and how profiler works. In most of the cases you just need to click the “profile..app” button in the IDE. But at times you may find it not working. Here I am putting down one possible way to fix it and look out for:

Flex profiler actually listens for messages from the profiler agent. The profiler agent is a swf launched in parallel to your main swf. It is located in your Flex workspace at .metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf.

Now Flex Builder reads a file called mm.cfg which has the location profileragaent.swf. mm.cfg can be located at  c:/users/user (Windows). It should have a name-value pair indicating the location of ProfilerAgent.swf. Create (or edit existing) mm.cfg and add following line

PreloadSwf=Drive:/…/yourworkspace/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf?host=localhost&port=9999

In addition to above you can other options which are quite helpful for debugging:

ErrorReportingEnable=1
TraceOutputFileEnable=1

Above options will redirect the trace() output to an external file which can you browse using any text editor.

The flashlog.txt file will be created in the following location: C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs\flashlog.txt

Let me know if this post saved your couple of hours :)

Flex profiler is a part of the Flex Builder IDE, that listens for messages from the profiler agent. The profiler agent is a swf launched in parallel to your main swf. It is located in your Flex workspace at .metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf.

I had a hard time getting it worked. Here is what worked to make it working:

Create (edit existing) file named mm.cfg (location windows: c:/users/user) and add following line

PreloadSwf=F:/user/workspace/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf?host=localhost&port=9999

In addition to above you can other options which are quite helpful for debugging:

ErrorReportingEnable=1
TraceOutputFileEnable=1

Above options will redirect the trace() output to an external file which can you browse using any text editor.

The flashlog.txt file will be created in the following location:

Windows; C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs\flashlog.txt

Categories: Quick Tip Tags: ,
  1. No comments yet.
  1. No trackbacks yet.