Chapter 2. Building Applications with the Flex Framework

The majority of this book is dedicated to programming Flex applications, with detailed discussions of working with MXML and ActionScript. However, to meaningfully use most of what we discuss in the chapters that follow, you’ll need to know how to create a Flex project, how to compile the project, and how to deploy that project so that you can view it.

In this chapter, we’ll discuss important topics like the tools needed to create Flex applications and how to create new projects for Flex applications. We’ll look at elements comprising a Flex project and discuss compiling and deploying Flex applications.

Using Flex Tool Sets

To work with Flex and build Flex applications, you’ll need tools. At a minimum, you must have a compiler capable of converting all your source files and assets into the formats necessary to deploy the application. That means you need to be able to compile MXML and ActionScript files into an .swf file.

There are two primary tools you can use that include the necessary compilers:

  • The Flex Software Development Kit (SDK)

  • Flex Builder 3

The Flex SDK is a free product that includes the entire Fl`ex framework as well as the mxmlc and compc compilers (see Building Applications later in this chapter for more details on the compilers). Download the SDK at http://www.adobe.com/products/flex/flexdownloads/.

Flex Builder 3 is a professional IDE designed for Flex development, and it too includes the mxmlc and compc compilers. You can download a trial version of Flex Builder 3 or purchase a license at http://www.adobe.com/go/flex.

Note

Flex Builder includes the entire copy of the SDK. Beginning with Flex Builder 3, it contains support for targeting different versions of the SDK. You can find the different versions of the SDK in <Flex Builder Install Folder>sdks.

You can work with Flex Builder 3 in two ways: as a standalone application and as a plug-in for Eclipse. The standalone version of Flex Builder 3 is built on Eclipse, so it and the plug-in version are essentially equivalent. The primary differences are:

  • Flex Builder 3 standalone does not require that you already have Eclipse installed, making it an optimal solution for those who have no other use for Eclipse. On the other hand, if you already use Eclipse, or if you intend to use Eclipse for other purposes, the standalone version would essentially require you to have two installations of Eclipse—one running Flex Builder and one standard installation. If you use or plan to use Eclipse for other reasons, you should definitely install the plug-in version of Flex Builder 3.

  • The standalone version disables Java Development Tools (JDT), a plug-in used by some standard Eclipse features such as Ant. If you want to use JDT, you should install the plug-in version of Flex Builder 3.

Note

Since Flex Builder is built on Eclipse, you can use any third-party Eclipse plug-ins with the standalone version of Flex Builder.

Many factors might drive your decision as to whether to use the Flex SDK or Flex Builder 3. The following is a list of just a few to consider:

Price

The Flex SDK is a free product. It includes the entire Flex framework. Flex Builder 3, on the other hand, is a commercial product. There is no difference in price between the standalone and plug-in versions of Flex Builder 3.

Commitment to an existing IDE

If you already have a considerable investment in an IDE in terms of time and resources, and if that IDE works very well for you, you may want to integrate the Flex SDK with your existing IDE. On the other hand, if you’re already using Eclipse, consider that you can install the Flex Builder 3 plug-in for an existing installation of Eclipse.

Debugging capabilities

The Flex SDK includes a command-line debugger. However, Flex Builder 3 includes an integrated debugger that allows you to set breakpoints and step through code, all from within your IDE.

Efficiency

Unless and until other IDEs have increased support for Flex (ActionScript and MXML), Flex Builder is the fastest way to build Flex applications. With its built-in code hinting, code completion, error detection, and debugging capabilities, Flex Builder is far superior to the SDK for serious Flex application developers.

The majority of the content of this book is not dependent on any one tool. Much of our focus is on working with the Flex framework and ActionScript 3.0 and will require only the Flex SDK. When there are specific topics that do have dependencies on a particular tool, we make that clear. For example, in this chapter we discuss the differences between configuring a Flex Builder project versus a Flex SDK project.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset