User Guide

Creating the ActionScript class file 155
The Bindable tag takes three options that specify the type of access to the property, as well as
the data type of that property. The following table describes these options:
All properties of all components can participate in data binding. The Bindable tag merely
controls which of those properties are available for binding in the Component inspector. If a
property is not preceded by the Bindable tag, you can still use it for data binding, but you
have to create the bindings using ActionScript.
The Bindable tag is required when you use the ChangeEvent tag.
For information on creating data binding in the Flash authoring environment, see “Data
binding (Flash Professional only)” in Using Flash.
Option Description
readonly
Indicates that when you create bindings in the Component inspector, you
can only create bindings that use this property as a source. However, if
you use ActionScript to create bindings, there is no such restriction.
[Bindable("readonly")]
writeonly
Indicates that when you create bindings in the Component inspector, this
property can only be used as the destination of a binding. However, if you
use ActionScript to create bindings, there is no such restriction.
[Bindable("writeonly")]
type="datatype"
Indicates the type that data binding uses for the property. The rest of Flash
uses the declared type.
If you do not specify this option, data binding uses the property’s data type
as declared in the ActionScript code.
In the following example, data binding will treat
x as type DataProvider,
even though it is really type Object:
[Bindable(type="DataProvider")]
var x: Object;