﻿<!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="int,globalClassifier.int,-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>int (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 = 'int - 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?int.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">int</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("int"); titleBar_setSubNav(true,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 final   class  int</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">int  <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 9</td></tr></table><p></p><p></p><p></p>
        The int class lets you work with the data type representing a 32-bit signed integer. 
 The range of values represented by the int class is -2,147,483,648 (-2^31) to 2,147,483,647 (2^31-1).
        <p>
          The constant properties of the int class,
          <code>MAX_VALUE</code>
          and
          <code>MIN_VALUE</code>
          , are static, which means that you don't need an object to use them, so you don't need to use the constructor. The methods, however, are not static, which means that you do need an object to use them. You can create an int object by using the int class constructor or by declaring a variable of type int and assigning the variable a literal value.
        </p>
        
               <p>
          The int data type is useful for loop counters and other situations where a floating point number is not needed, and is similar to the int data type in Java and C++. The default value of a variable typed as int is
          <code>0</code>
               </p>
        
               <p>
          If you are working with numbers that exceed
          <code>int.MAX_VALUE</code>
          , consider using Number.
        </p>
        
               <p>
          The following example calls the
          <code>toString()</code>
          method of the int class, which returns the string
          <code>1234</code>
          :
        </p>
        
               <div class="listing" version="3.0"><pre>var myint:int = 1234;
 myint.toString();</pre></div>
        
               <p>
          The following example assigns the value of the
          <code>MIN_VALUE</code>
          property to a variable declared without the use of the constructor:
        </p>
        
               <pre>var smallest:int = int.MIN_VALUE;</pre>
        
            <p></p><p><a href="#includeExamplesSummary">View the examples</a></p><p><span class="classHeaderTableLabel">See also</span></p><div class="seeAlso"><a href="uint.html" target="">uint</a><br/><a href="Number.html" target="">Number</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 hideInheritedProperty" 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="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="#int()" class="signatureLink">int</a>(num:<a href="Object.html">Object</a>)</div><div class="summaryTableDescription">Constructor; creates a new int object.</div></td><td class="summaryTableOwnerCol">int</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="#toExponential()" class="signatureLink">toExponential</a>(fractionDigits:<a href="uint.html">uint</a>):<a href="String.html">String</a></div><div class="summaryTableDescription">Returns a string representation of the number in exponential notation.</div></td><td class="summaryTableOwnerCol">int</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#toFixed()" class="signatureLink">toFixed</a>(fractionDigits:<a href="uint.html">uint</a>):<a href="String.html">String</a></div><div class="summaryTableDescription">Returns a string representation of the number in fixed-point notation.</div></td><td class="summaryTableOwnerCol">int</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#toPrecision()" class="signatureLink">toPrecision</a>(precision:<a href="uint.html">uint</a>):<a href="String.html">String</a></div><div class="summaryTableDescription">Returns a string representation of the number either in exponential notation or in
      fixed-point notation.</div></td><td class="summaryTableOwnerCol">int</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>(radix:<a href="uint.html">uint</a>):<a href="String.html">String</a></div><div class="summaryTableDescription">Returns the string representation of an int object.</div></td><td class="summaryTableOwnerCol">int</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#valueOf()" class="signatureLink">valueOf</a>():<a href="int.html">int</a></div><div class="summaryTableDescription">Returns the primitive value of the specified int object.</div></td><td class="summaryTableOwnerCol">int</td></tr></table></div><a name="constantSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Constants</div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableConstant"><tr><th>&nbsp;</th><th colspan="2">Constant</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#MAX_VALUE" class="signatureLink">MAX_VALUE</a> : <a href="int.html">int</a> = 2147483647<div class="summaryTableDescription">[static] The largest representable 32-bit signed integer, which is 2,147,483,647.</div></td><td class="summaryTableOwnerCol">int</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#MIN_VALUE" class="signatureLink">MIN_VALUE</a> : <a href="int.html">int</a> = -2147483648<div class="summaryTableDescription">[static] The smallest representable 32-bit signed integer, which is -2,147,483,648.</div></td><td class="summaryTableOwnerCol">int</td></tr></table></div><script language="javascript" type="text/javascript"><!--
                      showHideInherited();
                      --></script><div class="MainContent"><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="int()"></a><a name="int(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">int</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function int(num:<a href="Object.html">Object</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>
          Constructor; creates a new int object. You must use the int constructor when using
          <code>int.toString()</code>
          and
          <code>int.valueOf()</code>
          . You do not use a constructor when using the properties of an int object. The
          <code>new int</code>
          constructor is primarily used as a placeholder. An int object is not the same as the
          <code>int()</code>
          function that converts a parameter to a primitive value.
        </p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">num</span>:<a href="Object.html">Object</a></code> &mdash; 
              The numeric value of the int object being created or a value to be converted to a&nbsp;number. The default value is 0 if
              <code>value</code>
              is not provided.
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="int.html#toString()" target="">int.toString()</a><br/><a href="int.html#valueOf()" target="">int.valueOf()</a></div><br/><span class="label"> Example </span><br/><span class="usage"><a href="ExampleInstruct.html"> How to use examples </a></span><br/>
          The following code constructs new int objects:
          <pre>var n1:int = new int(3.4);
  var n2:int = new int(-10);</pre>
          
        </div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="toExponential()"></a><a name="toExponential(uint)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">toExponential</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function toExponential(fractionDigits:<a href="uint.html">uint</a>):<a href="String.html">String</a></code><p></p><p></p><p>
          Returns a string representation of the number in exponential notation. The string contains
      one digit before the decimal point and up to 20 digits after the decimal point, as
      specified by the
          <code>fractionDigits</code>
          parameter.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">fractionDigits</span>:<a href="uint.html">uint</a></code> &mdash; An integer between 0 and 20, inclusive, that represents the desired number of decimal places.</td></tr></table></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></td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="RangeError.html">RangeError</a> </code> &mdash; 
              Throws an exception if the
              <code>fractionDigits</code>
              argument is outside the range 0 to 20.
            </td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows how
          <code>toExponential(2)</code>
          returns a string in
 exponential notation.
          <div class="listing"><pre>var num:Number = 315003;
trace(num.toExponential(2)); // 3.15e+5</pre></div>
        </div></div><a name="toFixed()"></a><a name="toFixed(uint)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">toFixed</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function toFixed(fractionDigits:<a href="uint.html">uint</a>):<a href="String.html">String</a></code><p></p><p></p><p>
          Returns a string representation of the number in fixed-point notation. 
     Fixed-point notation means that the string will contain a specific number of digits 
     after the decimal point, as specified in the
          <code>fractionDigits</code>
          parameter.
     The valid range for the
          <code>fractionDigits</code>
          parameter is from 0 to 20. 
     Specifying a value outside this range throws an exception.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">fractionDigits</span>:<a href="uint.html">uint</a></code> &mdash; An integer between 0 and 20, inclusive, that represents the desired number of decimal places.</td></tr></table></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></td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="RangeError.html">RangeError</a> </code> &mdash; 
              Throws an exception if the
              <code>fractionDigits</code>
              argument is outside the range 0 to 20.
            </td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows how
          <code>toFixed(3)</code>
          returns a string that rounds
 to three decimal places.
          <div class="listing"><pre>var num:Number = 7.31343;
trace(num.toFixed(3)); // 7.313</pre></div>
        </div><br/><div class="detailBody">
          The following example shows how
          <code>toFixed(2)</code>
          returns a string that adds
 trailing zeroes.
          <div class="listing"><pre>var num:Number = 4;
trace(num.toFixed(2)); // 4.00</pre></div>
        </div></div><a name="toPrecision()"></a><a name="toPrecision(uint)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">toPrecision</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function toPrecision(precision:<a href="uint.html">uint</a>):<a href="String.html">String</a></code><p></p><p></p><p>
          Returns a string representation of the number either in exponential notation or in
      fixed-point notation. The string will contain the number of digits specified in the
          <code>precision</code>
          parameter.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">precision</span>:<a href="uint.html">uint</a></code> &mdash; An integer between 1 and 21, inclusive, that represents the desired number of digits to represent in the resulting string.</td></tr></table></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></td></tr></table><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="RangeError.html">RangeError</a> </code> &mdash; 
              Throws an exception if the
              <code>precision</code>
              argument is outside the range 1 to 21.
            </td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
          The following example shows how
          <code>toPrecision(3)</code>
          returns a string with
 only three digits. The string is in fixed-point notation because exponential notation is not required.
          <div class="listing"><pre>var num:Number = 31.570;
trace(num.toPrecision(3)); // 31.6</pre></div>
        </div><br/><div class="detailBody">
          The following example shows how
          <code>toPrecision(3)</code>
          returns a string with
 only three digits. The string is in exponential notation because the resulting number does not
 contain enough digits for fixed-point notation.
          <div class="listing"><pre>var num:Number = 4000;
trace(num.toPrecision(3)); // 4.00e+3</pre></div>
        </div></div><a name="toString()"></a><a name="toString(uint)"></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> <a href="statements.html#AS3">AS3</a> function toString(radix:<a href="uint.html">uint</a>):<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 representation of an
          <code>int</code>
          object.
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">radix</span>:<a href="uint.html">uint</a></code> &mdash; 
              Specifies the numeric base (from 2 to 36) to use for the number-to-string conversion. If you do not specify the
              <code>radix</code>
              parameter, the default value is 10.
            </td></tr></table></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.</td></tr></table><br/><span class="label"> Example </span><br/><span class="usage"><a href="ExampleInstruct.html"> How to use examples </a></span><br/>
          The following example uses 2 and 8 for the
          <code>radix</code>
          parameter and returns a string that contains the corresponding representation of the number 9:
          <pre>var myint:int = new int(9);
  trace(myint.toString(2)); // 1001
  trace(myint.toString(8)); // 11</pre>
          
          <p>The following example results in a hexadecimal value.</p>
          
          <pre>var r:int = new int(250);
  var g:int = new int(128);
  var b:int = new int(114);
  var rgb:String = "0x"+ r.toString(16)+g.toString(16)+b.toString(16);
  trace(rgb); // 0xfa8072</pre>
          
        </div><a name="valueOf()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">valueOf</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> <a href="statements.html#AS3">AS3</a> function valueOf():<a href="int.html">int</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 primitive value of the specified int object.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="int.html">int</a></code> &mdash; An int value.</td></tr></table><br/><span class="label"> Example </span><br/><span class="usage"><a href="ExampleInstruct.html"> How to use examples </a></span><br/>
          The following example results in the primative value of the
          <code>numSocks</code>
          object.
          <pre>var numSocks:int = new int(2);
  trace(numSocks.valueOf()); // 2</pre>
          
        </div><div class="detailSectionHeader">Constant Detail</div><a name="constantDetail"></a><a name="MAX_VALUE"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">MAX_VALUE</td><td class="detailHeaderType">Constant</td></tr></table><div class="detailBody"><code>public static const MAX_VALUE:<a href="int.html">int</a> = 2147483647</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>The largest representable 32-bit signed integer, which is 2,147,483,647.</p><br/><span class="label"> Example </span><br/><span class="usage"><a href="ExampleInstruct.html"> How to use examples </a></span><br/>
          The following ActionScript
          <span src="flashonly">displays</span>
          
          the largest and smallest representable int objects
          <span src="flashonly">to the Output panel</span>
          
          :
          <pre>trace("int.MIN_VALUE = "+int.MIN_VALUE);
 trace("int.MAX_VALUE = "+int.MAX_VALUE);</pre>
          
          <p>
            This code
            
            <span src="flashonly">displays</span>
            the following values:
          </p>
          
          <pre>int.MIN_VALUE = -2147483648
 int.MAX_VALUE = 2147483647</pre>
          
        </div><a name="constantDetail"></a><a name="MIN_VALUE"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">MIN_VALUE</td><td class="detailHeaderType">Constant</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>public static const MIN_VALUE:<a href="int.html">int</a> = -2147483648</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>The smallest representable 32-bit signed integer, which is -2,147,483,648.</p><br/><span class="label"> Example </span><br/><span class="usage"><a href="ExampleInstruct.html"> How to use examples </a></span><br/>
          The following ActionScript
          <span src="flashonly">displays</span>
          
          the largest and smallest representable int objects
          <span src="flashonly">to the Output panel</span>
          
          :
          <pre>trace("int.MIN_VALUE = "+int.MIN_VALUE);
     trace("int.MAX_VALUE = "+int.MAX_VALUE);</pre>
          
          <p>
            This code
            
            <span src="flashonly">displays</span>
            the following values:
          </p>
          
          <pre>int.MIN_VALUE = -2147483648
 int.MAX_VALUE = 2147483647</pre>
          
        </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">IntExample.as</div><br/><div class="detailBody">
        The following example uses the
        <code>IntExample</code>
        class to show how 
 to work with and check the validity of int data types:
        <ol><li>
            Two int variables
            <code>a</code>
            and
            <code>b</code>
            are declared in the constructor.
          </li><li>
            The two ints are added using the method
            <code>addIntegers()</code>
            .
          </li><li>
            A third int variable
            <code>c</code>
            is assigned the outcome of
            <code>parseInteger()</code>
            ,
 	which checks the validity of the string passed to it to ensure that it is an integer value
 	in the acceptable range for int data types and returns an int equal to the integer value
 	of the string if it is valid.
          </li><li>
            The int variables
            <code>a</code>
            and
            <code>c</code>
            are added together using
            <code>addIntegers()</code>
            .
          </li></ol>
        
        <div class="listing"><pre>package {
    import flash.display.Sprite;

    public class IntExample extends Sprite {    
        public function IntExample() {
            var a:int = 512;
            var b:int = -128;
            
            trace(addIntegers(a, b)); // 384

            var c:int = parseInteger("32");
            
            trace(addIntegers(a, c)); // 544
        }
            
        public function addIntegers(a:int, b:int):int {
            return a + b;
        }
        
        public function parseInteger(str:String):int {
            var num:Number = parseInt(str);
            if(!isNaN(num) && num &lt;= int.MAX_VALUE && num &gt;= int.MIN_VALUE) {
                return int(num);
            }
            
            return 0;
        }
        
    }
}</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">int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int int </div></div></body></html><!-- &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  -->
