User Guide
Chapter 3150
commandDown
Syntax
the commandDown
Description
Function; determines whether the Control key (Windows) or the Command key (Macintosh) is
being pressed (TRUE) or not (FALSE).
You can use
commandDown together with the element the key to determine when the Control or
Command key is pressed in combination with another key. This lets you create handlers that are
executed when the user presses specified Control or Command key combinations.
Control or Command key equivalents for the Director authoring menus take precedence while
the movie is playing, unless you have installed custom Lingo menus or are playing a projector
version of the movie.
For a movie playing back with the Director player for Java, this function returns
TRUE only if a
second key is pressed simultaneously with the Control or Command key. If the Control or
Command key is pressed by itself,
commandDown returns FALSE. This is because the browser
receives the keys before the movie and thus responds to and intercepts any key combinations that
are also browser keyboard shortcuts. For example, if the user presses Control+R or Command+R,
the browser reloads the current page; the movie never receives the key combination.
Example
These statements pause a projector whenever the user presses Control+A or Command+A. By
setting the
keyDownScript property to doCommandKey, the on prepareMovie handler makes the
doCommandKey handler the first event handler executed when a key is pressed. The doCommandKey
handler checks whether the Control+A or Command+A keys are pressed at the same time and
pauses the movie if they are.
on prepareMovie
the keyDownScript = "doCommandKey"
end
on doCommandKey
if (the commandDown) and (the key = "a") then go to the frame
end
See also
controlDown, key(), keyCode(), optionDown, shiftDown
comments
Syntax
member.comments
the comments of member
Description
This cast member property provides a place to store any comments you want to maintain about
the given cast member, or any other strings you want to associate with the member. This property
can be tested and set. It can also be set in the Property inspector’s Member tab.