Chapter 13. APPLYING BEHAVIORS, TRANSITIONS, AND FILTERS

Now that you’ve learned all of the most important skills for building applications in Flex, it’s time to have some fun. All Flex visual components have a standard set of graphic filters and effects that let you create really expressive applications with minimal effort. Effects are auditory or visual changes to components, typically an animation of some form. Filters are static visual changes such as blurring or drop-shadows. In this chapter, you’ll discover how incredibly easy it is to apply visual effects to your components with simple MXML.

Behaviors

All Flex visual components have a special set of behaviors built in. These behaviors let you easily add effects to your components, making really expressive applications quick and easy. They’re essentially limitless, but the most common effects create functionality like fading a component’s visibility in or out or showing the movement of a component from one place to another with an animation. Other common effects are sound effects, which are noises that can be played for certain events or actions.

Behaviors are really just an effect paired with a trigger, or an action that occurs in the application. This is typically from an event such as a mouse click, a mouse rollover, or some other event that a component dispatches, like when it’s created for the first time or when it’s hidden or shown.

Using Common Effects

To show how behaviors are implemented, let’s start with the PhotoGallery ...

Get Learning Flex 3 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.