Xml – Compiling flex modules into swf with other mxml files in ant

antapache-flexmodulemxml

I have a huge project with many mxml and as files and am trying to compile them all into one working swf file using ant. However, I'm having trouble compiling main.swf correctly in ant.

It doesn't seem to be pulling in the necessary modules, all of which are located in separate folders within the main src folder.

It will compile without error, but when I open the swf file, there is no content — just a shell. However, if I compile using flex builder 3's compile button, it will create the swf correctly — content and all.

Even when using a simple mxmlc command, it throws an error for any file associated with the modules saying there is an unknown type (meaning it's not pulling in the modules).

Is there a special way that modules should be dealt with when trying to compile them into a main.swf file using ant?

Best Answer

Did you include a library-path element in your Ant build file?

e.g.

<target ...>
    <mxmlc output="...../file.swf"
        ....
        file=".../main.mxml">

        <library-path dir="..../" append="true">
            <include name="...../someModule.swc"/>
Related Topic