Using the Flex 2 Framework


Flex uses two programming languages: MXML and ActionScript.


MXML is unique to Flex and designed specifically to describe properties in Flex layouts, though it’s not limited to describing visual objects. MXML is an extension of XML, where each tag represents a different Flex component. You can nest components inside each other to provide a variety of different layout and interface options. Other nonvisual components, such as web services interfaces, transitions, and style sheet specifications can also be written in MXML.

ActionScript 3.0

ActionScript 3.0 is a rich and robust programming language useful for complex data manipulation. It’s the latest version of the Flash Player’s ActionScript language, which was originally based on the ECMA Script 1 specifications for scripting languages and resembled JavaScript. The current implementation has come a long way, and looks much more like Java than JavaScript.

You can write ActionScript 3.0 methods to process data, react to events, perform transitions, or even draw shapes and components on the screen. It’s customarily implemented to enhance the functionality of MXML components.

ActionScript and MXML work very nicely together. While all Flex applications must begin with at least a single MXML file, ActionScript can be nested within MXML components or imported from separate files. In the intended implementation, MXML provides the structure and organization in an application, while ActionScript provides access ...

Get Flex Early Evaluation: Assessing Flex and Your Project Needs 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.