Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 57

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

Advertisement

The following table describes the properties of the [
Property Type
String
eventName
String
eventType
The following example identifies the
can dispatch:
[Event(name="myClickEvent", type="flash.events.Event")]
If you do not identify an event in the class file with the
compiler generates an error if you try to use the event name in MXML. Any component can
register an event listener for the event in ActionScript by using the
method, even if you omit the
The following example identifies the
component can dispatch:
[Event(name="myEnableEvent", type="flash.events.Event")]
public class MyComponent extends UIComponent
{
...
}
The following example shows the
MXML file:
<?xml version="1.0"?>
<!-- TextAreaEnabled.mxml -->
<mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Metadata>
[Event(name="myEnableEvent", type="flash.events.Event")]
</mx:Metadata>
....
</mx:TextArea>
IconFile metadata tag
Use the
[IconFile]
component in the Insert bar of Flex Builder.
Description
Specifies the name of the event, including its package name.
Specifies the class that defines the data type of the event object. The
class name is either the base event class, Event, or a subclass of the
Event class.
myClickEvent
metadata tag.
[Event]
myClickEvent
[Event]
metadata tag to identify the filename for the icon that represents the
metadata tag:
Event]
event as an event that the component
[Event]
event as an event that an ActionScript
metadata tag in the
<mx:Metadata>
metadata tag, the MXML
addEventListener()
tag in an
Metadata tags
57

Advertisement

Table of Contents
loading

Table of Contents