I am trying to create a simple AS3 code in Flash Professional CS6 which references a variable.
Example:
var1:int = 1;
varref = "var1"; (this is the "reference" variable, but ofcourse this is not how it's done in as3)
if (var1 == 1)
{
varref = 50
}
If this is run, it would try to make the string from the variable varref which is currently “var1” into an int of “1′. I want it to reference the variable, not be a variable of it’s own.
A simple example of how to do this would be great. (From what I know, an object may be needed, so a simple object example of this situation would be great.)
I’m using this class for creating references :
https://github.com/turbosqel/as3SupportLib/blob/master/as3SupportLib/src/turbosqel/data/LVar.as
Its very simple to use , like :
Same thing You can do with any other data type .