170
Chapter 10: Events and Messages
Example
This handler turns off the puppet condition for sprites 1 through 5 each time the playhead enters
the frame:
-- Lingo syntax
on enterFrame
repeat with i = 1 to 5
_movie.puppetSprite(i, FALSE)
end repeat
end
// JavaScript syntax
function enterFrame() {
for (i=1;i<=5;i++) {
_movie.puppetSprite(i, false);
}
}
on EvalScript
Usage
-- Lingo syntax
on EvalScript
aParam
statement(s)
end
// JavaScript syntax
function EvalScript(
aParam
) {
statement(s)
;
}
Description
System message and event handler; in a movie with Macromedia Shockwave content, contains
statements that run when the handler receives an
EvalScript
message from a browser. The
parameter is a string passed in from the browser.
•
The
EvalScript
message can include a string that Director can interpret as a Lingo statement.
Lingo cannot accept nested strings. If the handler you are calling expects a string as a
parameter, pass the parameter as a symbol.
•
The
on EvalScript
handler is called by the
EvalScript()
scripting method from JavaScript
or VBScript in a browser.
Include only those behaviors in
on EvalScript
that you want users to control; for security
reasons, don’t give complete access to behaviors.
Note:
If you place a return at the end of your EvalScript handler, the value returned can be used by
JavaScript in the browser.
Summary of Contents for DIRECTOR MX 2004
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...