• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. CREATING BEHAVIORS > COMMUNICATING BETWEEN BEHAVIORS

COMMUNICATING BETWEEN BEHAVIORS

Behaviors do not have to control only their own sprites; they can actually send instructions and information to other sprites and behaviors as well. Three special commands are used for doing this—sendSprite, sendAllSprites, and call.

Sending a Message to a Sprite

The first command in question is sendSprite, which sends a message to a specific sprite, along with additional information. For example:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint