Tracing in FlashDevelop from AS3

Aug 01 2006 Published by under Flash

Someone who was using my AS3 FlashDevelop Templates just asked how they could trace to the output panel in FlashDevelop. It just took a few minutes to come up with a solution, so I’ll post it here for everyone. Just create the following class:

package org.flashdevelop.utils {
import flash.system.fscommand;

public class FlashOut3
public static function trace(msg:Object):void
fscommand(“trace”, msg.toString());

and pop it in the folder:

C:/Program Files/FlashDevelop/Tools/

Then replace the compile target in your build.xml with the following:

< target name="compile">
< exec executable="${flex2.dir}/${compiler}">
< arg line="-source-path='C:/Program Files/FlashDevelop/Library'" />
< arg line="-default-frame-rate=${framerate}" />
< arg line="-default-background-color=0x${background.color}" />
< arg line="-default-size ${width} ${height}" />
< arg line="'${basedir}/${source.dir}/${source.file}'" />
< arg line="-o=${output.file}"/>
< /exec>
< /target>

Or you can just add in that third line there, with the -source-path argument.

Now, in any class where you want to trace something, you’ll have to import the FlashOut3 class:

import org.flashdevelop.utils.Flashout3;

And then you can trace to the output panel like so:

Flashout3.trace(“hello world”);

6 responses so far. Comments will be closed after post is one year old.