Chapter 30. A Minimal MXML Application

In Chapter 20, we learned that the Flex framework includes a sophisticated collection of customizable components for creating user interfaces. The Flex framework’s user interface components are typically used with MXML-based applications, but can also be used in applications written primarily in ActionScript. For the benefit of readers who do not wish to use MXML, this chapter describes the bare minimum steps required to use the Flex framework’s UI components in a Flex Builder 2 project, with as little MXML as possible.

For the record, this chapter has nothing against MXML. In general, MXML is an excellent tool for creating standardized interfaces deployed to the Flash platform. This chapter simply caters to situations where either an application’s layout is entirely programmatically generated or where the developer does not have the time or interest to learn MXML.

For complete information on MXML and the Flex framework, see Adobe’s documentation and O’Reilly’s Programming Flex 2 (Kazoun and Lott, 2007).

Tip

Users of the Flash authoring tool should note that Flash CS3 includes its own set of user interface components in the package fl. The Flash CS3 components can also be used (both technically and legally) in ActionScript programs compiled with Flex Builder 2 or mxmlc.

The General Approach

Here are the minimal steps for creating an application that uses the Flex framework’s UI components via ActionScript:

  1. In Flex Builder 2, create a Flex project. ...

Get Essential ActionScript 3.0 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.