I have an Array Collection with any number of Objects. I know each Object has a given property. Is there an easy (aka "built-in") way to get an Array of all the values of that property in the Collection?
For instance, let's say I have the following Collection:
var myArrayCollection:ArrayCollection = new ArrayCollection(
{id: 1, name: "a"}
{id: 2, name: "b"}
{id: 3, name: "c"}
{id: 4, name: "d"}
....
);
I want to get the Array "1,2,3,4....". Right now, I have to loop through the Collection and push each value to an Array. Since my Collection can get large, I want to avoid looping.
var myArray:Array /* of int */ = [];
for each (var item:Object in myArrayCollection)
{
myArray.push(item.id);
}
Does anyone have any suggestions?
Thanks.