You are not logged in.

1

Tuesday, August 1st 2017, 1:07pm

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)

Source code

1
2
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

This post has been edited 1 times, last edit by "antic" (Aug 1st 2017, 5:12pm)


2

Wednesday, August 2nd 2017, 10:02pm

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:

Source code

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

or:

Source code

1
2
3
4
...
set(ly.isclicked, false);
set(ly.onclick, ... do some stuff ...; set(isclicked, true); );
...


Best regards,
Klaus

3

Saturday, August 5th 2017, 2:17pm

thanks

for the answer