125: BackUp
124: TurnRight
end case
end keyDown
// JavaScript syntax
function keyDown() {
switch (_key.keyCode) {
case 123: TurnLeft();
break;
case 126: GoForward();
break;
case 125: BackUp();
break;
case 124: TurnRight();
break;
}
}
See also
Key,
key
keyDownScript
Usage
the keyDownScript
Description
System property; specifies the Lingo that is executed when a key 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.
When a key is pressed and the
instructions specified for the
command so that the
pass
other
on keyDown
Setting the
keyDownScript
command that appeared in earlier versions of Director.
then
When the instructions you specify for the
turn them off by using the statement
Example
The following statement sets
. When this statement is in effect, the movie always goes to the next frame whenever
frame + 1
the user presses the Return key.
the keyDownScript = "if the key = RETURN then go to the frame + 1"
The following statement sets
custom handler must be enclosed in quotation marks when used with the
property.
the keyDownScript = "myCustomHandler"
keyDownScript
keyDownScript
message can be passed on to other objects in the movie, no
keyDown
handlers are executed.
property performs the same function as using the
set the keyDownScript to EMPTY
keyDownScript to if the key = RETURN then go to the
keyDownScript
property is defined, Lingo executes the
property first. Unless the instructions include the
property are no longer appropriate,
keyDownScript
to the custom handler
when keyDown
.
. A Lingo
myCustomHandler
keyDownScript
keyDownScript
821
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers