MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 940

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

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
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
Bindings tab of the Component inspector:
[Bindable]
public var flavorStr:String = "strawberry";
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:
Option
readonly
writeonly
type="datatype"
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 more information, see the
next section.
For information on creating data binding in the Flash authoring environment, see "Data binding
(Flash Professional only)" in Using Flash.
940
Chapter 7: Creating Components
Description
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")]
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")]
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
though it is really type Object:
[Bindable(type="DataProvider")]
var x: Object;
as a property that is accessible on the
flavorStr
x
or getter/
var
as type DataProvider, even

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents