Sie sind nicht angemeldet.

1

Freitag, 1. Mai 2020, 11:37

Get clicked layer name and trace it to showlog

Hi.


How can i get the layer or plugin name of the the elements on my skin and print trace it to showlog?
I have a client way back and they requested some layer elements on the skin to be removed, the problem is that i encrypted my original file and forgot the layer/plugin name, and i cannot find my original un-encrypted files.


Here’s my idea of the code:


<events onclick="trace(layer(get[name]); showlog();" />


After finding the name of the layer, i can just simply hide it by creating a layer with same name and disabling it right?
<layer name="logo2" keep="false" enabled="false" visible="false" />
<layer name="element2" keep="false" enabled="false" visible="false" />


Thank you

2

Freitag, 1. Mai 2020, 18:57

Hi,

try adding this script:

Quellcode

1
2
3
4
5
6
7
<action autorun="onstart">
    delayedcall(1,
        for(set(i,0), i LT layer.count, inc(i),
            layer[get(i)].addevent('onclick', trace('click on layer[',name,']') );
        );
    );
</action>


It will wait 1.0 second after start and then add a click event to all current defined layer elements.

Best regards,
Klaus

3

Samstag, 2. Mai 2020, 04:52

Hi Klaus,

Thank you so much! this works perfectly!
However, is it possible to trace non clickable layers?
When debugging is enabled, i see the separated layers but only thru wireframe.

Hi,

try adding this script:

Quellcode

1
2
3
4
5
    delayedcall(1,
        for(set(i,0), i LT layer.count, inc(i),
            layer[get(i)].addevent('onclick', trace('click on layer[',name,']') );
        );
    );


It will wait 1.0 second after start and then add a click event to all current defined layer elements.

Best regards,
Klaus