I think this should work without using eval:
I'm sure there's a shortcut to writing that as well.PHP Code:var myLoc:String = "mc1.mc2.mc3.mc4";
var myMCs:Array = myLoc.split('.');
var myMC = _root;
for(var i = 0; i < myMCs.length; i++) {
myMC = myMC[myMCs[i]];
}
trace(myMC);
Just an idea that came to me because I know eval is not supported in AS3.




Reply With Quote