Adobe FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual page 107

Migrating applications to flex 2
Table of Contents

Advertisement

The Flex compiler automatically generates an event named
properties so the properties can be used as the source of a data binding expression. In this case,
specifying the
[Bindable]
[Bindable(event="propertyChange")]
Binding from a single property
To make a single property usable as the source for a data binding expression, add the
metadata tag before the property declaration. The property can be public,
[Bindable]
protected, or private.
Flex 1.5:
var foo:String; // You could bind to this in 1.5
Flex 2:
[Bindable]
public var foo:String;
The Flex compiler automatically generates an event named
properties so the properties can be used as the source of a data binding expression. In this case,
specifying the
[Bindable]
[Bindable(event="propertyChange")]
Binding from a property defined by a setter and getter
method
In Flex 1.5, you used the
replace the
[ChangeEvent]
event in the method. This strategy also applies to other methods that dispatched custom
events.
Flex 1.5:
[ChangeEvent("maxFontSizeChanged")]
// Define public getter method.
public function get maxFontSize():Number {
return _maxFontSize;
}
Flex 2:
[Bindable(event="maxFontSizeChanged")]
// Define public getter method.
public function get maxFontSize():Number {
return _maxFontSize;
}
metadata tag with no event is the same as specifying the following:
metadata tag with no event is the same as specifying the following:
metadata tag on setter/getter pairs. In Flex 2, you
[ChangeEvent]
metadata tag with the
propertyChange
propertyChange
metadata tag and dispatch the
[Bindable]
Binding from a property
for all public
for all public
107

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex 2

Table of Contents