User Guide
154 Creating Components
To broadcast a particular instance, call the dispatchEvent() method. See “Using the
dispatchEvent() method” on page 166.
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.
Use the Bindable tag before a property in an ActionScript class to make the property appear in
the Bindings tab in the Component inspector. You can declare a property by using
var or
getter/setter methods. If a property has both a getter and a setter method, you only need to
apply the Bindable tag to one.
The Bindable tag has the following syntax:
[Bindable "readonly"|"writeonly",type="datatype"]
Both attributes are optional.
The following example defines the variable
flavorStr as a property that is accessible on the
Bindings tab of the Component inspector:
[Bindable]
public var flavorStr:String = "strawberry";