Building Applications
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 sections discuss how to compile using the mxmlc
compiler. If you’re using Flex Builder,
you may want to skip directly to Compiling Using Flex Builder” later in this chapter, although
it is always good to know about mxmlc
,
especially if you intend to use Ant or any build tool.
Compiling Using mxmlc
The 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). The compiler flags we’ll
look at from the command line also apply to any other use of the
compiler.
Configuring for Windows
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 My Computer from the desktop or from the Start menu, ...
Get Programming Flex 3 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.