MACROMEDIA FLEX BUILDER-USING FLEX BUILDER Use Manual page 111

Table of Contents

Advertisement

To trigger effects from other components:
In Design view, select the component that will have the effect.
1.
In the Attributes panel (Window > Tag Inspector), make sure an ID value is specified for the
2.
component.
If the component doesn't have an ID, you can't trigger the effect from another component.
Select an effect for any of the following effect properties in the Attributes panel: showEffect,
3.
hideEffect, moveEffect, or resizeEffect.
A dialog box appears asking if you'd like help setting a trigger for this effect. Click Yes.
The Insert Trigger Effect dialog box appears listing the current file and any files included from
the current file.
Select the file in which you want to insert the ActionScript function for triggering the effect.
4.
Flex Builder inserts an ActionScript function in the specified file. The function is designed to
trigger the event when an event occurs in another component in the file.
In Code view, find the component that will trigger the effect and specify the newly inserted
5.
function as an event handler.
For example, if you apply a WipeLeft hideEffect to a Label called lblHello, Flex Builder inserts
the following ActionScript function:
function triggerHideEffectlblHello()
{
// if lblHello is visible, this triggers the hideEffect on lblHello.
lblHello.visible = false;
}
If you want the effect to be triggered when users click a certain button, locate the Button tag in
the code and specify the function name (including the parentheses) as its
follows:
<mx:Button id="triggerButton" click="triggerHideEffectlblHello()" />
For more information, see "Applying an effect in ActionScript" in Developing Flex
Applications Help.
Related topics
"Adding an effect to a component" on page 109
click
Applying effects to Flex components
property, as
111

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex builder

Table of Contents