MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 237

Actionscript language reference
Table of Contents

Advertisement

arguments object
Availability
Flash Player 5; property added in Flash Player 6.
Description
The arguments object is an array that contains the values that were passed as parameters to any
function. Each time a function is called in ActionScript, an arguments object is automatically
created for that function. A local variable,
arguments object.
Property summary for the arguments object
Property
arguments.callee
arguments.caller
arguments.length
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);
arguments
Description
A reference to the function being called.
A reference to the calling function.
The number of parameters passed to a function.
property to make an anonymous function that is recursive, as
// output: 6
ActionScript Core Classes
, is also created and lets you refer to the
arguments.callee
CHAPTER 6
237

Advertisement

Table of Contents
loading
Need help?

Need help?

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

This manual is also suitable for:

Flex

Table of Contents