Programming for ios: Flex ActionScript – ArrayList Issues on newest questions tagged ios – Stack Overflow

I am banging my head for the last couple days in order to get this done but Im unable to. Someone please help me out!
Let me not tell u the whole thing and will try to explain it simply n clearly.
Im having 1 ArrayList. I am trying to replicate that into another one and trying to delete an item at a particular index. But this not only deletes the item in the replicated ArrayList but also the original ArrayList.

For ex:

var DuplicateList:ArrayList = new ArrayList();
DuplicateList = OriginalList;

DuplicateList.removeItemAt(2);

The above not only deletes the “Item 3″ at Index-2 in the DuplicateList but also in the OriginalList.

I just need some workaround with this approach as this is the only way by which whatever I typed inside the controls present in an ItemRenderer of a FLEX List control that uses the OriginalList as a dataProvider is RETAINED, when I change the dataProvider of the List Control from OriginalList to DuplicateList. The following approach does not retain all the data.

var DuplicateList:ArrayList = new ArrayList();
DuplicateList.addAll(OriginalList);

DuplicateList.removeItemAt(2);
ListCntrl.dataProvider = DuplicateList;

Thanks for your help in advance…

See Answers


source: http://stackoverflow.com/questions/11106947/flex-actionscript-arraylist-issues
Programming for ios: programming-for-ios



online applications demo