hi,
does anybody know if getting the caller is possible in the script language?
see this example:
<!-- setup -->
<layer name="x1" property="y1">
<layer name="x2" property="y2">
<action name="testaction">trace("%0 %1");</action>
<!-- dynamically add action to multiple layers -->
set(layer[x1].myaction, "test(%%1);");
set(layer[x2].myaction, "test(%%1);");
<!-- calling the actions with an argument-->
layer[x1].myaction('testarg');
layer[x2].myaction('testarg'');
console output :
> INFO: testaction testarg
> INFO: testaction testarg
this works so far...
but, is there any way to know in myaction if it was called from layer[x1] or layer[x2] ?
and then to get the callers property y1 respectively y2 ?
or is this only working in js actions?
and...
are events (like onclick) behaving different than a custom action like here?
best,
index