how do I compile Flash .FLAs using command line?
I am using Eclipse + FDT for Flash development and I would like to use ANT to automatize the compilation.
I am using AS3 and need to compile for Flash Player 10.1.
Many thanks
Update: I need to compile .FLAs because that's what I get from our designers.
To sum up what might not be apparent in the other answers: FLA files are not exactly "source", but more like project files for the Flash authoring tool, and the only thing that knows how to compile them is that tool. If you have Flash Professional and it's open, it's possible for other tools (or the command line) to tell it to compile, but that's the best you can do unless you change your workflow somehow - such as by getting something other than FLAs from your designers, or by you giving scripts, SWCs, etc. to the designers for them to import and compile.
With that said, in the most recent version Adobe has changed FLA files from what they used to be (a gory binary memory dump of the authoring tool) into a much more accessible zipped folder full of XML and images and so forth, so in the future it should become feasible for 3rd party tools to do something useful with FLAs. But at the moment, the format of said XML is apparently not stable yet, and I haven't heard of any other tools starting to process FLAs yet.
In the flex sdk folder, there is a ant/lib/flexTasks.jar that can be used with ant to easily build flex applications.
<?xml version="1.0" encoding="utf-8"?>
<!-- build.xml -->
<project name="My App Builder" basedir=".">
<property name="FLEX_HOME" value="C:/flex/sdk"/>
<taskdef resource="flexTasks.tasks"
classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
<property name="APP_ROOT" value="myApp"/>
<target name="main">
<mxmlc file="${APP_ROOT}/Main.mxml" keep-generated-actionscript="true">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
</mxmlc>
</target>
</project>
EDIT
The FLA format is kind of monolithic and hard to merge. Of course, you can tell your designers to export the FLA as a SWF file from the authoring tool or even from the from the command line.
But if you are adding AS3 scripting and merging several FLA files together, you may want to rethink your pipeline. Perhaps designers should be giving you MXML files. MXML is an XML markup language that you use to lay out user interface components. Then build your SWF from the command line using images, MXML, and AS files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With