I have weird behavior using ObjectUtil.copy () and ByteArray.writeObject / readObject ().
I clone an ArrayCollection, and at some point I get two identical instances of the class.
Example:
var item:Object = new Object();
item.name = "Hello World";
var listItem:ArrayCollection = new ArrayCollection();
listItem.push(item:Object );
var cloneList:ArrayCollection = ObjectUtil.copy(listItem);
trace(cloneList.length);
I do not understand what I did wrong. Is there something missing? It does not play for all ArrayCollection. It has been working fine for a while. Is this an ObjectUtil.copy () function error?
source
share