views:

449

answers:

3

What's the difference between array and arraycollection?

+3  A: 

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).

Theo.T
+1  A: 

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.

Jacob
A: 

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

abc