Top

How to copy an ArrayCollection by value

March 21, 2008

I came across the requirement to copy an ArrayCollection by value instead of by reference. Here is the solutions I used: private var newCollection:ArrayCollection = new ArrayCollection(); for (var k:Number = 0; k < myCurrentCollection.length; k++) { newCollection.addItem(mx.utils.ObjectUtil.copy(myCurrentCollection[k])); }

Comments

Comments are closed.

Bottom