<< Chapter < Page | Chapter >> Page > |
I recommend that you also study the other lessons in my extensive collection of online programming tutorials. You will find a consolidated index at www.DickBaldwin.com .
According to Using Behaviors ,
"Behaviors let you add animation and motion to your application in response to user or programmatic action. For example, you can use behaviorsto cause a dialog box to bounce slightly when it receives focus, or to slowly fade in when it becomes visible."
You program behaviors into your applications using MXML, ActionScript, triggers, and effects.
According to About behaviors ,
"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 componentgetting 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."
Triggers are not events
Triggers are caused by events, but triggers are different from events. For example, the trigger named mouseDownEffect results from the occurrence of a mouseDown event.
If an Effect object, such as a Glow effect has been associated with a mouseDownEffect trigger for a given target component, the Glow effect will be played when the user presses the mouse button while the mouse pointer is over the target component.This will be true regardless of whether or not a mouseDown event listener is registered on the component.
Thirteen standard triggers in Flex Builder 3
The UIComponent class lists thirteen triggers :
Effects are subclasses of the Effect class
Effects are subclasses of the Effect class a couple of levels down the inheritance hierarchy. Flex Builder 3provides a number of built-in effects including the following:
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with actionscript' conversation and receive update notifications?