Lingo Dictionary > D-F > eventPassMode |  |

eventPassMode

Syntax

    sprite(whichFlashSprite).eventPassMode
    the eventPassMode of sprite whichFlashSprite
    member(whichFlashMember).eventPassMode
    the eventPassMode of member whichFlashMember

Description

Flash cast member property and sprite property; controls when a Flash movie passes mouse events to scripts that are attached to sprites that lie underneath the Flash sprite. The `eventPassMode` property can have these values:

| `#passAlways` (default)—Always passes mouse events.
| `#passButton—`Passes mouse events only when a button in the Flash movie is clicked.
| `#passNotButton—`Passes mouse events only when a nonbutton object is clicked.
| `#passNever—`Never passes mouse events.

This property can be tested and set.

Example

This frame script checks to see whether the buttons in a Flash movie sprite are currently enabled, and if so, sets `eventPassMode` to `#passNotButton`; if the buttons are disabled, the script sets `eventPassMode` to `#passAlways`. The effect of this script is the following:

| Mouse events on nonbutton objects always pass to sprite scripts.
| Mouse events on button objects are passed to sprite scripts when the buttons are disabled. When the buttons are enabled, mouse events on buttons are stopped.

    on enterFrame
    	if sprite(5).buttonsEnabled = TRUE then
    		sprite(5).eventPassMode = #passNotButton
    	else
    		sprite(5).eventPassMode = #passAlways
    	end if
    end