on mouseDown (event handler)
181
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:
-- Lingo syntax
on keyUp
if (_key.key = RETURN) then _movie.go("AddSum")
end keyUp
// JavaScript syntax
function keyUp() {
if (_key.keyCode == 36) {
_movie.go("AddSum");
}
}
See also
on keyDown
,
keyDownScript
,
keyUpScript
on mouseDown (event handler)
Usage
-- Lingo syntax
on mouseDown
statement(s)
end
// JavaScript syntax
function mouseDown() {
statement(s);
}
Description
System message and event handler; contains statements that run when the mouse button
is pressed.
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...