Quick Tip: Debugging Module Inside Non-debug Application

Did you know that it is not possible to debug loaded content within release (non-debug) build app? Every attempt to insert a breakpoint during the runtime will cause null pointer exception thrown by flash builder, however you can still trace() output. To be more specific, imagine you have main application deployed somewhere on the web and you want to debug a module you are just developing wrapped inside the main application. Sure you can use proxy mapping trick + custom run configuration, that would help you run your debugging version of module.swf, however while the main application is non-debug version, the flash builder debugger will just not work correctly. Luckily you have two options to make it work. First, you may also map the main application .swf file for your debug version (+ some flex rsl files) or second option, make the flash player wrap whole content into some .swf compiled in debug mode using PreloadSWF in mm.cfg.

To sum up whole process in steps:

Generally, to make debugger work, the flash player has to run .swf in debug mode. To override (wrap) non-debug application you can use PreloadSWF targeting some simple .swf file in debug version:

    import flash.display.Sprite;
    public class Debugger extends Sprite {}

mm.cfg configuration


Once you are already playing with PreloadSWF, you can instead target MicroProfiler.swf and profile every flash on the web.

3 comments so far

  1. auclair April 8, 2011 15:07

    the “microProfiler.swf” is a very old version of FlashPreloadProfiler.
    Try this instead: http://jpauclair.net/flashpreloadprofiler/

  2. Jozef Chúťka April 8, 2011 17:13

    auclair thnx, link updated

  3. […] the idea of having the automation framework classes available through PreloadSWF in mm.cfg (some more reading about PreloadSWF) but it appeared that the classes from preloaded .swf appears in different application […]

Leave a comment

Please be polite and on topic. Your e-mail will never be published.