Lingo Dictionary > S > sendSprite

 

sendSprite

Syntax

sendSprite (whichSprite, #customMessage, args)

Description

Command; 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.

Example

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

on mouseDown me
	sendSprite (1, #bumpCounter, 2)
end

See also

sendAllSprites