User Guide

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, dont 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.