User Guide

mouseOverButton 877
Example
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;
See also
castLibNum, Mouse
mouseOverButton
Usage
-- Lingo syntax
spriteObjRef.mouseOverButton
// JavaScript syntax
spriteObjRef.mouseOverButton;
Description
Flash sprite property; indicates whether the mouse pointer is over a button in a Flash movie sprite
specified by the
whichFlashSprite parameter (TRUE), or whether the mouse pointer is outside
the bounds of the sprite or the mouse pointer is within the bounds of the sprite but over a
nonbutton object, such as the background (
FALSE).
This property can be tested but not set.
Example
This frame script checks to see if the mouse pointer is over a navigation button in the Flash movie
in sprite 3. If the mouse pointer is over the button, the script updates a text field with an
appropriate message; otherwise, the script clears the message.
-- Lingo syntax
on enterFrame
case sprite(3).mouseOverButton of
TRUE:
member("Message Line").text = "Click here to go to the next page."
FALSE:
member("Message Line").text = " "
end case