Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 56

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

Advertisement

You insert the
[Effect]
the
block in an MXML file. The
<mx:Metadata>
syntax:
[Effect(name="eventNameEffect", event="eventName")]
The following table describes the properties of the [
Property
Type
eventNameEffect
String
eventName
String
The
metadata tag is often paired with an
[Effect]
metadata tag defines the event corresponding to the effect's trigger. By convention,
[Event]
the name of the effect is the event name with the suffix
an ActionScript file shows:
// Define event corresponding to the effect trigger.
[Event(name="darken", type="flash.events.Event")]
// Define the effect.
[Effect(name="darkenEffect", event="darken")]
class ModalText extends TextArea {
...
}
In an MXML file, you can define the event and effect in an
following example shows:
<mx:Metadata>
[Event(name="darken", type="flash.events.Event")]
[Effect(name="darkenEffect", event="darken")]
</mx:Metadata>
Event metadata tag
Use the
metadata tag to define the MXML property for an event and the data type of
[Event]
the event object that a component emits. You insert the
definition in an ActionScript file, or in the
For more information on defining custom events, see
on page
35.
The
metadata tag has the following syntax:
[Event]
[Event(name="eventName", type="package.eventType")]
56
Using Metadata Tags in Custom Components
metadata tag before the class definition in an ActionScript file, or in
Description
Specifies the name of the effect.
Specifies the name of the event that triggers the effect.
<mx:Metadata>
metadata tag has the following
[Effect]
metadata tag:
Effect]
metadata tag, where the
[Event]
, as the following example of
Effect
<mx:Metadata>
metadata tag before the class
[Event]
block in an MXML file.
Chapter 4, "Creating Custom Events,"
block, as the

Advertisement

Table of Contents
loading

Table of Contents