I have an array collection into which im adding different model values as below.
var ob:Object=new Object();
ob.name=string1;
ob.data=model.arraylist1;
ob.id=model.arraylist2;
nextArrayCollection.addItem(ob);
//model.arraylist1 value is changed here
//model.arraylist2 value is changed here
ob=new Object();
ob.name=string1;
ob.data=model.arraylist1;
ob.id=model.arraylist2;
nextArrayCollection.addItem(ob);
The issue is that when the second item is added to the nextArrayCollection the value of the first item in arraycollection also changes to same as the second item added.
I am really confused at what is happenning here. Each time i add new item to the nextArrayCollection all the existing items value changes to that of the new one added. Is the arraycollection using the refrence and not the value. How can i overcome this issue?