﻿<!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="Error,globalClassifier.Error,-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,Array,Boolean,Number,Object,String,UTC,Vector,XML,XMLList,abs,acos,addNamespace,appendChild,apply,asin,atan2,atan,attribute,attribute,attributes,attributes,call,ceil,charAt,charCodeAt,child,childIndex,child,children,children,comments,comments,concat,concat,concat,contains,contains,copy,copy,cos,decodeURIComponent,decodeURI,defaultSettings,descendants,descendants,elements,elements,encodeURIComponent,encodeURI,escape,every,every,exec,exp,filter,filter,floor,forEach,forEach,fromCharCode,getDate,getDay,getFullYear,getHours,getMilliseconds,getMinutes,getMonth,getSeconds,getStackTrace,getTime,getTimezoneOffset,getUTCDate,getUTCDay,getUTCFullYear,getUTCHours,getUTCMilliseconds,getUTCMinutes,getUTCMonth,getUTCSeconds,hasComplexContent,hasComplexContent,hasOwnProperty,hasOwnProperty,hasOwnProperty,hasSimpleContent,hasSimpleContent,inScopeNamespaces,indexOf,indexOf,indexOf,insertChildAfter,insertChildBefore,int,isFinite,isNaN,isPrototypeOf,isXMLName,join,join,lastIndexOf,lastIndexOf,lastIndexOf,length,length,localName,localeCompare,log,map,map,match,max,min,name,namespaceDeclarations,namespace,nodeKind,normalize,normalize,parent,parent,parse,parseFloat,parseInt,pop,pop,pow,prependChild,processingInstructions,processingInstructions,propertyIsEnumerable,propertyIsEnumerable,propertyIsEnumerable,push,push,random,removeNamespace,replace,replace,reverse,reverse,round,search,setChildren,setDate,setFullYear,setHours,setLocalName,setMilliseconds,setMinutes,setMonth,setName,setNamespace,setPropertyIsEnumerable,setSeconds,setSettings,setTime,setUTCDate,setUTCFullYear,setUTCHours,setUTCMilliseconds,setUTCMinutes,setUTCMonth,setUTCSeconds,settings,shift,shift,sin,slice,slice,slice,some,some,sortOn,sort,sort,splice,splice,split,sqrt,substr,substring,tan,test,text,text,toDateString,toExponential,toExponential,toExponential,toFixed,toFixed,toFixed,toLocaleDateString,toLocaleLowerCase,toLocaleString,toLocaleString,toLocaleString,toLocaleTimeString,toLocaleUpperCase,toLowerCase,toPrecision,toPrecision,toPrecision,toString,toString,toString,toString,toString,toString,toString,toString,toString,toString,toString,toString,toString,toTimeString,toUTCString,toUpperCase,toXMLString,toXMLString,trace,uint,unescape,unshift,unshift,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf,valueOf"><title>Error (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 = 'Error - 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?Error.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">Error</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("Error"); 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 dynamic   class  Error</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">Error  <img src="images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> <a href="Object.html">Object</a></td></tr><tr><td class="classHeaderTableLabel">Subclasses</td><td> <a href="ArgumentError.html">ArgumentError</a>,  <a href="DefinitionError.html">DefinitionError</a>,  <a href="flash/errors/DRMManagerError.html">DRMManagerError</a>,  <a href="EvalError.html">EvalError</a>,  <a href="flash/errors/IllegalOperationError.html">IllegalOperationError</a>,  <a href="flash/errors/InvalidSWFError.html">InvalidSWFError</a>,  <a href="flash/errors/IOError.html">IOError</a>,  <a href="flash/errors/MemoryError.html">MemoryError</a>,  <a href="RangeError.html">RangeError</a>,  <a href="ReferenceError.html">ReferenceError</a>,  <a href="flash/errors/ScriptTimeoutError.html">ScriptTimeoutError</a>,  <a href="SecurityError.html">SecurityError</a>,  <a href="flash/errors/SQLError.html">SQLError</a>,  <a href="flash/errors/StackOverflowError.html">StackOverflowError</a>,  <a href="SyntaxError.html">SyntaxError</a>,  <a href="TypeError.html">TypeError</a>,  <a href="URIError.html">URIError</a>,  <a href="VerifyError.html">VerifyError</a>,  <a href="fl/video/VideoError.html">VideoError</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 9</td></tr></table><p></p><p></p><p></p>
        The Error class contains information about an error that occurred in a script. In developing ActionScript 3.0 applications,
 when you run your compiled code in the debugger version of Flash Player, a dialog box displays exceptions of type Error, 
 or of a subclass, to help you troubleshoot the code.
 You create an Error object by using the
        <code>Error</code>
        constructor function. 
 Typically, you throw a new Error object from within a
        <code>try</code>
        code block that is caught by a
        <code>catch</code>
        or
        <code>finally</code>
        code block.
        <p>You can also create a subclass of the Error class and throw instances of that subclass.</p>
        
            <p></p><p><a href="#includeExamplesSummary">View the examples</a></p><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="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="#errorID" class="signatureLink">errorID</a> : <a href="int.html">int</a><div class="summaryTableDescription">[read-only] Contains the reference number associated with the specific error message.</div></td><td class="summaryTableOwnerCol">Error</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#message" class="signatureLink">message</a> : <a href="String.html">String</a><div class="summaryTableDescription">Contains the message associated with the Error object.</div></td><td class="summaryTableOwnerCol">Error</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#name" class="signatureLink">name</a> : <a href="String.html">String</a><div class="summaryTableDescription">Contains the name of the Error object.</div></td><td class="summaryTableOwnerCol">Error</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 " id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Method</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#Error()" class="signatureLink">Error</a>(message:<a href="String.html">String</a> = "", id:<a href="int.html">int</a> = 0)</div><div class="summaryTableDescription">Creates a new Error object.</div></td><td class="summaryTableOwnerCol">Error</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getStackTrace()" class="signatureLink">getStackTrace</a>():<a href="String.html">String</a></div><div class="summaryTableDescription">Returns the call stack for an error as a string at the time of the error's construction (for the debugger version
  of Flash Player and the AIR Debug Launcher (ADL) only; returns null if not using the debugger version
  of Flash Player or the ADL.</div></td><td class="summaryTableOwnerCol">Error</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#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=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#toString()" class="signatureLink">toString</a>():<a href="String.html">String</a></div><div class="summaryTableDescription">Returns the string "Error" by default or the value contained in the Error.message property,
    if defined.</div></td><td class="summaryTableOwnerCol">Error</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="errorID"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">errorID</td><td class="detailHeaderType">property</td></tr></table><div class="detailBody"><code>errorID:<a href="int.html">int</a></code>&nbsp;&nbsp;[read-only] <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 9</td></tr></table><p></p><p></p><p>
          Contains the reference number associated with the specific error message. For a custom Error object,
     this number is the value from the
          <code>id</code>
          parameter supplied in the constructor.
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get errorID():<a href="int.html">int</a></code><br/></div><a name="propertyDetail"></a><a name="message"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">message</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>public var message:<a href="String.html">String</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 9</td></tr></table><p></p><p></p><p>
          Contains the message associated with the Error object. By default, the value of this property 
  is "
          <code>Error</code>
          ". You can specify a
          <code>message</code>
          property when you create an 
  Error object by passing the error string to the
          <code>Error</code>
          constructor function.
        </p><p><span class="label">See also</span></p><div class="seeAlso"><a href="statements.html#throw" target="">statements.html#throw</a><br/><a href="statements.html#try..catch..finally" target="">statements.html#try..catch..finally</a></div></div><a name="propertyDetail"></a><a name="name"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">name</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>public var name:<a href="String.html">String</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 9</td></tr></table><p></p><p></p><p>
          Contains the name of the Error object. By default, the value of this property is "
          <code>Error</code>
          ".
        </p><p><span class="label">See also</span></p><div class="seeAlso"><a href="statements.html#throw" target="">statements.html#throw</a><br/><a href="statements.html#try..catch..finally" target="">statements.html#try..catch..finally</a></div></div><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="Error()"></a><a name="Error(String,int)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">Error</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function Error(message:<a href="String.html">String</a> = "", id:<a href="int.html">int</a> = 0)</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 9</td></tr></table><p></p><p>
          Creates a new Error object. If
          <code>message</code>
          is specified, its value is assigned 
  to the object's
          <code>Error.message</code>
          property.
        </p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">message</span>:<a href="String.html">String</a></code> (default = "<code></code>")<code></code> &mdash; A string associated with the Error object; this parameter 
  is optional.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">id</span>:<a href="int.html">int</a></code> (default = <code>0</code>)<code></code> &mdash; A reference number to associate with the specific error message.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="statements.html#throw" target="">statements.html#throw</a><br/><a href="statements.html#try..catch..finally" target="">statements.html#try..catch..finally</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example creates a new Error object
          <code>err</code>
          and then, using the
          <code>Error()</code>
          constructor, assigns the string
          <code>"New Error Message"</code>
          to
          <code>err</code>
          .
          <div class="listing"><pre>var err:Error = new Error();
trace(err.toString());    // Error

err = new Error("New Error Message");
trace(err.toString());    // Error: New Error Message</pre></div>
        </div></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="getStackTrace()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getStackTrace</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> public function getStackTrace():<a href="String.html">String</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 9</td></tr></table><p></p><p></p><p>
          Returns the call stack for an error as a string at the time of the error's construction (for the debugger version
  of Flash Player and the AIR Debug Launcher (ADL) only; returns
          <code>null</code>
          if not using the debugger version
  of Flash Player or the ADL. As shown in the following example, the first line of the return value is the 
  string representation of the exception object, followed by the stack trace elements:
          <div class="listing"><pre>TypeError: null cannot be converted to an object
      at com.xyz.OrderEntry.retrieveData(OrderEntry.as:995)
      at com.xyz.OrderEntry.init(OrderEntry.as:200)
      at com.xyz.OrderEntry.$construct(OrderEntry.as:148)</pre></div>
          
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="String.html">String</a></code> &mdash; A string representation of the call stack.</td></tr></table></div><a name="toString()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">toString</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>override public function toString():<a href="String.html">String</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 9</td></tr></table><p></p><p></p><p>
          Returns the string
          <code>"Error"</code>
          by default or the value contained in the
          <code>Error.message</code>
          property,
    if defined.
        </p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="String.html">String</a></code> &mdash; The error message.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="Error.html#message" target="">Error.message</a><br/><a href="statements.html#throw" target="">statements.html#throw</a><br/><a href="statements.html#try..catch..finally" target="">statements.html#try..catch..finally</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example creates a new Error object
          <code>err</code>
          and then, using the
          <code>Error()</code>
          constructor, assigns the string
          <code>"New Error Message"</code>
          to
          <code>err</code>
          .  Finally, the
          <code>message</code>
          property is set to
          <code>"Another New Error Message"</code>
          ,
 which overwrites
          <code>"New Error Message"</code>
          .
          <div class="listing"><pre>var err:Error = new Error();
trace(err.toString());    // Error

err = new Error("New Error Message");
trace(err.toString());    // Error: New Error Message

err.message = "Another New Error Message";
trace(err.toString());    // Error: Another New Error Message</pre></div>
        </div></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">ErrorExample.as</div><br/><div class="detailBody">
        The following example uses the
        <code>ErrorExample</code>
        class to show 
 how a custom error can be generated.  This is accomplished with the following 
 steps:
        <ol><li>
            A local variable
            <code>nullArray</code>
            of Array type is declared, but notice 
 	that a new Array object is never created.
          </li><li>
            The constructor attempts to load a value into the uninitialized array by using
 	the
            <code>push()</code>
            method within an error handling code segment that catches a 
 	custom error by using the
            <code>CustomError</code>
            class, which extends
            <code>Error</code>
            .
          </li><li>
            When the CustomError is thrown, the constructor catches it and then outputs an 
  error message by using the
            <code>trace()</code>
            statement.
          </li></ol>
        
        <div class="listing"><pre>package
{
    import flash.display.Sprite;
    public class ErrorExample extends Sprite 
    {
        private var nullArray:Array;
        public function ErrorExample() 
        {
            try 
            {
                nullArray.push("item");
            }
            catch(e:Error) 
            {
                throw new CustomError("nullArray is null");
            }
        }
    }
}

class CustomError extends Error 
{
    public function CustomError(message:String) 
    {
        super(message);
    }
}</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">Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error Error </div></div></body></html><!-- &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  -->
