Datasheet
10
Adobe Flex 2
Flex components are extremely exible and provide developers with a great deal of control over
the component’s appearance, how the component reacts to user interactions, the font and font
size of any text included in the component, the size of the component in the application, and
more. Flex components support the following characteristics:
•
Events—Application or user actions that require a component response
•
Behaviors—Visible or audible changes to the component triggered by an application or
user action.
•
Skins—Symbols that control a component’s appearance
•
Styles—Set of characteristics, such as font, font size, and text alignment
•
Size—Height and width of a component (all components have a default size)
Developers can control these characteristics at development time through MXML or CSS, or at
runtime through the component’s ActionScript API, including creating or destroying instances
of a component based on application data or user interaction.
2 Service components
e Flex service components and underlying Flash Player enable applications to access data from
a wide variety of resources. e Flex class library includes built-in classes for calling SOAP-based
web services and and for loading XML or other data via HTTP. Developers can also take
advantage of custom protocols by leveraging support for binary sockets in Flash Player or
by loading data from the host browser. Using Flex Data Services, developers can also make
remote API calls to Java objects or subscribe to real-time message queues and data services
(see “Flex Data Services” for more detail).
Once retrieved, data in a Flex application can be managed as a typed variable, an array of objects,
as native XML (using E4X), or as an instance of the Collection class. e Collection class simplies
development of data-driven applications by automatically keeping track of changes to the data so
that they can be sent to the remote server when the application is ready to synchronize.
Flex also provides a mechanism for binding data objects to visual controls so that the user
interface is automatically updated when the underlying data is changed, either as a result of logic
running on the client or of changes sent from a remote server. Data binding can be set up
declaratively in MXML or programmatically in ActionScript.
3 Flex behaviors
e Flex class library also provides prebuilt behaviors that enable developers to easily add motion
and sound to their application to give users context for their actions. For example, a developer
can use behaviors to cause a dialog box to bounce slightly when it receives focus or animate a user-
selected item to illustrate the transition from a master view to a detail view.
A behavior is a combination of a trigger paired with an eect. A trigger is an action, such as a mouse
click on a component, or a component becoming visible. ese are typically exposed as events.
An eect is a visible change to the component occurring over a period of time, measured in
milliseconds. Examples of built-in Flex eects are fade, move, resize, or pause. Developers can
dene their own eects using ActionScript or composite multiple built-in eects together to meet
their application needs. Eects can be applied to individual components or containers.










