// JavaScript syntax
function checkCache() {
if (cacheSize() < 1000) {
alert("increasing cache to 1MB");
cacheSize(1000);
}
}
See also
cacheDocVerify(),
call
Usage
call #handlerName, script, {args...}
call (#handlerName, scriptInstance, {args...})
Description
Command; sends a message that invokes a handler in a specified script or list of scripts.
The
command can use a variable as the name of the handler. Messages passed using
call
not passed to other scripts attached to the sprite, cast member scripts, frame scripts, or movie
scripts.
Parameters
symHandlerName
scriptInstance
If
scriptInstance
in the script's ancestor script. If
to each item in the list in turn; if the handler is not defined in the ancestor script, no alert
is generated.
Optional. Any optional parameters to be passed to the handler.
args
Example
This handler sends the message bumpCounter to the first behavior script attached to sprite 1:
-- Lingo syntax
on mouseDown me
-- get the reference to the first behavior of sprite 1
set xref = getAt (the scriptInstanceList of sprite 1,1)
-- run the bumpCounter handler in the referenced script,
-- with a parameter
call (#bumpCounter, xref, 2)
end
// JavaScript syntax
function mouseDown() {
// get the reference to the first behavior of sprite 1
xref = getAt(sprite(1).script(1));
// run the bumpCounter handler in the referenced script
call(symbol("bumpcounter"), xref, 2);
}
250
Chapter 12: Methods
clearCache
Required. A symbol that specifies the handler to activate.
Required. A reference to the script or list of scripts that contains the handler.
is a single script instance, an error alert occurs if the handler is not defined
scriptInstance
is a list of script instances, the message is sent
are
call
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