registerScript()
501
•
duration
is the total number of milliseconds that will elapse between the
registerForEvent
call and the last
#timeMS
event. For example, if there are five iterations with a period of 500
ms, the duration is 2500 ms. For tasks with unlimited iterations, the duration is 0.
•
systemTime
is the absolute time in milliseconds since the Director movie started.
scriptObject
Required. Specifies the script object that contains the handler
handlerName
. If 0
is specified for
scriptObject
, then the first event handler with the given name found in a movie
script is called.
begin
Optional. Specifies the number of milliseconds after
registerForEvent()
is called that
the first
#timeMS
event occurs.
period
Optional. Specifies the number of milliseconds between
#timeMS
events when the value
of
repetitions
is greater then 0.
repetitions
Optional. Specifies the number of repetitions for the
#timeMS
event. If
repetitions
is 0, the
#timeMS
event occurs indefinitely.
Example
This statement registers the
promptUser
event handler found in a movie script to be called twice
at an interval of 5 seconds:
member("Scene").registerForEvent(#timeMS, #promptUser, 0, \
5000, 5000, 2)
This statement registers the
promptUser
event handler found in a movie script to be called each
time a collision occurs within the cast member named Scene:
member("Scene").registerForEvent(#collideAny, #promptUser, 0)
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()
Usage
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.
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...