Flex 3 provides a new approach to building SWF applications that run with Flash
Player 9. Like Flash before it, the Flex framework creates SWF files, but there’s a
world of difference between the two products. If you’ve worked with version 1 of
Flex, versions 2 and 3 are a major revamp, so you’ll need to forget what you already
know and be prepared to start again.
For developers who’ve worked with Flash previously, Flex 3 introduces a wide range
of new possibilities. It provides a development environment specifically suited to creating
SWF-based applications, and it shifts the focus from animation to creating user
interfaces and interactions. Developers who’ve worked with tools such as Visual
Studio .NET will find it easy to adapt to the changes because the development environment,
Flex Builder 3, uses a very similar approach.
Instead of creating keyframes in a timeline, Flex applications use an XML vocabulary
called MXML to describe the components that make up the user interface. Each
MXML tag corresponds to an ActionScript 3.0 class, and developers can access the
methods, properties, and events of each class through attributes of the tag.
Developers can also use ActionScript 3.0 to create and wire up these user interface
components to respond to user interactions.
ActionScript 3.0 represents a major overhaul of the ActionScript language to provide
a more standards-based and robust approach. The new version is compliant with the
ECMAScript Language Specification, Third Edition (ECMA-262). Developers with a solid grounding in ActionScript won’t find it too hard to make the transition, but there are some major
differences. I’ll cover some of the most important changes to the ActionScript language a little later in
the chapter.
This chapter introduces you to the role of Flex in web application development and provides you with
some of the key concepts you’ll need to get started. I’ll explain the role of ActionScript 3.0 and of
MXML, and provide an introduction to each. I’ll give you an overview of the new features in the
ActionScript 3.0 language as well as introducing some of the new classes.
I also want to explain the different ways to work with data in Flex applications: the types of datadriven
applications, the types of data that you can include in them, and the tools in the Flex framework
that are specific to working with data-driven applications. I’ll finish up with some useful
resources for learning more about Flex.