3

For debugging purposes I'd like to trace the internal ID of some objects. You know, the stuff you get in error reports sometimes, SuperObject@a8D7a2

Is this possible?

Bart van Heukelom
  • 41,958
  • 59
  • 182
  • 293
  • possible duplicate of [How can I get an instance's "memory location" in ActionScript?](http://stackoverflow.com/questions/1343282/how-can-i-get-an-instances-memory-location-in-actionscript) – Jeremy Mar 04 '13 at 17:15

3 Answers3

0

Not as such.

Would creating a unique ID on demand do the trick?

Community
  • 1
  • 1
back2dos
  • 15,460
  • 33
  • 48
0

A solution that was sufficient for my needs is simpler still, Create an instance variable holding a random number. This is likely (but not guaranteed) to be different for each object, depending how many you have.

    private var _id:int = Math.random() * 10000000;
Dave Walker
  • 153
  • 1
  • 8
0
myObject.name = "Id_"+x;

... or something else dynamic string;

If You don't want add an Id, just see during the debug process, just trace it.

trace(myObject.name );

Air decompiler add an unique name to every display object. (like this: Instance105 )

Mi-Creativity
  • 9,381
  • 10
  • 35
  • 46
szabesz
  • 11
  • 2