Skip to content
Oct 31 2009 / alecmce

Debugging Web-Embedded Movies in FDT

This is something I find myself setting up again and again for different projects: how to launch the debugger to enable step-through debugging and trace output for a swf that is being viewed in a browser, all inside the FDT environment.

The solution is to create an ant script to launch the debugger, and to run it before the flash movie’s web page is launched. The simple script follows:

debugger.xml

<project name="launch debugger" default="launchDebugger">

	<property file="mac.properties" />
	<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />

	<target name="launchDebugger" description="launches the debugger only">
		<fdt.startDebugger projectname="${PROJECT_NAME}" saveLocation="tmp" />
	</target>

</project>

This script requires a properties file. I flip between working on my mac at home and on my PC at work, so I tent to create two properties files, mac.properties and pc.properties. This allows me to share files across the two contexts without changing the particular ant scripts. The properties file contains the following:

mac.properties

FLEX_HOME = the path to the flex SDK folder
PROJECT_NAME = the FDT project name

With these files defined and stored (probably in an ‘ant’ folder), the debugger.xml should be dragged into the Ant view (if it is not already visible, goto Window > Show View > Ant to make the ant view visible.)

Finally, the most important trick is to go to the Run > External Tools > External Tools Configuration… to bring up a dialog. There you should see your ant script on the left under Ant Build. Choose the JRE tab and specify that the ant script is going to Run in the same JRE as the workspace. I always forget that step, and it always fails to work first time!

  • http://twitter.com/alecmce alecmce

    If you want to view a #Flash movie embedded in an HTML page and debug it in #FDT, this will help: http://bit.ly/1dFkO6
    This comment was originally posted on Twitter