O'Reilly logo

Programming Flex 2 by Joey Lott, Chafic Kazoun

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 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.

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). 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:

  1. Right-click on My Computer from the desktop or from the Start menu, and select Properties.

  2. Click on the Advanced tab, and then click the Environment Variables button.

  3. In ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required