
ADOBE DIRECTOR 11.0
User Guide
295
Finding mouse pointer locations with Lingo or
JavaScript syntax
When working in Director, you sometimes need to determine where the mouse pointer is on the Stage.
Use the
mouseH
and
mouseV
properties. For more information about these properties, see the Scripting Reference
topics in the Director Help Panel.
The
mouseV
property returns the distance, in pixels, between the mouse pointer and the upper-left corner of the
Stage. The
mouseH
property returns the distance, in pixels, between the mouse pointer and the upper-left corner of
the Stage.
The statements
put the mouseH
and
put the mouseV
display the mouse pointer’s location in the Message window.
For example, the following handler directs the Message window to display the distance (in pixels) between the
pointer and the upper-left corner of the Stage:
on exitFrame
put(_mouse.mouseH)
put(_mouse.mouseV)
_movie.go(_movie.frame)
end
Checking keys with Lingo or JavaScript syntax
Lingo or JavaScript syntax can detect the last key that the user pressed. For more information, see the Scripting
Reference topics in the Director Help Panel.
•
To obtain the ANSI value of the last key that was pressed, use the
key
property.
•
To obtain the keyboard’s numerical (or ASCII) value for the last key pressed, use the
keyCode
property.
A common place for using
key
and
keyCode
is in an
on keyDown
handler, which instructs the script to check
the value of
key
only when a key is actually pressed. For example, the following handler in a frame script sends
the playhead to the next marker whenever the user presses Enter (Windows) or Return (Mac):
on keyDown
if the key = RETURN then go to marker (1)
end
Equivalent cross-platform keys
Keys on Windows and Mac computers don’t always directly correspond. This discrepancy can create confusion
because script often uses the same term to refer to corresponding keys on Windows and Mac computers, even
though the key’s name differs on the two platforms.
The following table lists script elements that refer to specific keys and the keys they represent on each platform.
Содержание 65036570 - Director - PC
Страница 1: ...i ADOBE DIRECTOR 11 USER GUIDE...