Lingo Dictionary > L-N > mouseMember |
![]() ![]() ![]() |
mouseMember
Syntax
the mouseMember
Description
System property; returns the cast member assigned to the sprite that is under the pointer when the property is called. When the pointer is not over a sprite, it returns the result VOID
.
The mouseMember
property replaces mouseCast
, used in earlier versions of Director.
You can use this function to make a movie perform specific actions when the pointer rolls over a sprite and the sprite uses a certain cast member.
The value of the mouseMember
property can change frequently. To use this property multiple times in a handler with a consistent value, assign the mouseMember
value to a local variable when the handler starts and use the variable.
For casts other than cast 1, mouseMember
returns a value that does not distinguish between the cast member and the cast number. To distinguish the cast member and the cast number, use the expression member (the mouseMember);
if the user doesn't click a sprite, however, this expression generates a script error.
Example
This statement checks whether the cast member Off Limits is the cast member assigned to the sprite under the cursor and displays an alert if it is. This example shows how you can specify an action based on the cast member assigned to the sprite.
if the mouseMember = member "Off Limits" then alert "Stay away from there!"
Example
This statement assigns the cast member of the sprite under the cursor to the variable lastMember
:
lastMember = the mouseMember
See also
member (sprite property)
, memberNum
, clickLoc
, mouseChar
, mouseItem
, mouseLine
, mouseWord
, rollOver()
, number (cast member property)
![]() ![]() ![]() |