falcon12 Registered User |
Quote
|
2017-04-29 21:33:39 |
|
I would like to be able to identify the sender of an event.
Suppose you click on a cube C1 that run a function called "F1" using "on click do something" and "execute javascript".
I would like to be able to know that is it C1 that has been clicked on inside F1 function.
I'm aware I can "simulate" that using some tricks like changing some C1's property (Size, color or anything else) and testing every Root child to identify the one that has changed. Ok. But it is far too slow in my app.
|
pk12 Registered User |
Quote
|
2017-04-29 21:56:41 |
|
You need to create an action instead of "execute javascript" - the node on which the action has been executed is passed in the parameter.
/* <action jsname="action_MyAction" description="My Action"> </action> */
action_MyAction = function() {}; action_MyAction.prototype.execute = function(currentNode) { // currentNode is the node on which the action has been executed };
|
falcon12 Registered User |
Quote
|
2017-04-30 09:32:07 |
|
Ok, thanck you Pk12
|