member(whichCastmember).sendEvent(#eventName, arg1, arg2,...)
3D command; sends an event and an arbitrary number of arguments to all scripts registered to receive the event. Use registerForEvent(), or setCollisionCallback() to register scripts for events.
eventName Required. Specifies the name of the event to send.
arg1, arg2, ... Required. One or more arguments that are sent with the event eventName.
The first line in this example creates an instance of a parent script named "tester". The second line sets the handler of the script instance, jumpPluto, as the handler to be called when the #jump event is sent. The third line registers a movie script handler named jumpMars as another handler to be called when the #jump event is sent. The fourth line sends the #jump event. The handlers #jumpMars in a movie script and #jumpPluto are called, along with any other handlers registered for the #jump event. A script instance value of 0 indicates that you are registering a handler of a movie script, as opposed to a handler of a behavior instance or of a child of a parent script.
t = new (script "tester")
member("scene").registerForEvent(#jump, #jumpPluto, t)
member("scene").registerForEvent(#jump, #jumpMars, 0)
member("scene").sendEvent(#jump)
registerScript(), registerForEvent(), setCollisionCallback()