The Flex compiler (mxmlc
) is one of the most important parts of the Flex SDK. You can edit AS3 code in any text editor you like. Create a main class file that extends from DisplayObject
.
You can trigger builds at the command line as follows:
mxmlc -source-path="." -default-size [width in pixels] [height in pixels] -default-frame-rate [fps] -o "outputPath.swf" "mainClass.as"
If you need to compile a Flash project (as opposed to Flex) you can add a reference to the Flash library as follows (you'll need to have the Adobe Animate IDE installed):
mxmlc -source-path="." -library-path+="/Applications/Adobe Animate CC 2015.2/Adobe Animate CC 2015.2.app/Contents/Common/Configuration/ActionScript 3.0/libs" -static-link-runtime-shared-libraries=true -default-size [width in pixels] [height in pixels] -default-frame-rate [fps] -o "outputPath.swf" "mainClass.as"
Or on Windows:
mxmlc -source-path="." -library-path+="C:\Program Files\Adobe\Adobe Animate CC 2015.2\Common\Configuration\ActionScript 3.0\libs" -static-link-runtime-shared-libraries=true -default-size [width in pixels] [height in pixels] -default-frame-rate [fps] -o "outputPath.swf" "mainClass.as"