Compiling Flex without Flash Builder

Hope you have some knowledge about Flex, if not please have a look at this.

Flex applications can be compiled using mxmlc compiler that is part of the Flex SDK, located in the bin folder of course.

Just create an MXML file, go to command prompt. Set the path to the bin folder of the Flex SDK. Type

mxmlc filename.mxml

This will compile the input mxml file to the desired swf file. But it will display warnings like

Required RSLs: with 1 failover. with 1 failover. with 1 failover. with 1 failover. with 1 failover.

To avoid this either you have to specify the RSL path, or link it statically with the compiler flag. Now type

mxmlc -static-link-runtime-shared-libraries=true filename.mxml 

This will generate an swf file, which can be opened using Adobe Flash Player or any browser that has the Flash player plugin. More details about RSLs and their linking can be found in the Adobe Flex website.

The command is bit longer to type each time. You can write a simple batch file to automate the work. I wrote the below shown batch file and copied to my System32 directory. The file is,

Saving the path and reusing it allows to compile multiple times without the need to reopen the command prompt. This file will take the input mxml file as argument. I am not insisting to use the same file for your compilation, just have this one as reference and build your own. Also, a build.mxml can also be used to build the project, for that you need Apache Ant.

Suggestions to this blog are most welcome. If you face any issues with the steps above, just drop a comment.

See also Hello World In FlexIPv4 Validator in FlexCalculator in Flex,  Simple Animation in FlexMastering Alert - FlexNativeProcess - AIR.


  1. Thanks for sharing this useful info. Keep updating same way.
    Regards,Siddu online Training

  2. Couldn't it be set up once and for all in the compiler config somewhere? (e.g. flex-config.xml perhaps?)

  3. This is really too useful and has more ideas from your blog. Keep sharing many techniques..........................Please contact us for Oracle Fusion SCM Training details in our Erptree Training Institute