Looks useful! Thanks Julius I will try out this code later today!
-Sascha

----- Original Message ----- From: "Julius - XK" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Tuesday, January 24, 2006 5:07 AM
Subject: Re: [Flashcoders] getting the name of an object



Is this what your looking for? It has it's limitations, would be nice if there was a myObj.toString() == "myObj".. Or something
along those lines :)



var myObj:Object = new Object;
var s:String = "";

s = getMyObjectName(myObj);
trace(s);
this[s].anyName = "text";
trace(myObj.anyName);

function getMyObjectName(obj):String {
   for (i in this) {
       if (this[i] == obj) return i;    // Should it be ===?
   }
}


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to