Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Feature requests and bug reports
Event sender parameter

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


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact