MACROMEDIA FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manuale Utente Pagina 19

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 184
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 18
Step 11: API updates 19
Step 10: Binding
To make a user-defined variable bindable, you must now explicitly identify it by adding the
[Bindable] metadata tag to the property; for example:
[Bindable]
public var catalog:Array;
In addition, the <mx:Binding> tag must be moved to the top level. The following example
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 Chapter 5, “Binding”.
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.
Vedere la pagina 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 183 184

Commenti su questo manuale

Nessun commento