mouseDownScript
871
// JavaScript syntax
function mouseEnter() {
if (_mouse.mouseDown) {
runMouseDownScript();
}
else {
runMouseUpScript();
}
}
See also
Mouse
,
on mouseDown (event handler)
,
mouseH
,
mouseUp
,
on mouseUp (event
handler)
,
mouseV
mouseDownScript
Usage
the mouseDownScript
Description
System property; specifies the Lingo that is executed when the mouse button is pressed. The
Lingo is written as a string, surrounded by quotation marks and can be a simple statement or a
calling script for a handler. The default value is
EMPTY
, which means that the
mouseDownScript
property has no Lingo assigned to it.
When the mouse button is pressed and the
mouseDownScript
property is defined, Lingo executes
the instructions specified for the
mouseDownScript
property first. No other
on mouseDown
handlers are executed, unless the instructions include the
pass
command so that the
mouseDown
message can be passed to other objects in the movie.
Setting the
mouseDownScript
property performs the same function as the
when keyDown then
command in earlier versions of Director.
To turn off the instructions you’ve specified for the
mouseDownScript
property, use the statement
set the mouseDownScript to empty
.
This property can be tested and set.
Example
In this statement, when the user clicks the mouse button, the playhead always branches to the
next marker in the movie:
the mouseDownScript = "go next"
In this statement, when the user clicks anywhere on the Stage, the computer beeps:
the mouseDownScript = "if the clickOn = 0 then beep"
The following statement sets
mouseDownScript
to the custom handler
myCustomHandler
. A
Lingo custom handler must be enclosed in quotation marks when used with the
mouseDownScript
property.
the mouseDownScript = "myCustomHandler"
See also
stopEvent()
,
mouseUpScript
,
on mouseDown (event handler)
,
on mouseUp (event
handler)
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...