标签:
function clone(obj:Object):Object
{
var byteArray:ByteArray = new ByteArray();
byteArray.writeObject(obj);
byteArray.position = 0;
return byteArray.readObject();
}
var arr:Array = [1,2,3];
var arr1:Object = clone(arr);
var arr2:Array = arr;
arr.push(4);
trace(arr,arr1,arr2);
//1,2,3,4 1,2,3 1,2,3,4
标签:
原文地址:http://www.cnblogs.com/frost-yen/p/4291988.html