Basically I’m trying to get reference to a variable within the same script, but I’m not sure if I can go about it this way:
I have 3 GameObjects: startPos1, startPos2, startPos3.
I just want to pass in a number (1,2,or3) to create a variable the refernces the appropriate gameObject var.
In flash it would be something like:
setVar(1);
function setVar(n:Number)
{
var activeObj = this[“startPos” +n];
}
I’m not sure how to go about doing this in javascript though…