Arguments.callee - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

arguments.callee

Availability
Flash Player 5.
Usage
arguments.callee:Function
Description
Property; refers to the function that is currently being called.
Example
You can use the
arguments.callee
shown in the following example:
factorial = function (x:Number) {
if (x<=1) {
return 1;
} else {
return x*arguments.callee(x-1);
}
};
trace(factorial(3));
The following example is a named recursive function:
function factorial(x:Number):Number {
if (x<=1) {
return 1;
} else {
return x*factorial(x-1);
}
}
trace(factorial(4));
property to make an anonymous function that is recursive, as
// output: 6
// output: 24
arguments.callee
99

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents