What is your technical background Austin? If you are coming from a pure art background then it may be a little more difficult to explain everything you need.
First, you need to download the Flex SDK. When you uncompress the directory you get from the download you will see a folder bin
. Inside the bin are a number of executables that can be used to compile Flex. The one you want is called mxmlc
. You can link that into your /usr/local/bin or just add the folder to your PATH.
If you create a simple file:
package
{
import flash.display.Sprite;
public class TestSWF extends Sprite
{
public function TestSWF()
{
}
}
}
save it anywhere (I'll use /tmp/flash/) as TestSWF.as
From the Terminal command prompt type:
mxmlc TestSWF.as
You'll see the output:
Loading configuration file ......
/private/tmp/flash/TestSWF.swf (561 bytes)
To compile another file create another directory:
mkdir model
Make a new file in that new model directory called TestModel.as
package model
{
import flash.display.Sprite;
public class TestModel extends Sprite
{
public function TestModel()
{
}
}
}
Note how the package definition has the name model
and the directory name is also model. That is how packages work. The package name matches the directory name. If you go deeper into directories (e.g. model/helper/FileLoader.as) then the package name switches the directory /
for a period (e.g. import model.helper.FileLoader)
Change TestSWF to be:
package
{
import flash.display.Sprite;
import model.TestModel;
public class TestSWF extends Sprite
{
public function TestSWF()
{
var model:TestModel = new TestModel();
}
}
}
once again run:
mxmlc TestSWF.as
You'll see the output:
Loading configuration file ......
/private/tmp/flash/TestSWF.swf (561 bytes)
mxmlc will automatically find the class model.TestModel because it by default includes the main files root directory in the class path.
This is the most basic possible way to compile files. It will serve for testing, playing around and very small projects. If you plan to develop professionally or very large projects I suggest using a better IDE (e.g. Flex Builder) or at least a decent build system (e.g. ant). The main advantage to Flex Builder or other Flex specific IDE's is that they hide a lot of the complexity that is normal when building/compiling software.