Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 52

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

Before a public, protected, or private property defined as a variable to make that specific
property support binding.
The tag can have the following forms:
[Bindable]
public var foo;
The Flex compiler automatically generates an event named
property. If the property value remains the same on a write, Flex does not dispatch the
event or update the property.
You can also specify the event name, as the following example shows:
[Bindable(event="fooChanged")]
public var foo;
In this case, you are responsible for generating and dispatching the event, typically as part
of some other method of your class. You can specify a
specification if you want to name the event, even when you already specified the
event
tag at the class level.
[Bindable]
Before a public, protected, or private property defined by a getter or setter method.
You must define both a setter and a getter method to use the
property. If you define just a setter method, you create a write-only property that you
cannot use as the source of a data-binding expression. If you define just a getter method,
you create a read-only property that you can use as the source of a data-binding expression
without inserting the
use a variable, defined by using the
expression.
The tag can have the following forms:
[Bindable]
public function set shortNames(val:Boolean):void {
...
}
public function get shortNames():Boolean {
...
}
The Flex compiler automatically generates an event named
property. If the property value remains the same on a write, Flex does not dispatch the
event or update the property. To determine if the property value changes, Flex calls the
getter method to obtain the current value of the property.
52
Using Metadata Tags in Custom Components
metadata tag. This is similar to the way that you can
[Bindable]
keyword, as the source for a data binding
const
propertyChange
tag that includes the
[Bindable]
tag with the
[Bindable]
propertyChange
for the
for the

Advertisement

Table of Contents
loading

Table of Contents