package {
import flash.display.Sprite;
public class test1 extends Sprite {
private var tmp:Object;
public function test1() {
createObj(tmp);
if(tmp == null) {
trace("nothing changed");
}
}
private function createObj(obj:Object):void {
obj = new Object();
}
}
}
In the above code the output on the console is :
nothing changed
Why?
If the argument to createObj was passed by reference(which is the
default behavior of actionscript), why did it not get modified?