How to copy a ListCollectionView variable into a new ListCollectionView variable by value (rather than reference)?
That is, changes to the new ListCollectionView variable should not effect the original ListCollectionView variable (and vice versa).
The end goal is to have 2 ListCollectionView variables pointing to the same ArrayList, but updates to one ListCollectionView variable do not effect the other ListCollectionView variable.
UPDATE 1
Here’s one way I found to do it, although I’m not sure if it’s the cleanest or most efficient way.
LCV2=new ListCollectionView(new ArrayList());
for (var ii:int=0; ii<LCV1.length; ii++) {
var item:Object=LCV1[ii];
LCV2.list.addItem(item);
}
1 Answer