1
votes

I am using Flash Builder 4.6 and I am trying to setup up and Ant task to build and run my Flash application. I can get the Ant task to both build and run my application, but it doesn't trace to the console and breakpoints don't work.

I followed the advice of this Stack Overflow post but I keep getting the error:

[exec] Another Flash debugger is probably running; please close it. Details: 'Unrecognized Windows Sockets error: 0: JVM_Bind'.

I also followed this post's advice to properly configure my Ant script in Flash Builder but it doesn't seem to make a difference.

My AS file:

package
{
    import flash.display.Sprite;
    import flash.text.TextField;

    public class HelloAnt extends Sprite
    {
        public function HelloAnt()
        {
            var label : TextField = new TextField();
            label.text = "Hello World!";
            addChild(label);
            trace ("Hello World!");
        }
    }
}

My ANT script:

<?xml version="1.0" encoding="utf-8"?>
<project name="HelloAnt" basedir=".">
    <property name="FLEX_HOME" value="C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0"/>
    <property name="src" value="${basedir}\src"/>
    <property name="bin" value="${basedir}\bin"/>
    <property name="application" value="${bin}\swf\HelloAnt.swf" />

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

    <target name="run">
        <echo file="${basedir}/build/.fdbinit">
            run ${application} 
        </echo>
        <exec executable="${FLEX_HOME}/bin/fdb.exe" spawn="false" dir="build">
            <arg line="-unit"/>
        </exec>
    </target>

    <target name="build">
        <mxmlc output="${application}"
                       file="${src}/HelloAnt.as"
                       actionscript-file-encoding="UTF-8"
                       keep-generated-actionscript="false"
                       optimize="true"
                       fork="true"
                       debug="true"
                       maxmemory="1024m"
                       static-link-runtime-shared-libraries="true">
            <source-path path-element="${FLEX_HOME}/frameworks" />
            <source-path path-element="${src}" />
        </mxmlc>
    </target>

    <target name="build-run">
         <sequential>
             <antcall target="build" />
             <antcall target="run" />
         </sequential>
    </target>
</project>

I am out of ideas. Does anybody have any insight?

1

1 Answers

0
votes

If you are using FDB to debug your application then the output will be sent to the terminal window FDB is running in. You can open FDB in Terminal (on Mac) and type "run /path/to/your/application" to connect. Using ANT to call FDB the way you are doing it now, I would think it would run the command and then immediately disconnect. You would need to keep FDB open or debug through Flash Builder (to use it's console).

I'm still checking if there's a way to connect the output to Eclipse's console.

You can see a list of commands available if you double click on fdb in terminal and type help.

enter image description here

More info on FDB here http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7ffb.html#WS2db454920e96a9e51e63e3d11c0bf62063-7ff3