FlexBuilder\'s debugger will show you the \"memory location\" (or, I can only assume, something roughly analogous) of any in-scope instance:
Diney Bomfim's solution worked like a charm. I wrapped this in a class named DebugUtils
in a function named getObjectMemoryHash
.
package
{
public class DebugUtils
{
public static function getObjectMemoryHash(obj:*):String
{
var memoryHash:String;
try
{
FakeClass(obj);
}
catch (e:Error)
{
memoryHash = String(e).replace(/.*([@|\$].*?) to .*$/gi, '$1');
}
return memoryHash;
}
}
}
internal final class FakeClass { }
Then I could use this function from anywhere and trace it, like so:
trace('myObj', DebugUtils.getObjectMemoryHash(myObj));
Thanks so much for this answer!