Each Director event is usually sent to the scripts in the following order, but there are a lot of exceptions, as noted below:
Primary event handler(s)
Sprite Behavior(s) and cast script(s)
Frame script of current frame
Director 6 added many new events that are broadcast to both sprite scripts and the frame script in the current frame. Sprite scripts can prevent events from reaching cast scripts, and frame scripts can prevent events from reaching movie scripts.
Score events (such as
exitFrame) are broadcast to all sprites and the frame script. Sprite events (such a
beginSprite) are sent to whatever sprite span(s) or frame script span begins or ends in a frame. Mouse events (such as
mouseUp) are generally sent to only one sprite at a time and only passed the frame scripts if not trapped by a sprite.
Let’s examine what happens in detail at each of these levels:
If a primary event handler is defined, it receives the event first. By default, it passes the message onto other scripts rather than consuming it.
Many sprites have no scripts attached, and some have multiple scripts attached. Even sprites with scripts may ignore most events, trapping only those of interest. Refer to Chapter 9 for many more details on how sprites trap mouse events. For this discussion, you need only understand that mouse events are sent only to the first sprite that traps them.
member of sprite ...