Lingo Dictionary > A-C > clickMode

 

clickMode

Syntax

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

Description

Flash cast member and sprite property; controls when the Flash movie sprite detects mouse click events (mouseUp and mouseDown) and when it detects rollovers (mouseEnter, mouseWithin, and mouseLeave). The clickMode property can have these values:

#boundingBox—Detects mouse click events anywhere within the sprite's bounding rectangle and detects rollovers at the sprite's boundaries.

#opaque (default)—Detects mouse click events only when the pointer is over an opaque portion of the sprite and detects rollovers at the boundaries of the opaque portions of the sprite if the sprite's ink effect is set to Background Transparent. If the sprite's ink effect is not set to Background Transparent, this setting has the same effect as #boundingBox.

#object—Detects mouse click events when the mouse pointer is over any filled (nonbackground) area of the sprite and detects rollovers at the boundaries of any filled area. This setting works regardless of the sprite's ink effect.

This property can be tested and set.

Example

This script checks to see if the sprite, which is specified with an ink effect of Background Transparent, is currently set to be rendered direct to Stage. If the sprite is not rendered direct to Stage, the sprite's clickMode is set to #opaque. Otherwise (because ink effects are ignored for Flash movie sprites that are rendered direct to Stage), the sprite's clickMode is set to #boundingBox.

Dot syntax:

on beginSprite me
	if sprite(the spriteNum of me).directToStage = FALSE then
		sprite(the spriteNum of me).clickMode = #opaque
	else
		sprite(the spriteNum of me).clickMode = #boundingBox
	end if
end

Verbose syntax:

on beginSprite me
	if the directToStage of sprite the spriteNum of me = FALSE then
		set the clickMode of sprite the spriteNum of me = #opaque
	else
		set the clickMode of sprite the spriteNum of me = #boundingBox
	end if
end