Datasheet

9
Adobe Flex 2
ActionScript 3.0
ActionScript is the object-oriented programming language used for Flex development. Like
JavaScript, ActionScript 3.0 is an implementation of ECMAScript, the international standardized
programming language for scripting. However, because it is an implementation of the latest
ECMAScript proposal, ActionScript provides many capabilities not common in the versions of
JavaScript supported by most browsers. At development time, ActionScript 3.0 adds support for
strong typing, interfaces, delegation, namespaces, error handling, and ECMAScript for XML (E4X).
At runtime, the most signicant dierence between JavaScript and ActionScript is that ActionScript
is just-in-time compiled to native machine code by Flash Player. As a result, it can provide much
higher performance and more ecient memory management than interpreted JavaScript.
Flex developers use ActionScript to write client-side logic, such as event listeners and call-back
functions, or to dene custom types for the client application. For example, the following code
shows the denition of the Customer class.
Customer.as
public class Customer {
private var _ id:int;
private var _ firstName:String;
private var _ lastName:String;
private var _ mobilePhone:String;
private var _ officePhone:String;
...
public function get id ():int {
return _ id;
}
}
Flex class library
Flex includes a rich class library that contains Flex components (containers and controls), data
binding, behaviors, and other features.
Beyond providing a set of built-in capabilities (described in the following subsections), Flex
components follow a consistent cross-platform experience model based on user interface design best
practices. As a result, developers can deliver professional-looking applications that delight users
without the active involvement of a graphic designer.
Where a custom look and feel is desired, designers can easily customize components through an
extensive set of CSS-based styles. In addition, users can create custom skins using industry-standard
tools such as Photoshop, Illustrator, and Flash Professional. As with built-in styles, custom skin
properties are set using CSS properties.
1 Visual components
e component-based model eases the creation of Flex applications. Developers can use the
prebuilt components included with Flex, extend components to add new properties and
methods, and create new components.
e Flex class library supplies two types of visual components: containers and controls. When
developers build an application using Flex, they describe its user interface with controls and
containers. Controls are user interface components that handle user interactions and display
data that users can manipulate directly through that control. Examples of controls are the
DataGrid and the TreeControl. A container denes a region of the Flash Player drawing
surface and controls the layout for everything in the container, including other containers
and controls. Examples of containers are a data entry Form container, a Box, and a Grid.