Subscribe to events
Methods
add(function(T eventArgs) callback) : EventRegistration
Adds the callback to the event.
remove(EventRegistration registration) : void
Removes the registered callback from the event.
Examples
//@input Component.InteractionComponent interactionComponent
// Subscribe to the onTap event
var onTapEvent = script.interactionComponent.onTap.add(function (tapEventArgs) {
print('onTap!');
});
// Unsubscribe from the onTap event
script.interactionComponent.onTap.remove(onTapEvent);
Was this page helpful?