Profiling Flash CS3 Projects with Flex Builder

Aug 9, 2008

Tags:

Over the last few months I have been working on a rather big project using flex builder to write the Actionscript and Flash CS3 to compile it. After being shown Flex Builders rather amazing profiler I began to try and port over the Flash CS3 application to Flex. Needless to say Flash and Flex 3 don't like each other that much, if it's not invisible mx controls it's random errors from the focus handlers. Well the other day I stumbled upon a rather cool feature in Flex Builder, by a total random click I found that you can Profile External Applications. Well assuming this ment external Flex applications I figured it wouldn't work. But being curious as I am I figured why not try it on my Flash CS3 Compiled swf file. To my amazement (after some tweeking) the Flex Profiling perspective came to life, a buz with memory usage and objects on the stage. So now you ask how did you get it to work well I've included a quick and dirty tutorial to show you all how to get it working. Now the keen eyed person will nottice that my title bar says "Flex Profiling - Eclipse SDK" well Flex builder is eclipse under the hood and thankfully I could just use my already configured Eclipse 3.3 install with Flex Builder via the plugin offered on the Adobe site. All in all its the same I just have more stuff in my Eclipse then you get with Flex Builder. Hit the jump for the tutorial.

Now on to the tutorial...

First off open your project in Flash CS3 and open the Publish settings dialog (on windows this is found under the File menu), go to the Flash tab and select "Permit Debugging". Now just publish, export or run your flash project.

Now in Flex Builder/Eclipse open or switch to the "Flex Profiling" perspective, and hit the little down arrow on the right side of the profile view and choose "Profile External Application".

A dalog will popup on your screen you need to choose new and enter the url or path to the application note it says "Flex Application" but that appears to be irelevent as long as you have enabled permit debugging, when you last published or exported your application.

In the first dialog box select the path/url you want to profile and click "Launch", if your browser is opened you will see a warning about tabs if your browser has it enabled or even supports it (just to mention firefox 2 and 3 do by default as well as IE 7 and 8). Once your browser has loaded you will see a dialog similar to this one select the options you want to use and click resume.

Now all of the profiling views will spring to life showing all of the information that a normal flex application would. Just remember to disable debuging before putting it up on the internet or distributing it as this could potentialy be a big security risk.

Posted in: Articles |