as3compile man page

as3compile — Compile .as ActionScript 3.0 files to swf.


as3compile [-o file.swf]


Compiles a file written in ActionScript 3.0 to a SWF file.


-h, --help

   Print short help message and exit

-V, --version

   Print version info and exit

-v, --verbose

   Increase verbosity

-q, --quiet

   Decrease verbosity

-C, --cgi

   Output to stdout (for use in CGI environments)

-R, --resolve

   This flag will cause the compiler to try filenames like "" for classes named "FooBar".

-D, --define namespace::variable

   Set a compile time variable (for doing conditional compilation)

-X, --width

   Set target SWF width

-Y, --height

   Set target SWF width

-r, --rate

   Set target SWF framerate

-M, --mainclass

   Set the name of the main class (extending flash.display.MovieClip)

-l, --library file

   Include library file file. <file> can be an .abc or .swf file.

-I, --include dir

   Add additional include dir dir.

-N, --local-with-network

   Make output file "local with networking"

-L, --local-with-filesystem

   Make output file "local with filesystem"

-T, --flashversion num

   num must be >= 9.

-o, --output filename

   Set output file to filename.


The following is a basic as3 file that can be compiled e.g.
with as3compile -X 400 -Y 400

    import flash.display.MovieClip

    public class Main extends MovieClip
        function Main()


Matthias Kramm <>


February 2012 as3compile swftools