User Guide
220
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.
Examples
This shows how to make the playhead jump to a specific frame depending on what frame is
passed in as the parameter:
on EvalScript aParam
go frame aParam
end
This handler runs the statement go frame aParam if it receives an EvalScript message that
includes dog, cat, or tree as an argument:
on EvalScript aParam
case aParam of
"dog", "cat", "tree": go frame aParam
end case
end
A possible calling statement for this in JavaScript would be EvalScript ("dog").
This handler takes an argument that can be a number or symbol:
on EvalScript aParam
if word 1 of aParam = "myHandler" then
do aParam
end if
end
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
string function:
on myHandler aParam
go to frame string(aParam)
end
See also
externalEvent, return (keyword)
eventPassMode
Syntax
sprite(whichFlashSprite).eventPassMode
the eventPassMode of sprite whichFlashSprite
member(whichFlashMember).eventPassMode
the eventPassMode of member whichFlashMember
Description
Flash cast member property and sprite property; controls when a Flash movie passes mouse events
to behaviors that are attached to sprites that lie underneath the flash sprite. The
eventPassMode
property can have these values:
• #passAlways (default)—Always passes mouse events.
• #passButton—Passes mouse events only when a button in the Flash movie is clicked.
• #passNotButton—Passes mouse events only when a nonbutton object is clicked.
• #passNever—Never passes mouse events.