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

  • Hi,

    try adding this script:

    Code
    <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

  • 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:

    Code
    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

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!