I have the following problem with objects in actionscript3:
var o:Object = new Object();
destroyObject(o);
trace(o); // [object Object]
function destroyObject(obj:Object):void{
obj = null;
trace(obj); // null
}
Since objects are passed by reference in AS3 I assume that the previous code would change o
to null
, but it doesn't.
Could someone explain me 'why'?
Thanks.