arguments.caller
Availability
Flash Player 6.
Usage
arguments.caller:Function
Description
Property; refers to the calling function. The value of this property is
was not called by another function.
Example
The following example defines two functions—a caller function, named function1, which calls a
another function, named function2:
// define the caller function, named function1
var function1:Function = function () {
function2("hello from function1");
}
// define the callee function, named function2
var function2:Function = function (aString:String) {
if (arguments.caller == function1) {
trace("function2 was called by function1");
trace(aString);
}
}
// call function1
function1();
/*
Output:
function2 was called by function1
hello from function1
*/
100
Chapter 2: ActionScript Language Reference
if the current function
null
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?