MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual page 63

Developing flex components and themes in flash authoring
Table of Contents

Advertisement

The following example identifies the
can dispatch:
[Event("myClickEvent")]
If you do not identify an event in the class file with the
ignores the event during compilation, and Flex ignores this event triggered by the component
during runtime. The metadata for events is inherited from the parent class, however, so you do
not need to tag events that are already tagged with the
class.
The following example shows the
,
, and
resize
move
draw
...
[Event("resize")]
[Event("move")]
[Event("draw")]
class mx.core.UIObject extends MovieClip {
...
}
Inspectable
You specify the user-editable (or inspectable) parameters of a component in the class definition for
the component using the
appears in the Component inspector of the Flash user interface.
Prior to the availability of this metadata keyword, you had to define the property in the
ActionScript class file and in the Component inspector, which introduced the possibility of errors
because the property was defined in multiple locations. Now, you define the property only once.
The
metadata statement must immediately precede the property's variable
Inspectable
declaration to be bound to that property.
The
metadata keyword has the following syntax:
Inspectable
[Inspectable(value_type=value[,option=value,...])]
property_declaration name:type;
The following table describes the options of the
Option
Type
String
category
String or
defaultValue
Number
String
enumeration
myClickEvent
metadata for the UIObject class, which handles the
Event
events:
metadata keyword. If you tag a property as inspectable, it
Inspectable
Description
(Optional) Groups the property into a specific subcategory in the
Property inspector of the Flash user interface.
(Required) Defines the default value for the inspectable property.
This property is required if used in a getter or setter function. The
default value is determined from the property definition.
(Optional) Specifies a comma-delimited list of legal values for the
property. Only these values are allowed; for example,
.
item3
event as an event that the component
metadata keyword, the compiler
Event
metadata keyword in the parent
Event
metadata keyword:
Inspectable
Writing the component's ActionScript code
,
,
item1
item2
63

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX - DEVELOPING COMPONENTS AND THEMES and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents