Example
This shows how to make the playhead jump to a specific frame depending on what frame is
passed in as the parameter:
-- Lingo syntax
on EvalScript aParam
_movie.go(aParam)
end
// JavaScript syntax
function EvalScript(aParam) {
_movie.go(aParam);
}
This handler runs the statement
includes dog, cat, or tree as an argument:
-- Lingo syntax
on EvalScript aParam
case aParam of
"dog", "cat", "tree": _movie.go(aParam)
end case
end
// JavaScript syntax
function EvalScript(aParam) {
switch(aParam) {
case "dog", "cat", "tree": _movie.go(aParam);
}
}
A possible calling statement for this in JavaScript would be
This handler takes an argument that can be a number or symbol:
-- Lingo syntax
on EvalScript aParam
if word 1 of aParam = "myHandler" then
_movie.go(aParam)
end if
end
// JavaScript syntax
function EvalScript(aParam) {
if (aParam.indexOf("myHandler",0)) {
_movie.go(aParam);
}
}
The following handler normally requires a string as its argument. The argument is received as a
symbol and then converted to a string within the handler by the
-- Lingo syntax
on myHandler aParam
_movie.go(string(aParam))
end
// JavaScript syntax
function myHandler(aParam) {
_movie.go(aParam.toString());
}
See also
externalEvent(),
_movie.go(aParam)
return (keyword)
if it receives an
EvalScript
EvalScript ("dog")
function:
string
message that
.
on EvalScript
171
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