Here is a simple example of what I mean:
private var ex:String="day";
......
closeWindows(ex);
trace(ex);//I would like it to trace "night"
......
//this can be in another class, we assume that the "ex" variable can't be accessed directly
private function closeWindows(context:String):void {
context = "night"
}
Somehow I would need to pass the reference not the value itself to the “closeWindows” method.
Any help it’s highly appreciated.
Thanks.
AS3 doesn’t support passing primitives by reference, unfortunately. So you’re right, one of the typical solutions is to use some kind of wrapper for the primitive, such as in this question.