As anyone who knows me would tell you, I live by the command line, so I thought I would share an old trick to compile as3 applications from the command line in bash.
The trick here is to use the Flex SDK compiler which is available free from Adobe. It also requires having installed java, which is so common on most machines that I won't talk about installation.
The setup process is fairly simple:
- Grab Flex SDK: http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK
- Extract to a location, eg:
- Make executable:
chmod +x ~/.flex/bin/compc ~/.flex/bin/mxmlc
- Add the location to your path in .bashrc:
Once that's done you should be able to type
mxmlc into the command line and see an error stating you must specify a target file. To compile an as3 file simply use the following:
- mxmlc main-app-file.as -o output.swf
Additionally I compile my libraries to my-libs.swc by doing the following:
- compc -source-path . -include-sources . -output my-libs.swc
Since this is a flex compile you can also use flex syntax in your actionscript to embed resources in the code. Most commonly I use the swf definition line below to simply definite the frame rate and dimensions of the compiled output.
- [SWF(width='990',height='680',backgroundColor='0x000000', frameRate='30')]
Now to use Flash CS3's V3 Components see this post: moock.org
Additionally there are Eclipse tools for actionscript: the rasx() context