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 sendSprite() are sent to each of the scripts attached to the sprite. The 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, sendSprite() returns FALSE.

Parameters

spriteNameOrNum Required. A string or an integer that specifies the name or number of the sprite that will receive the event.

event Required. A symbol or string that specifies the event to send to the specified sprite.

args Optional. An argument or arguments to send with the message.

Example

This handler sends the custom message bumpCounter and the argument 2 to sprite 1 when the user clicks:

-- Lingo syntax
on mouseDown me
   _movie.sendSprite(1, #bumpCounter, 2)
end

// JavaScript syntax
function mouseDown() {
   _movie.sendSprite(1, "bumpCounter", 2);
}

See also

Movie


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/director/mx2004/release_update_en/07_me388.htm