User Guide

Creating the ActionScript class file 939
The InspectableList tag must immediately precede the class definition because it applies to the
entire class.
The following example allows the
flavorStr and colorStr properties to be displayed in the
Property inspector, but excludes other inspectable properties from the Parent class:
[InspectableList("flavorStr","colorStr")]
class BlackDot extends DotParent {
[Inspectable(defaultValue="strawberry")]
public var flavorStr:String;
[Inspectable(defaultValue="blue")]
public var colorStr:String;
...
}
About the Event tag
Use the Event tag to define events that the component emits.
This tag has the following syntax:
[Event("event_name")]
For example, the following code defines a click event:
[Event("click")]
Add the Event statements outside the class definition in the ActionScript file so that the events are
bound to the class and not a particular member of the class.
The following example shows the Event metadata for the UIObject class, which handles the
resize, move, and draw events:
...
import mx.events.UIEvent;
[Event("resize")]
[Event("move")]
[Event("draw")]
class mx.core.UIObject extends MovieClip {
...
}
To broadcast a particular instance, call the dispatchEvent() method. See “Using the
dispatchEvent() method” on page 948.
About the Bindable tag
Data binding connects components to each other. You achieve visual data binding through the
Bindings tab of the Component inspector. From there, you add, view, and remove bindings for a
component.
Although data binding works with any component, its main purpose is to connect user interface
components to external data sources, such as web services and XML documents. These data
sources are available as components with properties, which you can bind to other component
properties.