MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual page 61

Developing flex components and themes in flash authoring
Table of Contents

Advertisement

Use the
metadata keyword to make properties and getter and setter functions in your
Bindable
ActionScript classes appear on the Bindings tab in the Component inspector.
The
metadata keyword has the following syntax:
Bindable
[Bindable[readonly|writeonly[,type="datatype"]]]
The
keyword must precede a property, a getter or setter function, or other metadata
Bindable
keyword that precedes a property or getter or setter function.
The following example defines the property
also accessible on the Bindings tab in the Component inspector:
[Bindable]
[Inspectable(defaultValue="strawberry")]
public var flavorStr:String = "strawberry";
The
metadata keyword takes three options that specify the type of access to the
Bindable
property, as well as the data type of that property. The following table describes these options:
Option
Description
Instructs Flash to allow the property to be only the source of a binding, as this
readonly
example shows:
[Bindable("readonly")]
Instructs Flash to allow the property to be only the destination of a binding, as
writeonly
this example shows:
[Bindable("writeonly")]
Specifies the data type of the property that is being bound. If you do not specify
type="datatype"
this option, data binding uses the property's data type as declared in the
ActionScript code.
If
datatype
tab's Data Type pop-up menu.
The following example sets the data type of the property to String:
[Bindable(type="String")]
You can combine the access option and the data type option, as the following example shows:
[Bindable(param1="writeonly",type="DataProvider")]
The
keyword is required when you use the
Bindable
information, see
"ChangeEvent" on page
ChangeEvent
Use the
ChangeEvent
changes are made to properties.
The
metadata keyword has the following syntax:
ChangeEvent
[ChangeEvent("event_name"[,...)]
property_declaration or get/set function
You can use this keyword only with variable declarations or getter or setter functions, although it
is not required.
is a registered data type, you can use the functionality in the Schema
61.
metadata keyword to generate one or more component events when
as a public, inspectable variable that is
flavorStr
ChangeEvent
Writing the component's ActionScript code
metadata keyword. For more
61

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX - DEVELOPING COMPONENTS AND THEMES and is the answer not in the manual?

This manual is also suitable for:

Flex

Table of Contents