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
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...