User Guide
936 Chapter 7: Creating Components
Metadata is associated with a class declaration or an individual data field. If the value of an
attribute is of type String, you must enclose that attribute in quotation marks.
Metadata statements are bound to the next line of the ActionScript file. When defining a
component property, add the metadata tag on the line before the property declaration. The only
exception is the Event metadata tag. When defining component events, add the metadata tag
outside the class definition so that the event is bound to the entire class.
In the following example, the Inspectable tags apply to the
flavorStr, colorStr, and shapeStr
parameters:
[Inspectable(defaultValue="strawberry")]
public var flavorStr:String;
[Inspectable(defaultValue="blue")]
public var colorStr:String;
[Inspectable(defaultValue="circular")]
public var shapeStr:String;
In the Property inspector and the Parameters tab of the Component inspector, Flash displays all
of these parameters as type String.
Metadata tags
The following table describes the metadata tags you can use in ActionScript class files:
The following sections describe the component metadata tags in more detail.
Tag Description
Inspectable Exposes a property in the Component inspector and Property inspector. See
“About the Inspectable tag” on page 937.
InspectableList Identifies which subset of inspectable properties should be listed in the
Property inspector and Component inspector. If you don't add an
InspectableList attribute to your component's class, all inspectable
parameters appear in the Property inspector. See “About the InspectableList
tag” on page 938.
Event Defines a component event. See “About the Event tag” on page 939.
Bindable Reveals a property in the Bindings tab of the Component inspector. See
“About the Bindable tag” on page 939.
ChangeEvent Identifies a event that cause data binding to occur. See “About the
ChangeEvent tag” on page 941.
Collection Identifies a
collection attribute exposed in the Component inspector. See
“About the Collection tag” on page 942.
IconFile Specifies the filename for the icon that represents this component in the
Components panel. See “About the IconFile tag” on page 943.