Remote & Local Debugging in Flash & Flex

There are a plethora of new and old tools out there to debug your Flash movies. However, just a reminder you can use Flash to see your trace statements and use your debugger while a SWF is running in a browser. Steps are as follows:

  1. Close all browsers and Flash.
  2. Go to your Flash installation directory, and look in the players directory. Mine on my PC is:
    C:\Program Files\Macromedia\Flash MX 2004\Players
  3. Make a folder called “backup”. Cut and paste the following files into it:
    • SAFlashPlayer.data
    • SAFlashPlayer.exe
    • SAFlashPlayer.rsrc
  4. Go into the debug folder, and copy the same files. Paste them one directory up, in the players folder. These are the files Flash MX 2004 Professional will utilize to make a debuggable SWF.
  5. Go back in the debug folder and install the appropriate debug player. The AX one is for IE (ActiveX), and other uses of embedded Flash, OSX for duh, exe for Firefox, and hqx for non-OSX Macs (maybe Linux? :: shrugs ::).
  6. Re-open Flash, and when compiling your FLA, make sure Debugging is enabled in your File > Publish Settings, Flash Tab > Debugging Permitted. This will ensure your SWD file, the ASCII holder of your ActionScript, will be created upon each compile. Careful, though; it has the nasty habit of caching just like ASO’s, causing the code you are debugging to be different than what’s in the SWF running. Delete if you’re paranoid like me.
  7. Open your Debugger, and ensure “Enable Remote Debugging” is on (drop down menu, top right).
  8. Finally, upload your SWF and SWD file to your server. When you hit the SWF in a browser, it’ll ask where do you want to connect; choose localhost, and go back to Flash if it doesn’t auto-focus it back for you; click OK (assuming no password), and your Output window should show traces, and your Debugger should work as normal (although a tad slower).

This’ll work for Flex too; it comes with a debug player in:
C:\Program Files\Macromedia\Flex\bin

For offline debugging where Flash is embedded, such as Zinc, you can log using Afterthought.

There are a plethora of other debugging tools as well, a lot made in Flash, but just so you know you have your standard ones by default which can be used for web deployed content.

If you have one you know of not mentioned here, please feel free to leave a link in the comments; we’d all like to hear about it.

2 Replies to “Remote & Local Debugging in Flash & Flex”

  1. The LuminicBox.Log one seems very nice if you don’t want to use MTASC and Flashout.

    Myself, I use Afterthought or the Remoting Debugger most of the time, but the KewBee Flash Plugin Switcher is a must-have. Dunno what I’d do without it. Makes switching between new players, old players, debug players a snap in your browsers, standalone players, and IDE players.

  2. As2lib Logging API of the
    As2lib Open Source Framework
    can be used to add logging calls to your application at different levels that help during debugging of your application. It can also be used as a kind of distributor for several output devices like LuminicBox etc. You can thus leave your logging calls all the same but just change the underlying configuration to display the calls in different devices depending on the execution environment.
    But this is of course no complete replacement for a full-featured debugger like AdminTool or flash’s build in that allows for breakpoints etc.

    Greetings,
    Simon

Comments are closed.