triggerEvent: Difference between revisions

no edit summary
No edit summary
 
No edit summary
Line 1: Line 1:
{{ScriptItem
{{ScriptItem2
|endpoint = shared
|side = shared
|type = function
|type = function
|name = triggerEvent
|name = triggerEvent
|parameters = string eventName, [ Element source, ... ]
|usage = trigger an event, which is only triggered on the same endpoint (server or client).<br>Use [[triggerNetworkEvent|triggerNetworkEvent]] for script communication between client and server or vice versa.
|parameter1 = string eventName The name of the event, case-insensitive.
|arg1 = string eventName The name of the event, case-insensitive.
|parameter2 = Element source optional null The source element to trigger the event for.
|arg2 = [Element source = null] The source element to trigger the event for, used in [[bindEventHandler|bindEventHandler]] but not in [[addEventHandler|addEventHandler]].
|parameter3 = mixed vararg optional n/a Arguments to be sent to scripting function that are bound to the event.
|arg3 = [mixed vararg = null] Arguments to be sent to scripting function that are bound to the event.
|return1 = void
|return1 = void
|returnFail1 = void
|returnFail1 = void
|callbackParameters = [ ... ]
|cb1arg1 = CancellableEvent event The event object.
|usage = trigger an event
|cb1arg2 = vararg ... The mixed vararg arguments that were sent to triggerEvent.<br>Note that the source element is not forwarded to the callbacks.
}}
}}
6,833

edits