Collisions - MACROMEDIA DIRECTOR MX-USING DIRECTOR MX Use Manual

Table of Contents

Advertisement

Use these commands to set up event handling:
Command
registerForEvent
(
,
eventName
,
handlerName
,
scriptInstance
)
model
unregister
AllEvents()_
sendEvent
(
,
eventName
,
)
arg1
arg2...

Collisions

By attaching the collision modifier (
automatically respond to collisions with other models. By using the properties of the collision
modifier, you can control the details of how the model responds to collisions. For more
information on collisions, see "Modifiers" on page 498.
Collision properties
When a collision occurs, it generates a
argument to the handler that is declared with the
setCollisionCallBack
contains a property list with detailed information about the collision.
These properties are included in the
Property
modelA
modelB
522
Chapter 20
Description
eventName
The event
is one of the following:
#collideAny
: Called when any collision occurs.
#collideWith
: Called when a collision with a specific
model occurs and implicitly registered when
setCollisionCallback(...)
calling
model.collision.setCollision
Callback
.
#timeMS
: Sets up a time-based simulation callback using
registerForEvent
the format
(timeMS, handlerName, scriptInstance)
begin, period, repetitions
begin
period
The
and
arguments are in milliseconds. If
repetitions
0
is set to
, the simulation continues
indefinitely.
#animationStarted
: Called whenever a keyFrame or
bones motion begins.
#animationEnded
: Called whenever a keyFrame or
bones motion ends.
Any user-defined symbol: Registers to receive any user-
defined event sent from a SendEvent call.
Unregisters all events.
eventName
Sends an event named
to receive it.
sendAllSprites()
Similar to
delivered only to scripts that are registered to receive it.
#collision
collideWith
command. This argument is called a
collisionData
Access
Description
Get
One model in the collision.
If the Lingo script includes registration for collision with a
particular model,
Get
The second model in the collision.
is called. Equivalent to
.
to all scripts registered
except that the event is
) to a model, you can enable that model to
event.The
collideWith
or
registerForEvent
collisionData
object passed to the handler:
modelA
is that model.
Returns
TRUE (1)
if the operation
succeeds.
FALSE (0)
if the
operation fails.
Nothing.
A Lingo error is generated
if the operation fails.
Nothing.
A Lingo error is generated
if the operation fails.
event passes an
object and

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DIRECTOR MX-USING DIRECTOR MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Director mx

Table of Contents