var a = 10; var b = a; a = 20; trace(a,b); trace("*******************************"); var c:Array = [10,20,30,40]; var d:Array; d = c; c[0] = 50; trace("c:",c); trace("d:",d); trace("*******************************"); var e:Array = [10,20,30,40]; var f:Array; f = e; f[0] = 99; trace("e:",e); trace("f:",f); trace("*******************************"); e = ["a","b","c"];//此时已经打破e=f trace("e:",e); trace("f:",f); trace("*******************************"); e[0] = "fly"; trace("e:",e); trace("f:",f); trace("*******************************"); f[0] = "sky"; trace("e:",e); trace("f:",f); trace("*******************************");
输出:
20 10 ******************************* c: 50,20,30,40 d: 50,20,30,40 ******************************* e: 99,20,30,40 f: 99,20,30,40 ******************************* e: a,b,c f: 99,20,30,40 ******************************* e: fly,b,c f: 99,20,30,40 ******************************* e: fly,b,c f: sky,20,30,40 *******************************