Also, the this[varName] assumes that the variable is a property of "this", while local scope variables won't be.
Lee -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Kawamoto Sent: 30 May 2006 16:14 To: [email protected] Subject: [Flashcoders] Get Original Variable's Name in Function? >Is it possible to retrieve the name of the variable passed into a function? function myFunct(str:String):Void { for (var varName in this) { if (this[varName] == str) { trace(varName+": "+str); } } } var foo:String = "ABC"; var moo:String = "DEF"; myFunct(foo); myFunct(moo); // Output foo: ABC moo: DEF OK, this is not really "retrieving" the name of the variable therefore cannot be trusted... Kenneth Kawamoto http://www.materiaprima.co.uk _______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com

