Macromedia flex 2-migrating applications to flex 2 Manual De Usuario

Descargar
Página de 184
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 
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")]