870
Chapter 14: Properties
Example
This statement determines whether the pointer is over a field sprite and changes the content of
the field cast member Instructions to “Please point to a character.” when it is not:
-- Lingo syntax
if (_mouse.mouseChar = -1) then
member("Instructions").text = "Please point to a character."
end if
// JavaScript syntax
if (_mouse.mouseChar == -1) {
member("Instructions").text = "Please point to a character.";
}
This statement assigns the character under the pointer in the specified field to the variable
currentChar
:
-- Lingo syntax
currentChar = member(_mouse.mouseMember).char[_mouse.mouseChar]
// JavaScript syntax
var currentChar = member(_mouse.mouseMember).getProp("char",
_mouse.mouseChar);
See also
Mouse
,
mouseItem
,
mouseLine
mouseDown
Usage
-- Lingo syntax
_mouse.mouseDown
// JavaScript syntax
_mouse.mouseDown;
Description
Mouse property; indicates whether the mouse button is currently being pressed (
TRUE
) or not
(
FALSE
). Read-only.
Example
The following
mouseEnter
handler that is attached to a sprite calls one handler if the mouse is
not down when the mouse enters the sprite, and calls a different handler if the mouse is not down
when the mouse enters the sprite.
-- Lingo syntax
on mouseEnter
if (_mouse.mouseDown) then
runMouseDownScript
else
runMouseUpScript
end if
end
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...