3D Lingo Dictionary > O-S > registerScript() |
![]() ![]() ![]() |
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 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:
![]() |
|
![]() |
|
![]() |
|
For looping animations, the |
|
When a series of animations is queued for the model and the animation's |
|
![]() |
|
The handler you specify is sent the following arguments: |
|
|
|
|
|
|
|
|
|
|
Examples
This statement registers the messageReceived
event handler found in a movie script to be called when the model named Player receives the custom user defined event named #message
:
member("Scene").model("Player").registerScript(#message, #messageReceived, 0)
This statement registers the collisionResponder
event handler found in the same script as the registerScript
command to be called each time a collision occurs between the model named Player and any other model using the #collision
modifier:
member("Scene").model("Player").registerScript(#collideWith, #collisionResponder, me)
See also
registerForEvent()
, sendEvent
, setCollisionCallback()
, collisionData
![]() ![]() ![]() |