Once you've created a project and written some code, you'll want to build the project, which means compiling it and deploying it. How you accomplish these tasks depends, in part, on what tools you're using. The following subsections discuss how to compile using the
mxmlc compiler. If you're using Flex Builder 2, you may want to skip directly to the section "Compiling Using Flex Builder" later in this chapter.
mxmlc compiler is used to compile Flex applications (versus
compc, which is used to compile components and libraries). When you use Flex Builder to compile, it automatically calls
mxmlc (Flex Builder includes the SDK).
There are several ways you can use
mxmlc, including from the command line, from a .bat or shell script, from an IDE, and from Apache Ant. Initially we'll look at using
mxmlc from the command line since it's the most basic way to use the compiler (though we'll also look at using the compiler via Apache Ant later in this chapter). All the compiler flags we'll look at from the command line also apply to any other use of the compiler.
When you want to work with
mxmlc from the command line, it's generally a good idea to make sure you add it to your system path. If you're running Windows and you're uncertain how to edit your system path, follow these steps:
Right-click on My Computer from the desktop or from the Start menu, and select Properties.
Click on the Advanced tab, and then click the Environment Variables button.