EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 870

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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