Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 109

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

With simple MXML components, you can define event listeners in both places, and both
event listeners process the event. However, the event listeners defined within the component
execute before any listeners defined in the application.
Creating custom events
All MXML components can dispatch events, either those inherited by the components from
their superclasses, or new events that you define within your components. When you are
developing MXML components, you can add your own event types.
In this example, you define a new component called TextAreaEnabled.mxml that uses a
tag as its root tag. This component also defines a new property called
<mx:TextArea>
that users set to
enableTA
The setter method dispatches a new event type, called
variable changes. The
enableTA
compiler so that the file referencing the component can use the new property. For more
information on using the
in Custom Components," on page
The syntax for the
[Event]
<mx:Metadata>
[Event(name="eventName", type="eventType")]
</mx:Metadata>
to enable text input or to
true
metadata tag identifies the event to the MXML
[Event]
metadata keyword, see
[Event]
45.
metadata tag is as follows:
to disable input.
false
, when the value of the
enableChanged
Chapter 5, "Using Metadata Tags
Working with events
109

Advertisement

Table of Contents
loading

Table of Contents