﻿<!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"><title>flash.sampler Details (ActionScript 3.0)</title></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 = 'flash.sampler package - 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?flash/sampler/package.html&amp;flash/sampler/class-list.html">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">Package</td><td class="titleTableSubNav" id="subNav" align="right" colspan="2"><a href="package.html#methodSummary">Functions</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("Package"); titleBar_setSubNav(false,false,false	,false,false,false,false,false,false	,false,true,false,false,false);}

				    
				        
				    
				-->
                
                    
                
			</script><div class="MainContent"><br><a name="methodSummary"></a>This package is used by the profiling agent distributed with Adobe Flex Builder, and is provided for your use for customizing the profiling agent or building your own memory tests. Use the <code>startSampling()</code> method and the Flash Player 9.0.115.0 debugger version or later, to collect memory usage samples. Then use the <code>getSamples()</code> method to retrieve memory usage samples. The samples reveal the memory usage of distinct intervals of a running application. Then use the other methods in the <code>flash.sampler</code> package to analyze the memory usage information.<p><strong>Note:</strong> If you create your own custom profiling agent, preload the agent SWF file by setting the <code>PreloadSwf</code> property in the mm.cfg file:</p><pre>PreloadSwf=C:/Documents and Settings/username/testingagent.swf?aparam=asetting</pre><p>Each preloaded agent SWF file has its own security domain and runs in a distinct security sandbox from the main SWF file being profiled. To run the methods of the <code>flash.sampler</code> package, the agent SWF file must be in a localTrusted file path (see the <a target="mm_external" href="http://www.adobe.com/go/fp9_0_security">Flash Player 9 Security white paper</a>).</p><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th>&nbsp;</th><th colspan="2">Function</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="#clearSamples()" class="signatureLink">clearSamples</a>():<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Clears the current set of Sample objects.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getGetterInvocationCount()" class="signatureLink">getGetterInvocationCount</a>(obj:<a href="../../Object.html">Object</a>, qname:<a href="../../QName.html">QName</a>):<a href="../../Number.html">Number</a></div><div class="summaryTableDescription">Returns the number of times a get function was executed.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getInvocationCount()" class="signatureLink">getInvocationCount</a>(obj:<a href="../../Object.html">Object</a>, qname:<a href="../../QName.html">QName</a>):<a href="../../Number.html">Number</a></div><div class="summaryTableDescription">Returns the number of times a method was executed.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getMemberNames()" class="signatureLink">getMemberNames</a>(o:<a href="../../Object.html">Object</a>, instanceNames:<a href="../../Boolean.html">Boolean</a> = false):<a href="../../Object.html">Object</a></div><div class="summaryTableDescription">Returns an object containing all members of a specified object, including private members.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getSampleCount()" class="signatureLink">getSampleCount</a>():<a href="../../Number.html">Number</a></div><div class="summaryTableDescription">Returns the number of samples collected.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getSamples()" class="signatureLink">getSamples</a>():<a href="../../Object.html">Object</a></div><div class="summaryTableDescription">Returns an object of memory usage Sample instances from the last sampling session.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getSetterInvocationCount()" class="signatureLink">getSetterInvocationCount</a>(obj:<a href="../../Object.html">Object</a>, qname:<a href="../../QName.html">QName</a>):<a href="../../Number.html">Number</a></div><div class="summaryTableDescription">Returns the number of times a set function was executed.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#getSize()" class="signatureLink">getSize</a>(o:<a href="../../specialTypes.html#*">*</a>):<a href="../../Number.html">Number</a></div><div class="summaryTableDescription">Returns the size in memory of a specified object when used with the Flash Player 9.0.115.0 or later debugger version.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#isGetterSetter()" class="signatureLink">isGetterSetter</a>(obj:<a href="../../Object.html">Object</a>, qname:<a href="../../QName.html">QName</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Checks to see if a property is defined by a get/set function.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#pauseSampling()" class="signatureLink">pauseSampling</a>():<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Stops the sampling process momentarily.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#startSampling()" class="signatureLink">startSampling</a>():<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Begins the process of collecting memory usage Sample objects.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#stopSampling()" class="signatureLink">stopSampling</a>():<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Ends the process of collecting memory usage Sample objects and frees resources dedicated to the sampling process.</div></td><td class="summaryTableOwnerCol">flash.sampler</td></tr></table></div><a name="methodDetail"></a><div class="detailSectionHeader"> Function detail </div><a name="clearSamples()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">clearSamples</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td></tr></table><div class="detailBody"><code> public function clearSamples():<a href="../../specialTypes.html#void">void</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.0.115.0</td></tr></table><p></p><p></p><p>
        Clears the current set of Sample objects. This method is usually called after calling
        <code>getSamples()</code>
        and iterating over the Sample objects.
     For Flash Player debugger version only.
      </p><p><span class="label">See also</span></p><div class="seeAlso"><a href="package.html#getSamples()" target="">getSamples()</a></div></div><a name="getGetterInvocationCount()"></a><a name="getGetterInvocationCount(Object,QName)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getGetterInvocationCount</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function getGetterInvocationCount(obj:<a href="../../Object.html">Object</a>, qname:<a href="../../QName.html">QName</a>):<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 9.0.115.0</td></tr></table><p></p><p></p><p>
        Returns the number of times a get function was executed. Use
        <code>isGetterSetter()</code>
        to verify that you have a get/set function before you use
        <code>getGetterInvocationCount()</code>
        . For Flash Player debugger version only.
      </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">obj</span>:<a href="../../Object.html">Object</a></code> &mdash; A method instance or a class.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">qname</span>:<a href="../../QName.html">QName</a></code> &mdash; 
            If qname is
            <code>undefined</code>
            return the number of iterations of the constructor function.
          </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="../../Number.html">Number</a></code> &mdash; The number of times a get method was executed.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="package.html#isGetterSetter()" target="">isGetterSetter()</a><br/><a href="package.html#getInvocationCount()" target="">getInvocationCount()</a></div></div><a name="getInvocationCount()"></a><a name="getInvocationCount(Object,QName)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getInvocationCount</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function getInvocationCount(obj:<a href="../../Object.html">Object</a>, qname:<a href="../../QName.html">QName</a>):<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 9.0.115.0</td></tr></table><p></p><p></p><p>
        Returns the number of times a method was executed. If the parameter
        <code>obj</code>
        is a Class and the parameter
        <code>qname</code>
        is
        <code>undefined</code>
        then this method
     returns the number of iterations of the constructor function. For Flash Player debugger version only.
      </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">obj</span>:<a href="../../Object.html">Object</a></code> &mdash; 
            A method instance or a class. A class can be used to get the invocation count of 
     instance functions when a method instance isn't available. If
            <code>obj</code>
            is
            <code>undefined</code>
            ,
     this method returns the count of the package-scoped function named by
            <code>qname</code>
            .
          </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">qname</span>:<a href="../../QName.html">QName</a></code> &mdash; 
            If qname is
            <code>undefined</code>
            return the number of iterations of the constructor function.
          </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="../../Number.html">Number</a></code> &mdash; The number of times a method was executed.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
        
        <div class="listing"><pre>package 
{
  public function exec3() {}

  import flash.sampler.*;
  import flash.system.*;
  import flash.display.Sprite;
  import flash.utils.*;
  public class getInvocationCountTest extends Sprite
    {
      public function getInvocationCountTest()
    {
      for(var i:int=0;i&lt;10;i++)
        exec();
      for(var i:int=0;i&lt;10;i++)
        exec2();
      for(var i:int=0;i&lt;10;i++)
        exec3();

      // get exec QName
      var execName:QName;
          var name:QName;
      var fooName:QName;
      for each(name in getMemberNames(this)) {
          if(name.localName == "exec")
          execName = name;
          if(name.localName == "foo")
          fooName = name;
      }

      var exec2Name:QName;
      for each(name in getMemberNames(getInvocationCountTest)) {
          if(name.localName == "exec2")
          exec2Name = name;
      }

      // execute get/set
      foo = "bar";

      trace(isGetterSetter(this, fooName));
      trace(getSetterInvocationCount(this, fooName) == 1);
      trace(getGetterInvocationCount(this, fooName) == 0);

      foo;
      
      trace(getSetterInvocationCount(getInvocationCountTest, fooName) == 1);
      trace(getGetterInvocationCount(getInvocationCountTest, fooName) == 1);

      trace(getInvocationCount(this, execName) == 10);
      trace(getInvocationCount(getInvocationCountTest, execName) == 10);
      trace(getInvocationCount(getInvocationCountTest, exec2Name) == 10);
      trace(getInvocationCount(getInvocationCountTest, undefined) == 1);
    
      getTimer();
      getTimer();

      trace(getInvocationCount(undefined, new QName("", "trace")) == 9);
      trace(getInvocationCount(undefined, new QName("flash.utils", "getTimer")) == 2);
      trace(getInvocationCount(undefined, new QName("", "exec3")) == 10);

    }

      private function exec():void {}
      private static function exec2():void {}

      private function get foo():String { return "fo"; }
      private function set foo(s:String) { }
      
    }
}</pre></div>
      </div></div><a name="getMemberNames()"></a><a name="getMemberNames(Object,Boolean)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getMemberNames</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function getMemberNames(o:<a href="../../Object.html">Object</a>, instanceNames:<a href="../../Boolean.html">Boolean</a> = false):<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.0.115.0</td></tr></table><p></p><p></p><p>Returns an object containing all members of a specified object, including private members. You can then 
     iterate over the returned object to see all values. This method is similar to the flash.utils.describeType() 
     method but also allows you to see private members and skips the intermediate step of creating an XML object.
     For Flash Player debugger version only.</p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">o</span>:<a href="../../Object.html">Object</a></code> &mdash; The object to analyze.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">instanceNames</span>:<a href="../../Boolean.html">Boolean</a></code> (default = <code>false</code>)<code></code> &mdash; If object is a Class and instanceNames is true report the instance names as if o was an instance of class instead of the class's member names.</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="../../Object.html">Object</a></code> &mdash; 
            An Object that you must iterate over with a
            <code>for each..in</code>
            loop to retrieve the QNames for
     each property.
          </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="../../flash/utils/package.html#describeType()" target="">flash.utils.describeType()</a><br/><a href="../../statements.html#for_each..in" target="">for each..in</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
        The following example uses the
        <code>getMemberNames()</code>
        method to analyze an  
 object and display the
        <code>buttonMode</code>
        ,
        <code>filters</code>
        and
        <code>dispatchEvent</code>
        properties of its members, To use
 the memory profiler, you need to have Flash Player debugger version 9.0.115.0 or later installed.
        <div class="listing"><pre>package 
{
  import flash.sampler.*;
  import flash.system.*;
  import flash.display.Sprite;
  public class getMemberNamesTest extends Sprite
    {
      public function getMemberNamesTest()
    {
      var name_iter = getMemberNames(this);
      var o={};
      for each(var name:QName in name_iter) {
        o[name.localName] = "got it";
      }

      name_iter = getMemberNames(this);
      var count=0;
      for(var dum in name_iter) {
        count++;
      }
      trace(count == 1);

      // my member
      trace("buttonMode" in o);
      // inherited member
      trace("filters" in o);
      // inherited function
      trace("dispatchEvent" in o);

      var name_iter = getMemberNames(getMemberNamesTest, true);
      var o={};
      for each(var name:QName in name_iter) {
        o[name.localName] = "got it";
      }

      // my member
      trace("buttonMode" in o);
      // inherited member
      trace("filters" in o);
      // inherited function
      trace("dispatchEvent" in o);

    }
    }
}</pre></div>
      </div></div><a name="getSampleCount()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getSampleCount</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function getSampleCount():<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 9.0.115.0</td></tr></table><p></p><p></p><p>Returns the number of samples collected. For Flash Player debugger version only.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Number.html">Number</a></code> &mdash; An iterator of Sample instances.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="Sample.html" target="">flash.sampler.Sample</a></div></div><a name="getSamples()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getSamples</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function getSamples():<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.0.115.0</td></tr></table><p></p><p></p><p>Returns an object of memory usage Sample instances from the last sampling session. For Flash Player debugger version only.</p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../Object.html">Object</a></code> &mdash; An iterator of Sample instances.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="Sample.html" target="">flash.sampler.Sample</a></div></div><a name="getSetterInvocationCount()"></a><a name="getSetterInvocationCount(Object,QName)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getSetterInvocationCount</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function getSetterInvocationCount(obj:<a href="../../Object.html">Object</a>, qname:<a href="../../QName.html">QName</a>):<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 9.0.115.0</td></tr></table><p></p><p></p><p>
        Returns the number of times a set function was executed. Use
        <code>isGetterSetter()</code>
        to verify that you have a get/set function before you use
        <code>getSetterInvocationCount()</code>
        . For Flash Player debugger version only.
      </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">obj</span>:<a href="../../Object.html">Object</a></code> &mdash; A method instance or a class.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">qname</span>:<a href="../../QName.html">QName</a></code> &mdash; 
            If qname is
            <code>undefined</code>
            return the number of iterations of the constructor function.
          </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="../../Number.html">Number</a></code> &mdash; The number of times a set method was executed.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="package.html#isGetterSetter()" target="">isGetterSetter()</a><br/><a href="package.html#getInvocationCount()" target="">getInvocationCount()</a></div></div><a name="getSize()"></a><a name="getSize()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">getSize</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function getSize(o:<a href="../../specialTypes.html#*">*</a>):<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 9.0.115.0</td></tr></table><p></p><p></p><p>
        Returns the size in memory of a specified object when used with the Flash Player 9.0.115.0 or later debugger version. If 
    used with a Flash Player that is not the debugger version, this method returns
        <code>0</code>
        .
      </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">o</span>:<a href="../../specialTypes.html#*">*</a></code> &mdash; The object to analyze for memory usage.</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="../../Number.html">Number</a></code> &mdash; The byte count of memory used by the specified object.</td></tr></table><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
        The following example uses
        <code>startSampling()</code>
        and
        <code>pauseSampling</code>
        to collect
 Sample objects. The example then iterates over the Sample objects for
        <code>id</code>
        values and
 sizes. After calling
        <code>System.gc()</code>
        to stop the current process, the example compares the deletedObjectSample
 objects to the original
        <code>id</code>
        values and displays their size. To use
 the memory profiler, you need to have Flash Player debugger version 9.0.115.0 or later installed.
        <div class="listing"><pre>package {
  import flash.sampler.*;
  import flash.system.*;
  import flash.display.Sprite;
  import flash.utils.Dictionary;
  public class deletedObjectSize extends Sprite {
    public function deletedObjectSize() {

      startSampling();
      var obj = {};
      pauseSampling();

      var id:Number;
      var sampleIter = getSamples();
      for each(var s:Sample in sampleIter) {
    id = s.id;
      }
      
      sampleIter = getSamples();
      var count=0;
      for(var dum in sampleIter) {
    count++;
      }
      trace(count == 1);

      var size:Number = getSize(obj);
      obj = undefined;

      startSampling();

      // force DRC
      for(var i:int=0;i&lt;1000;i++)
    new Object();
      
      System.gc();

      pauseSampling();
      
      var sampleIter = getSamples();
      for each(var s:Sample in sampleIter) {
    //    trace(s);
    if(s is DeleteObjectSample && s.id == id) {
      trace(s.size == size);
    }      
      }       

    }
  }
}</pre></div>
      </div></div><a name="isGetterSetter()"></a><a name="isGetterSetter(Object,QName)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">isGetterSetter</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function isGetterSetter(obj:<a href="../../Object.html">Object</a>, qname:<a href="../../QName.html">QName</a>):<a href="../../Boolean.html">Boolean</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.0.115.0</td></tr></table><p></p><p></p><p>
        Checks to see if a property is defined by a get/set function. If you want to use
        <code>getInvocationCount()</code>
        on a get/set function for a property,
     first call
        <code>isGetterSetter()</code>
        to check to see if it is a get/set function,
     and then use either
        <code>getSetterInvocationCount</code>
        or
        <code>getGetterInvocationCount</code>
        to get the respective counts. For Flash Player debugger version only.
      </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">obj</span>:<a href="../../Object.html">Object</a></code> &mdash; A method instance or a class.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">qname</span>:<a href="../../QName.html">QName</a></code> &mdash; 
            If qname is
            <code>undefined</code>
            return the number of iterations of the constructor function.
          </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="../../Boolean.html">Boolean</a></code> &mdash; 
            A Boolean value indicating if the property is defined by a get/set function (
            <code>true</code>
            )
     or not (
            <code>false</code>
            ).
          </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="package.html#getInvocationCount()" target="">getInvocationCount()</a><br/><a href="package.html#getSetterInvocationCount()" target="">getSetterInvocationCount()</a><br/><a href="package.html#getGetterInvocationCount()" target="">getGetterInvocationCount()</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
        
        <div class="listing"><pre>package 
{
  public function exec3() {}

  import flash.sampler.*;
  import flash.system.*;
  import flash.display.Sprite;
  import flash.utils.*;
  public class getInvocationCountTest extends Sprite
    {
      public function getInvocationCountTest()
    {
      for(var i:int=0;i&lt;10;i++)
        exec();
      for(var i:int=0;i&lt;10;i++)
        exec2();
      for(var i:int=0;i&lt;10;i++)
        exec3();

      // get exec QName
      var execName:QName;
          var name:QName;
      var fooName:QName;
      for each(name in getMemberNames(this)) {
          if(name.localName == "exec")
          execName = name;
          if(name.localName == "foo")
          fooName = name;
      }

      var exec2Name:QName;
      for each(name in getMemberNames(getInvocationCountTest)) {
          if(name.localName == "exec2")
          exec2Name = name;
      }

      // execute get/set
      foo = "bar";

      trace(isGetterSetter(this, fooName));
      trace(getSetterInvocationCount(this, fooName) == 1);
      trace(getGetterInvocationCount(this, fooName) == 0);

      foo;
      
      trace(getSetterInvocationCount(getInvocationCountTest, fooName) == 1);
      trace(getGetterInvocationCount(getInvocationCountTest, fooName) == 1);

      trace(getInvocationCount(this, execName) == 10);
      trace(getInvocationCount(getInvocationCountTest, execName) == 10);
      trace(getInvocationCount(getInvocationCountTest, exec2Name) == 10);
      trace(getInvocationCount(getInvocationCountTest, undefined) == 1);
    
      getTimer();
      getTimer();

      trace(getInvocationCount(undefined, new QName("", "trace")) == 9);
      trace(getInvocationCount(undefined, new QName("flash.utils", "getTimer")) == 2);
      trace(getInvocationCount(undefined, new QName("", "exec3")) == 10);

    }

      private function exec():void {}
      private static function exec2():void {}

      private function get foo():String { return "fo"; }
      private function set foo(s:String) { }
      
    }
}</pre></div>
      </div></div><a name="pauseSampling()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">pauseSampling</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function pauseSampling():<a href="../../specialTypes.html#void">void</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.0.115.0</td></tr></table><p></p><p></p><p>
        Stops the sampling process momentarily. Restart the sampling process using
        <code>startSampling()</code>
        .
     For Flash Player debugger version only.
      </p><p><span class="label">See also</span></p><div class="seeAlso"><a href="package.html#startSampling()" target="">startSampling()</a></div></div><a name="startSampling()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">startSampling</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function startSampling():<a href="../../specialTypes.html#void">void</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.0.115.0</td></tr></table><p></p><p></p><p>Begins the process of collecting memory usage Sample objects.
     For Flash Player debugger version only.</p><p><span class="label">See also</span></p><div class="seeAlso"><a href="Sample.html" target="">Sample class</a></div><br/><span class="label"> Example </span><br/><br/><div class="detailBody">
        The following example initiates the sampling process and iterates over the collected objects. To use
 the memory profiler, you need to have Flash Player debugger version 9.0.115.0 or later.
        <div class="listing"><pre>package 
{
    import flash.sampler.*
    import flash.system.*
    import flash.display.Sprite
    public class startSampling extends Sprite
    {
        public function startSampling()
        {
            flash.sampler.startSampling();
            for(var i:int=0;i&lt;1000;i++)
                new Object()
            trace(getSampleCount() &gt; 0)
        }
    }
}</pre></div>
      </div></div><a name="stopSampling()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">stopSampling</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">function</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function stopSampling():<a href="../../specialTypes.html#void">void</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.0.115.0</td></tr></table><p></p><p></p><p>
        Ends the process of collecting memory usage Sample objects and frees resources dedicated to the sampling process.
     You start the sampling process with
        <code>startSampling()</code>
        .
     For Flash Player debugger version only.
      </p><p><span class="label">See also</span></p><div class="seeAlso"><a href="Sample.html" target="">Sample class</a></div></div><p></p><center class="copyright"> &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:14 PM -07:00  </center><div style="display:none">flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler flash.sampler </div></div></body></html>
