Assigning Event Handlers To Components - MACROMEDIA FLEX BUILDER-USING FLEX BUILDER Use Manual

Table of Contents

Advertisement

Click the pencil icon beside the effect name.
3.
Flex Builder performs the following tasks:
Switches to Split view and selects the custom effect tag in the code
Shows the properties of the custom effect in the Tag inspector.
Set the properties of the custom effect tag in the Attributes panel or in the code.
4.
For more information, see "Customizing an effect" in Developing Flex Applications Help.
Save the file.
5.
Related topics
"Customizing a standard Flex effect" on page 112
"About Flex effects" on page 109
"Adding an effect to a component" on page 109

Assigning event handlers to components

Flex applications are event-driven. An event is generated when the user interacts with the user
interface (with the mouse, for example), or when the application interacts with data. You can use
Flex Builder to specify an event handler to execute when a specific event occurs. Event handlers
include object methods such as ws.method.send(), and ActionScript functions.
To assign an event handler to a component:
If you want to use a custom event handler, define the event handler using ActionScript.
1.
You can write the ActionScript directly in the MXML file or in an external ActionScript file
that you include in the MXML file.
If the code for the event handler is short, you can include it as a property value in the
component tag. See step 3.
Select the component in the MXML file to call the event handler.
2.
For example, a Button component is commonly assigned a handler for the click event.
In the Events panel of the Tag inspector, select the event you want and enter one of the
3.
following in the value field:
An object method you want to run in response to the event.
A function call to the ActionScript event handler you defined or referenced elsewhere in the
MXML file.
An ActionScript statement or group of statements separated by semi-colons that can handle
the event.
If you want the event to invoke a Flex data service such as a web service, click the lightning bolt
4.
icon beside the event's value field and then select the data service and the method that invokes
it in the dialog box that appears.
For more information, see
service in the MXML file before you can select it in this dialog box. For more information, see
"Working with Flex data services" on page
114
Chapter 4: Building a Flex User Interface Visually
"Calling the data service" on page
136.
141. You must insert a Flex data

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX BUILDER-USING FLEX BUILDER and is the answer not in the manual?

This manual is also suitable for:

Flex builder

Table of Contents