
151
13
CHAPTER 13
Use Behaviors
Adobe Flex behaviors let you add animation and motion to your application in response to
user or programmatic action. A behavior is a combination of a trigger paired with an effect. A
trigger is an action, such as a mouse click on a component, a component getting focus, or a
component becoming visible. An effect is a visible or audible change to the target component
that occurs over a period of time, measured in milliseconds. Examples of effects are fading,
resizing, or moving a component.
This lesson shows you how to add behaviors to a Flex user interface. It shows you how to use
MXML to create behaviors, how to invoke an effect from a different component, and how to
combine more than one effect to create a composite effect.
In this lesson, you’ll complete the following tasks:
Set up your project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151
Create a behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Invoke an effect from a different component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Create a composite effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Set up your project
Before you begin this lesson, ensure that you perform the following tasks:
■ If you have not already done so, create the Lessons project in Adobe Flex Builder. For
more information, see “Create the Lessons project” on page 101.
■ Ensure that the automatic build option is enabled in Flex Builder. This option is enabled
by default in the standalone configuration of Flex Builder but not in the plug-in
configuration. To enable it, select Project > Build Automatically.
Comentários a estes Manuais