Many developers use just the mxmlc compiler of the Flex SDK to compile their Flex/ActionScript 3.0 projects.
My personal basic work flow is FlashDevelop or notepad for code editing and the SDK for compiling.
I made a little video on the basics of using the mxmlc compiler from the command prompt in windows, you can find that here: simpleflvplayer example
(that example is of an flv player, and the video it plays is about using the mxmlc compiler)
Having to open the command prompt and type everything each time can be tedious. Especially if you need to compile multiple SWFs or assets together to form one final application. But on windows there is a very simple way to automate the command prompt.
Just use a bit of JavaScript and the Windows Based Script Host.
Say for instance we need to always compile a SWC file, then compile a SWF using that SWC file.
Instead of having to open the command prompt each time and first type out the commands to compile the SWC, compile it, then type out the commands to compile the SWF and compile it. We can just make a little JavaScript file that will run the command prompt with whatever commands we want.
/* two backslashes are used in the commands because we want to be sure
it knows we need a backslash and not, for instance, \t or \r */
var compileSWC = "compc -include-sources c:\\yourPath\\theSwcSourcesFolder -output c:\\yourPath\\theSWC.swc";
var compileSWF = "mxmlc.exe -include-libraries c:\\yourPath\\theSWC.swc -file-specs c:\\yourPath\\MainApp.as";
var shell = new ActiveXObject("WScript.shell");
shell.run("cmd.exe /k cd/Flex SDK Location/bin &"+compileSWC+"&"+compileSWF+"", 1, true);
shell.Quit;
The above would be saved as a .js file.
The shell.run command is used to run a Windows program.
In this case we open the command prompt and give it some commands.
The /k starts the commands.
Change directory (cd) to the Flex SDK bin directory
(wherever that is on your computer)
The ampersand (&) signifies another command.
Since our commands are somewhat long, we put them in variables and just plug those variables in.
A command to compile the SWC file, then the next command to compile the SWF, which uses that SWC.
In Windows Vista or better you should be able to right click on the .js file and select Open With, then Windows Based Script Host. (System32/wscript.exe)
It will run the JavaScript, which will open the command prompt and run the commands in order. When it is done you will need to close the command prompt.
And now you have a quick and easy way to recompile your project without having to retype everything!
Thank you for this info it will speed up my development process. Also, did you know you can have the script also auto open the swf after it compiles it?