-- Lingo syntax _mouse.mouseMember // JavaScript syntax _mouse.mouseMember;
Mouse property; returns the cast member assigned to the sprite that is under the pointer when the property is called. Read-only.
When the pointer is not over a sprite, this property returns the result VOID (Lingo) or null (JavaScript syntax).
You can use this property 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.
The following statement checks whether the cast member Off Limits is the cast member assigned to the sprite under the pointer 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.
-- Lingo syntax
if (_mouse.mouseMember = member("Off Limits")) then
_player.alert("Stay away from there!")
end if
// JavaScript syntax
if (_mouse.mouseMember = member("Off Limits")) {
_player.alert("Stay away from there!");
}
This statement assigns the cast member of the sprite under the pointer to the variable lastMember:
-- Lingo syntax lastMember = _mouse.mouseMember // JavaScript syntax var lastMember = _mouse.mouseMember;