Coming from C++ background, I am dumbed by this language…
How can I pass parameters by reference? So it doesn’t make a copy out of it, but modifies whatever I pass in?
This:
function ChangeString(string:String)
{
string = “inside string”;
}
var str:String = “outside string”;
ChangeString(str);
trace(str);
outputs “outside string”, since functions seem to take objects by value.
So what do you guys do if you need to get multiple variables out of functions? Returning a custom class? There must be a better way!
Thanks.