Arguments Object

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
Arguments Object Flash 5; caller property added in Flash 6

access to function arguments, the current function, and the calling function
arguments[elem] arguments.propertyName

Properties

callee

A reference to the function being executed.

caller

A reference to the calling function.

length

The number of arguments passed to the function being executed.

Description

The Arguments object is stored in the local arguments variable of every function and is accessible only while a function is executing. Arguments is both an array and an object. As an array, arguments stores the values of the parameters passed to the currently executing function. For example, arguments[0] is the first passed parameter, arguments[1] is the second passed parameter, and so on. All arguments passed are stored in the array, including those arguments not formally declared as parameters. As an object, Arguments stores the callee and the caller properties, which can be used to identify or invoke the current function and the calling function. As of Flash 6, arguments supports all Array methods and properties (pop( ), shift( ), etc.); prior to Flash 6, arguments supported the length property, but not the Array methods.

See Also

Section 9.8.2

     



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net