Using ANT to compile Flex files

Hi All,

The below example will show how to use ANT to compile Flex files to generate .SWF files.

Step 1: Install FLEX SDK3.1   e.g   c:/flex3.1

Step 2: Create a build.xml    e.g. build.xml

Step 3: Add the below ant task defination  in the Build.xml
<taskdef resource=”flexTasks.tasks” classpath=”c:/flex3.1/ant/lib/flexTasks.jar”/>

Step 4: Crate an Ant Task
<target name=”compileFlex”>
<mxmlc file=”/flex/src/Index.mxml”
<load-config filename=”c:/flex3.1/frameworks/flex-config.xml”/>
<compiler.library-path dir=”lib/swc” append=”true”>
<include name=”*.swc” />




R Vashi.

2 thoughts on “Using ANT to compile Flex files

  1. Rakesh

    Can we do this without installing the Flex SDK ? I have only the Flex Builder 3.0 installed in my machine.

    1. ®V Post author

      Hi Rakesh,

      Flex SDK is required. But if you have Flex 3.0 installed then you can use the SDK from there which comes with Flex builder.

      You can find it in the below Home location of Flex Builder
      C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0

      R Vashi.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.