Hello all!
I'm trying to use a string to determine a specific variable.
For example.
Is this possible? I really do think it is. But I'm really not sure how to go about doing it. The main reason. I have to save/load hundreds of objects/variables. and in order to determine which ones to load, i wanted to make a variable to tell it which ones to load.Code:onClipEvent (load) {
var1 = "var2";
var2 = new Object();
var2.a = "no";
_root[var1].a = "yes";
}
Basically, so I don't have to do this...
So yea, any help is appreciated,Code:onClipEvent(load) {
if(var1 == "var2") {
_root.var2.a = "yes";
}
if(var1 == "var3") {
_root.var3.a = "yes";
}
if(var1 == "var4") {
_root.var4.a = "yes";
}
}
Thanks!
~Bill
