开发者

How do I compile Flash .FLAs using command line?

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 Pla开发者_JAVA技巧yer 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're using FDT, you don't need to do anything. As long as the Flex SDK (compiler) location is known, it'll use it with the needed command line parameters - just create a launch profile and use it.

You only need ANT if you have advanced tasks you need to perform prior to compiling. And even in that case, you can set an ANT task with your commands to be ran before a launch profile runs instead of compiling within ANT.

Now, if you really need to compile from an ANT task, you use something like this...

<target name="web_compileDebug">
    <exec executable="${flexdir}/bin/mxmlc.exe" failonerror="true">
        <arg line="'./source/org/package/DocumentClass.as'"/>
        <arg line="-source-path './source'"/>
        <arg line="-default-frame-rate=60"/>
        <arg line="-default-background-color=0xFFFFFF"/>
        <arg line="-default-size 640 480"/>
        <arg line="-strict=true"/>
        <arg line="-warnings=true"/>
        <arg line="-debug=true"/>
        <arg line="-output './deploy/index.swf'"/>
        <arg line="-target-player=10.0.0"/>
        <arg line="-use-network=false"/>
    </exec>
</target>

Of course, replace that with your Flex SDK locations or variables.

If you mean to compile .FLA files, then of course that cannot be done by a normal command line - you need to use a JSFL script that fires Flash and compiles the file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜