MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference page 525

Director scripting reference
Table of Contents

Advertisement

Example
The first line in this example creates an instance of a parent script named
line sets the handler of the script instance, jumpPluto, as the handler to be called when the
event is sent. The third line registers a movie script handler named jumpMars as another handler
to be called when the
in a movie script and
#jumpMars
for the
event. A script instance value of 0 indicates that you are registering a handler of a
#jump
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)
See also
registerScript(), registerForEvent(),
sendSprite()
Usage
-- Lingo syntax
_movie.sendSprite(spriteNameOrNum, event {, args})
// JavaScript syntax
_movie.sendSprite(spriteNameOrNum, event {, args});
Description
Movie method; sends a message to all scripts attached to a specified sprite.
Messages sent using
messages then follow the regular message hierarchy: cast member script, frame script, and
movie script.
If the given sprite does not have an attached behavior containing the given handler,
returns
sendSprite()
Parameters
spriteNameOrNum
sprite that will receive the event.
Required. A symbol or string that specifies the event to send to the specified sprite.
event
Optional. An argument or arguments to send with the message.
args
Example
This handler sends the custom message
user clicks:
-- Lingo syntax
on mouseDown me
_movie.sendSprite(1, #bumpCounter, 2)
end
// JavaScript syntax
function mouseDown() {
_movie.sendSprite(1, "bumpCounter", 2);
}
event is sent. The fourth line sends the
#jump
#jumpPluto
are sent to each of the scripts attached to the sprite. The
sendSprite()
.
FALSE
Required. A string or an integer that specifies the name or number of the
bumpCounter
are called, along with any other handlers registered
setCollisionCallback()
and the argument
. The second
"tester"
event. The handlers
#jump
to sprite 1 when the
2
sendSprite()
#jump
525

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Director mx 2004

Table of Contents