e.Target equivalent

  • Hi,
    I can't seem to find / understand how to access the onclicked layer.for example if I dynamically make buttons in a for loop and give them all the same kind of click eventhow can I access it self?(pseudo code)

    Code
    for loopcopy(lname, 'name' + count);addlayer(get(lname));copy(ly, layer[get(lname)]);set(ly.onclick,			
    // do some stuff// set itself to be clicked	set(ly.isCLicked, true););end loop


    thanks any help is appreciated

    Edited once, last by antic (August 1, 2017 at 5:12 PM).

  • Hi,

    when the onclick event of the layer will be executed, the context/scope will be the automatically the layer itself, but for adding NEW attributes to the layer, an access via the name would be necessary. When the attribute would be already defined, the attribute could be used also directly.

    e.g. either:

    Code
    ...
    set(ly.onclick, ... do some stuff ...; set(layer[get(name)].isclicked, true); );
    ...


    or:

    Code
    ...
    set(ly.isclicked, false);
    set(ly.onclick, ... do some stuff ...; set(isclicked, true); );
    ...

    Best regards,
    Klaus

Participate now!

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