6,834
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{ | {{ScriptItem2 | ||
| | |side = shared | ||
|type = function | |type = function | ||
|name = triggerEvent | |name = triggerEvent | ||
| | |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. | ||
| | |arg1 = string eventName The name of the event, case-insensitive. | ||
| | |arg2 = [Element source = null] The source element to trigger the event for, used in [[bindEventHandler|bindEventHandler]] but not in [[addEventHandler|addEventHandler]]. | ||
| | |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 | ||
| | |cb1arg1 = CancellableEvent event The event object. | ||
| | |cb1arg2 = vararg ... The mixed vararg arguments that were sent to triggerEvent.<br>Note that the source element is not forwarded to the callbacks. | ||
}} | }} |
edits