Step 10: Binding; Step 11: Api Updates - Adobe FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual

Migrating applications to flex 2
Table of Contents

Advertisement

Step 10: Binding

To make a user-defined variable bindable, you must now explicitly identify it by adding the
metadata tag to the property; for example:
[Bindable]
[Bindable]
public var catalog:Array;
In addition, the
<mx:Binding>
compiled in Flex 1.5:
<mx:HBox>
<mx:Label id="myLabel"/>
<mx:Label id="my2ndLabel" text="hello"/>
<mx:Binding source="my2ndLabel.text" destination="myLabel.text"/>
</mx:HBox>
In Flex 2, you must move the tag to the top level, as the following example shows:
<mx:Binding source="my2ndLabel.text" destination="myLabel.text"/>
<mx:HBox>
<mx:Label id="myLabel"/>
<mx:Label id="my2ndLabel" text="hello"/>
</mx:HBox>
For more information, see

Step 11: API updates

The Flex ActionScript API has been updated to be more user-friendly. Changes include
enforcing proper capitalization, making class and property names clearer and more intuitive,
eliminating redundant classes and properties, and unifying common properties across
controls.
The following specific areas changed:
Event names. All event names and their constants were changed to present tense. For
example, the childAdded event is now childAdd, and its constant, CHILD_ADDED, is
now CHILD_ADD.
Camel-casing. Package, method, and property names now consistently use camel-case. For
example, the mx.containers.accordionclasses package name is now
mx.containers.accordionClasses.
Renderers. The terms cell, data, and row have been changed to item for renderers. For
example, cellFocusIn is now itemFocusIn, and the charting event mouseOverData is now
itemMouseOver.
tag must be moved to the top level. The following example
Chapter 5,
"Binding".

Step 11: API updates

19

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex 2

Table of Contents