ActionScript 3: How to get symbol name, not instance name

Stupid question, but I spent an hour trying to find it: I created a symbol and named it symbol_a. How can I get this symbol name from an instance? If i use

myInstance.name

I get the name of the instance, not the name of the character ......

Thanks in advance,

Edward

+3
source share
2 answers

This will return the character name (String).

getQualifiedClassName(yourSymbolInstance);`

This will give you the class object of your instance.

var c:Class=yourSymbolInstance.constructor;
addChild(new c());

If you do not export your character, the character name will be MovieClip.

+4
source

I don't think you can get the character name using AS3.

Btw. why do you need it?

+1
source

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


All Articles