333
When a key is released, Lingo searches these locations, in order, for an
on keyUp
handler: primary
event handler, editable field sprite script, field cast member script, frame script, and movie script.
For sprites and cast members,
on keyUp
handlers work only for editable strings. A
keyUp
event on
a different type of cast member, such as a bitmap, has no effect. If releasing a key should always
have the same response throughout the movie, set
keyUpScript
.
Lingo stops searching when it reaches the first location that has an
on keyUp
handler, unless the
handler includes the
pass
command to explicitly pass the
keyUp
message on to the next location.
The
on keyUp
event handler is a good place to put Lingo that implements keyboard shortcuts or
other interface features that you want to occur when the user releases keys.
The Director player for Java responds to
keyUp
messages only if the movie has focus in the browser.
The user must click in the applet before the applet can receive any keys that the user types.
When the movie plays back as an applet, an
on keyUp
handler always traps key presses, even if the
handler is empty. If the user is typing in an editable field, an
on keyUp
handler attached to the
field must include the
pass
command for the key to appear in the field.
Where you place an
on keyUp
handler can affect when it runs, as follows:
•
To apply the handler to a specific editable field sprite, put it in a behavior.
•
To apply the handler to an editable field cast member in general, put it in a cast member script.
•
To apply the handler to an entire frame, put it in a frame script.
•
To apply the handler throughout the entire movie, put it in a movie script.
You can override an
on keyUp
handler by placing an alternative
on keyUp
handler in a location
that Lingo checks before it gets to the handler you want to override. For example, you can
override an
on keyUp
handler assigned to a cast member by placing an
on keyUp
handler in a
sprite script.
Example
This handler checks whether the Return key was released and if it was, sends the playhead to
another frame:
on keyUp
if the key = RETURN then go to frame "AddSum"
end keyUp
See also
on keyDown
,
keyDownScript
,
keyUpScript
keyUpScript
Syntax
the keyUpScript
Description
System property; specifies the Lingo that is executed when a key is released. 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 released and the
keyUpScript
property is defined, Lingo executes the instructions
specified for the
keyUpScript
property first. Unless the instructions include the
pass
command
so that the
keyUp
message can be passed on to other objects in the movie, no other
on keyUp
handlers are executed.
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...