Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to use ArrayCollection or Array in as3?

I know that an ArrayCollection is a wrapper over an Array, but what I wanted to know is when to choose one over the other? Will the over usage of ArrayCollections result in performance?

like image 204
midhunhk Avatar asked Jan 27 '26 12:01

midhunhk


1 Answers

The main advantage of ArrayCollection is collectionChange event which allows to get advantage of data binding with it.

Some others are:

  • Possibility to filter or sort elements of collection without modifying or copying of underlying array.
  • Implementation of ICollectionView which allows to create a cursor and iterate collection with it.
  • Display of multiple arrays in a datagrid / etc (in this case, arrays are automatically converted to arrayCollections anyway)

If you don't need any of these advantages use simple Array.

like image 184
Constantiner Avatar answered Jan 30 '26 05:01

Constantiner