What's the difference between array and arraycollection?
First, the ArrayCollection is designed for the Flex framework. It acts like a Proxy
for a given Array
instance. This means it can listen for modifications made to the source Array
and update it self when this happens. It also contains a subset of additional methods required specifically by the framework (have a look at the IList implementation for instance).
One important difference is that ArrayCollection
raises events whenever it is modified. This allows you to do data binding on it more effectively than you could do on an Array
.
An ArrayCollection is a wrapper for an Array that lets it be used by GUI elements. Iterating through them is a bit tricky however, see here: http://npcomplete.weebly.com/1/post/2009/10/for-loops-in-actionscript.html