Share on Google+Share on Google+

Flex ArrayCollection

ArrayCollection provides more functionalities than an Array.
ArrayCollection provides more functionalities than an Array. It provides methods like addItem(), addItemAt(), contains(), getItemIndex(), removeAll() etc which makes ArrayCollection more useful rather than using Array. It also supports change listener that listens when arraycollection is updated. Listeners can be added to listen the event.

// Creates ArrayCollection of 0 elements
var myArrayCollection:ArrayCollection = new ArrayCollection();

// Creates ArrayCollection using existing Array
var myArrayCollection:ArrayCollection = new ArrayCollection(myArray);

// Creates ArrayCollection and assigns values
var myArrayCollection: ArrayCollection = new ArrayCollection(["RoseIndia", 10]);



Posted on: April 19, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null