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

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 184
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 36
Miscellaneous 37
Arrays
Arrays no longer automatically update if you change the data. This means that you should no
longer databind to an Array unless you manually call the
dispatchEvent() each time an
element in the Array changes. Otherwise, the control to which the data is bound will not
reflect the changes. You can databind to a Collection.
Two convenience methods of the Array class have been removed. You can no longer use the
addItem() and removeItem() methods. You must instead use push() and pop(),
respectively. Array was formerly a mixin, but is now used directly from the Flash package
without modification. For example:
var cards:Array;
// Old way.
cards.addItem({label: "Visa", data: CreditCardValidatorCardType.VISA});
// New way.
cards.push({label: "Visa", data: CreditCardValidatorCardType.VISA});
Arrays are commonly used as data providers in Flex applications.
setInterval() and clearInterval()
The setInterval() and clearInterval() methods are now in the flash.util package, so to
use them you must import that package. But the
setInterval() and clearInterval()
methods are deprecated in favor of the new Timer class.
For an example that uses a timer in a Flex application, see “Using Timer” on page 182.
For information on using the Timer class, see the ActionScript 3.0 Language Reference.
Metadata
You must now separate metadata properties with commas. For example:
ActionScript 2.0:
[Style(name="horizontalAlign" enumeration="left,center,right"
inherit="no")]
ActionScript 3.0:
[Style(name="horizontalAlign", enumeration="left,center,right",
inherit="no")]
Vedere la pagina 36
1 2 ... 32 33 34 35 36 37 38 39 40 41 42 ... 183 184

Commenti su questo manuale

Nessun commento