eventPassMode

Syntax: the eventPassMode of sprite whichFlashSprite
the eventPassMode of member whichFlashMember
Type: Cast member property; sprite property
Description: This property controls when a Flash movie passes mouse events to sprite scripts. The eventPassMode property can have these values:
#passAlways Always pass mouse events.
#passButton Pass mouse events only when a button in the Flash movie is clicked.
#passNotButton Pass mouse events only when a nonbutton object is clicked.
#passNever Never pass mouse events.
The eventPassMode property can be tested and set. The default setting is #passAlways.
Example: This frame script checks to see if the buttons in a Flash movie sprite are currently enabled. If the buttons are enabled, the script sets the eventPassMode to #passNotButton; if the buttons are disabled, the script sets the eventPassMode to #passAlways. The effect of this script is that:
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 the buttonsEnabled of sprite 5 = TRUE then
		set the eventPassMode of sprite 5 = #passNotButton
	else
		set the eventPassMode of sprite 5 = #passAlways
	end if
end


Previous | Next