Get Object ID in ActionScript 3

For debugging purposes, I would like to trace the internal identifier of some objects. You know, the stuff you get in error messages, sometimes,SuperObject@a8D7a2

Is it possible?

+3
source share
3 answers

Not as such.

Would creating a unique identifier on demand do the trick?

0
source

The solution that was enough for my needs is even simpler, create an instance variable containing a random number. This is most likely (but not guaranteed) to be different for each object, depending on how much you have.

    private var _id:int = Math.random() * 10000000;
0
source
myObject.name = "Id_"+x;

... - ;

, , .

trace(myObject.name );

Air decompiler adds a unique name for each display object. (ex: Instance105)

0
source

Source: https://habr.com/ru/post/1735240/


All Articles