I did raise this some years ago: Calling Functions & Drag-n-drop tips - #6 by mackavi
I could be wrong but I don’t think event handlers with parameters are on the books. I had hoped that data properties might have made it to the GUI in v3 but not as yet. There is an example on that link how you can do this with a data map instead.
I will say that having built lots of interactive projects over the years, it has turned out that I don’t miss the parameters as much as I thought I would.
There is a quick & easy way to reuse a function if nothing else is possible or time is of the essence - just name your elements accordingly and then use the name in a switch / case in the function to trigger the appropriate response. For example, our hundred square:Interaktiv
All 100 of the number tiles all call the same function on left click. Then using attached properties, the element name or the tiles’ text content the function completes multiple actions.
@arachonteur, you can set data to the target element before the event occurs (e.g. in Scene Activate event), and use
this object in the element event handler to get that data. (
this object in an event handler is the current target element). Or you can use the element name (
this.name) as mackavi’s suggestion.
@mackavi, there are not many users asking for data properties so we’ve not implemented it yet.
Thanks Toan. It’s not a deal breaker - Saola is already more than capable of building everything I need.