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

    Einmal editiert, zuletzt von antic (1. August 2017 um 17:12)

  • 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

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!