﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="book" content="ActionScript&nbsp;3.0&nbsp;Language&nbsp;and&nbsp;Components&nbsp;Reference"><link rel="stylesheet" href="style.css" type="text/css" media="screen"><link rel="stylesheet" href="print.css" type="text/css" media="print"><link rel="stylesheet" href="override.css" type="text/css"><meta name="keywords" content="arguments,globalClassifier.arguments,-Infinity,CASEINSENSITIVE,DESCENDING,E,Infinity,LN10,LN2,LOG10E,LOG2E,MAX_VALUE,MAX_VALUE,MAX_VALUE,MIN_VALUE,MIN_VALUE,MIN_VALUE,NEGATIVE_INFINITY,NUMERIC,NaN,NaN,PI,POSITIVE_INFINITY,RETURNINDEXEDARRAY,SQRT1_2,SQRT2,UNIQUESORT,callee,constructor,date,dateUTC,day,dayUTC,dotall,errorID,extended,fixed,fullYear,fullYearUTC,global,hours,hoursUTC,ignoreCase,ignoreComments,ignoreProcessingInstructions,ignoreWhitespace,lastIndex,length,length,length,length,localName,message,milliseconds,millisecondsUTC,minutes,minutesUTC,month,monthUTC,multiline,name,prefix,prettyIndent,prettyPrinting,prototype,seconds,secondsUTC,source,time,timezoneOffset,undefined,uri,uri"><title>arguments (ActionScript 3.0)</title><script src="AC_OETags.js" type="text/javascript"></script></head><body><script language="javascript" type="text/javascript" src="asdoc.js"></script><script language="javascript" type="text/javascript" src="help.js"></script><script language="javascript" type="text/javascript" src="cookies.js"></script><script language="javascript" type="text/javascript">  
            <!--  
			    
				asdocTitle = 'arguments - ActionScript 3.0 Language and Components Reference';

				var baseRef = '';

				window.onload = configPage;
			      
			    -->  
            </script>
<script language="javascript" type="text/javascript"><!--
function submitValue(){
var searchStr=document.getElementById('search-livedocs').value;
window.location="search.html"+"###"+searchStr;
}
--></script><script type="text/javascript">
		scrollToNameAnchor();
	</script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">ActionScript 3.0 Language and Components Reference</td><td class="titleTableSearch" align="center"><form class="searchForm" method="get" action="search.html" onsubmit="submitValue();"><input class="hidden" name="loc" value="" type="hidden"><input class="hidden" name="termPrefix" value="" type="hidden"><input class="hidden" name="term" value="" type="hidden"><input class="hidden" name="area" value="" type="hidden"><input id="search-livedocs" name="search_text" value="" title="" type="text"> <input type="button" name="action" value="Search" onclick="submitValue()"></form></td><td class="titleTableTopNav" align="right"><a href="../../Flash/10.0_Welcome/index.html">Home</a>&nbsp;|&nbsp;<a href="package-summary.html" onclick="loadClassListFrame('all-classes.html')">All Packages</a>&nbsp;|&nbsp;<a href="class-summary.html" onclick="loadClassListFrame('all-classes.html')">All Classes</a>&nbsp;|&nbsp;<a href="language-elements.html">Language Elements</a>&nbsp;| <a href="all-index-Symbols.html" onclick="loadClassListFrame('index-list.html')">Index</a>&nbsp;|&nbsp;<a href="appendixes.html">Appendixes</a>&nbsp;|&nbsp;<a href="conventions.html">Conventions</a>&nbsp;|&nbsp;<a id="framesLink1" href="index.html?arguments.html&amp;">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="images/logo.jpg" class="logoImage" alt=" Adobe Logo " title=" Adobe Logo "></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">arguments</td><td class="titleTableSubNav" id="subNav" align="right" colspan="2"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#eventSummary">Events</a>&nbsp;| <a href="#styleSummary">Styles</a>&nbsp;| <a href="#effectSummary">Effects</a>&nbsp;| <a href="#constantSummary">Constants</a>&nbsp;| <a href="#includeExamplesSummary">Examples</a></td></tr><tr class="titleTableRow3"><td colspan="3">&nbsp;</td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve">
                
                    
                

				<!--

				
				    
				

					if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("arguments"); titleBar_setSubNav(false,true,false	,false,false,false,true,true,false	,false,false,false,false,false);}

				    
				        
				    
				-->
                
                    
                
			</script><div class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">Top Level</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public  class  arguments</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">arguments  <img src="images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> <a href="Object.html">Object</a></td></tr></table><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 8</td></tr></table><p></p><p></p><p></p>
        An arguments object is used to store and access a function's arguments. 
 Within a function's body, you can access its arguments object by using the local arguments 
 variable.
        <p>
          The arguments are stored as array elements: the first is accessed as
          <code>arguments[0]</code>
          , the second as
          <code>arguments[1]</code>
          , and so on. The
          <code>arguments.length</code>
          property indicates the number of arguments passed to
 the function. There may be a different number of arguments passed than 
 the function declares.
        </p>
        
               <p>
          Unlike previous versions of ActionScript, ActionScript 3.0 has no
          <code>arguments.caller</code>
          property.
 To get a reference to the function
 that called the current function, you must pass a reference to that function as an
 argument. An example of this technique can be found in the example for
          <code>arguments.callee</code>
          .
        </p>
        
               <p>
          ActionScript 3.0 includes a new
          <code>...(rest)</code>
          keyword that is recommended instead of the 
 arguments class.
        </p>
        
            <p></p><p><a href="#includeExamplesSummary">View the examples</a></p><p><span class="classHeaderTableLabel">See also</span></p><div class="seeAlso"><a href="statements.html#..._(rest)_parameter" target="">...(rest)</a><br/><a href="Function.html" target="">Function</a></div><br/><hr></div><a name="propertySummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Properties</div><div class="showHideLinks"><div id="hideInheritedProperty" class="hideInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(false,'Property');"><img class="showHideLinkImage" src="images/expanded.gif"> Hide Inherited Public Properties</a></div><div id="showInheritedProperty" class="showInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(true,'Property');"><img class="showHideLinkImage" src="images/collapsed.gif"> Show Inherited Public Properties</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableProperty"><tr><th>&nbsp;</th><th colspan="2">Property</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#callee" class="signatureLink">callee</a> : <a href="Function.html">Function</a><div class="summaryTableDescription">A reference to the currently executing function.</div></td><td class="summaryTableOwnerCol">arguments</td></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="Object.html#constructor" class="signatureLink">constructor</a> : <a href="Object.html">Object</a><div class="summaryTableDescription">A reference to the class object or constructor function for a given object instance.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#length" class="signatureLink">length</a> : <a href="Number.html">Number</a><div class="summaryTableDescription">The number of arguments passed to the function.</div></td><td class="summaryTableOwnerCol">arguments</td></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="Object.html#prototype" class="signatureLink">prototype</a> : <a href="Object.html">Object</a><div class="summaryTableDescription">[static] A reference to the prototype object of a class or function object.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr></table></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><div class="showHideLinks"><div id="hideInheritedMethod" class="hideInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(false,'Method');"><img class="showHideLinkImage" src="images/expanded.gif"> Hide Inherited Public Methods</a></div><div id="showInheritedMethod" class="showInheritedMethod"><a class="showHideLink" href="#methodSummary" onclick="javascript:setInheritedVisible(true,'Method');"><img class="showHideLinkImage" src="images/collapsed.gif"> Show Inherited Public Methods</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable hideInheritedMethod" id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Method</th><th>Defined By</th></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="Object.html#hasOwnProperty()" class="signatureLink">hasOwnProperty</a>(name:<a href="String.html">String</a>):<a href="Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether an object has a specified property defined.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="Object.html#isPrototypeOf()" class="signatureLink">isPrototypeOf</a>(theClass:<a href="Object.html">Object</a>):<a href="Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether an instance of the Object class is in the prototype chain of the object specified 
  as the parameter.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="Object.html#propertyIsEnumerable()" class="signatureLink">propertyIsEnumerable</a>(name:<a href="String.html">String</a>):<a href="Boolean.html">Boolean</a></div><div class="summaryTableDescription">Indicates whether the specified property exists and is enumerable.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="Object.html#setPropertyIsEnumerable()" class="signatureLink">setPropertyIsEnumerable</a>(name:<a href="String.html">String</a>, isEnum:<a href="Boolean.html">Boolean</a> = true):<a href="specialTypes.html#void">void</a></div><div class="summaryTableDescription">Sets the availability of a dynamic property for loop operations.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="Object.html#toString()" class="signatureLink">toString</a>():<a href="String.html">String</a></div><div class="summaryTableDescription">Returns the string representation of the specified object.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="Object.html#valueOf()" class="signatureLink">valueOf</a>():<a href="Object.html">Object</a></div><div class="summaryTableDescription">Returns the primitive value of the specified object.</div></td><td class="summaryTableOwnerCol"><a href="Object.html">Object</a></td></tr></table></div><script language="javascript" type="text/javascript"><!--
                      showHideInherited();
                      --></script><div class="MainContent"><div class="detailSectionHeader">Property Detail</div><a name="propertyDetail"></a><a name="callee"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">callee</td><td class="detailHeaderType">property</td></tr></table><div class="detailBody"><code>public var callee:<a href="Function.html">Function</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 8</td></tr></table><p></p><p></p><p>A reference to the currently executing function.</p><br/><span class="label"> Example </span><br/><div class="detailBody">
          The following code shows how to get a reference to the function
 that calls the function named
          <code>secondFunction()</code>
          . The
          <code>firstFunction()</code>
          function has
 the Boolean argument of
          <code>true</code>
          to demonstrate that
          <code>secondFunction()</code>
          successfully calls
          <code>firstFunction()</code>
          and
 to prevent an infinite loop of each function calling the other.
          <p>
            Because the
            <code>callSecond</code>
            parameter is
            <code>true</code>
            ,
            <code>firstFunction()</code>
            calls
            <code>secondFunction()</code>
            and passes a reference to itself as the only
 argument. The function
            <code>secondFunction()</code>
            receives this argument and stores it
 using a parameter named
            <code>caller</code>
            , which is of data type Function. From within
            <code>secondFunction()</code>
            , the
            <code>caller</code>
            parameter is then used to call the
            <code>firstFunction</code>
            function,
 but this time with the
            <code>callSecond</code>
            argument set to
            <code>false</code>
            .
          </p>
          
          <p>
            When execution returns to
            <code>firstFunction()</code>
            , the
            <code>trace()</code>
            statement is executed because
            <code>callSecond</code>
            is
            <code>false</code>
            .
          </p>
          
          <div class="listing"><pre>package {
    import flash.display.Sprite;
    
    public class ArgumentsExample extends Sprite {
        private var count:int = 1;
        
        public function ArgumentsExample() {
            firstFunction(true);
        }

        public function firstFunction(callSecond:Boolean) {
            trace(count + ": firstFunction");
            if(callSecond) {
                secondFunction(arguments.callee);
            }
            else {
                trace("CALLS STOPPED");
            }
        }

        public function secondFunction(caller:Function) {
            trace(count + ": secondFunction\n");
            count++;
            caller(false);
        }        
    }
}</pre></div>
        </div></div><a name="propertyDetail"></a><a name="length"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">length</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>public var length:<a href="Number.html">Number</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Language Version:&nbsp;</b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b>Runtime Versions:&nbsp;</b></td><td>AIR 1.0, Flash Player 8</td></tr></table><p></p><p></p><p>The number of arguments passed to the function. This may be more or less
  than the function declares.</p></div><a name="includeExamplesSummary"></a><div class="detailSectionHeader">Examples<span class="usage"><a href="ExampleInstruct.html"> How to use examples </a></span></div><div class="exampleHeader">ArgumentsExample.as</div><br/><div class="detailBody">
        The following example shows uses for various
        <code>arguments</code>
        properties,
 such as
        <code>callee</code>
        and
        <code>length</code>
        .
        <div class="listing"><pre>package {
    import flash.display.Sprite;
    
    public class ArgumentsExample extends Sprite {
        public function ArgumentsExample() {
                println("Hello World");
        }
        
        public function println(str:String):void {
            trace(arguments.callee == this.println); // true
            trace(arguments.length);                 // 1
            trace(arguments[0]);                     // Hello World
            trace(str);                                // Hello World
        }
    }
}</pre></div>
      </div><br/><br/><hr><br/><p></p><center class="copyright"> &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  </center><div style="display:none">arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments arguments </div></div></body></html><!-- &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  -->
