actionscript 3 - Convert an Object's Name to a String -


var variable:object=new object(); 

how convert "variable" object "variable" string? thought work:

var variable:object=new object(); var variable_string=string(variable); 

you cannot name of variable holds instance via said instance.

you store instance in object against given key, found using for...in loop:

var myobject:object = {}; var objects:object = { variable: myobject };  for(var i:string in objects) {     if(objects[i] === myobject)     {         trace(i); // variable         break;     } } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -