User Guide

537
This statement declares the on promptUser handler in the same script that contains the
registerForEvent command to be called when any object collides with the model named Pluto in
the cast member named Scene:
member("Scene").registerForEvent(#collideWith, #promptUser, me, \
member("Scene").model("Pluto"))
See also
setCollisionCallback(), registerScript(), play() (3D), playNext() (3D), autoblend,
blendTime, sendEvent, unregisterAllEvents
registerScript()
Syntax
member(whichCastmember).model(whichModel).registerScript(eventName, \
handlerName, scriptObject {, begin, period, repetitions})
member(whichCastmember).camera(whichCamera).registerScript(eventName, \
handlerName, scriptObject {, begin, period, repetitions})
member(whichCastmember).light(whichLight).registerScript(eventName, \
handlerName, scriptObject {, begin, period, repetitions})
member(whichCastmember).group(whichGroup).registerScript(eventName, \
handlerName, scriptObject {, begin, period, repetitions})
Description
3D command; registers the specified handler to be called when the specified event occurs for the
referenced node.
The following parameter descriptions apply to both the
registerForEvent() and the
registerScript() commands.
The
handlerName parameter is the name of the handler that will be called; this handler is to be
found in the script object indicated by
scriptObject.
If 0 is specified for
scriptObject, then the first event handler with the given name found in a
movie script is called.
The
eventName parameter can be any of the following predefined Lingo events, or any custom
event that you define:
#collideAny is a collision event generated when any two bodies in the system collide with each
other, and both bodies have the
#collision modifier attached.
#collideWith is a collision event involving this specific model. The setCollisionCallback()
command is a shortcut for using the
registerScript() command for the #collideWith event.