Despite appearances it’s very easy. All you need is Flex SDK which is available for download on Adobe site. There are sufficient tools in this SDK to compile ActionScript 3 code into single SWF file. Furthermore there is no problem to embed resource files (MP3, PNG) with it. I assume that you have Linux operating system and you are familiar with using the terminal. Obviously you have to know ActionScript 3 basics at least.
Create directories for sdk, projects and scripts
Download Flex SDK (latest version is 4.6). You can find it here Unzip it into sdk directory
For convinient work add some paths to shell rc script. Example for bash
Untar Flash Player
Reload shell rc script
Create a directory for test code and file named Main.as in there. Fill it with sample code I provide below. For now you can just use your favorite text editor as EDITOR but in the future I will show you how to fit vim for comfortable work with ActionScript.
For now we are ready to compile test code
During compilation you will get warning
If you don’t want to see this warning just add option to compilation
Anyway if there weren’t errors, file named Main.swf should appear in the Test folder. You can run it by command
The result should be Adobe Flash Player window running Main.swf file and there will be blue rectangle on white background. As you can see the compilation isn’t very fast and each recompilation of the same code (or with small changes) takes the same time. In the next post I will show you how to speed up this process by using fcsh shell with fcshc script.