﻿<!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="LocalConnection,flash.net.LocalConnection,AMF0,AMF3,APPEND,BINARY,CONNECT_TO_FMS,DEFAULT,DELETE,DIRECT_CONNECTIONS,FLUSHED,GET,HEAD,OPTIONS,PENDING,POST,PUT,RESET,SRTT,STOP,SWAP,SWITCH,TEXT,VARIABLES,audioBufferByteLength,audioBufferLength,audioByteCount,audioBytesPerSecond,audioLossRate,authenticate,authenticate,bufferLength,bufferTime,byteCount,bytesAvailable,bytesAvailable,bytesLoaded,bytesLoaded,bytesTotal,bytesTotal,cacheResponse,cacheResponse,checkPolicyFile,client,client,client,client,connected,connected,connected,connected,connectedProxyType,contentType,creationDate,creator,currentBytesPerSecond,currentFPS,data,dataBufferByteLength,dataBufferLength,dataByteCount,dataBytesPerSecond,dataFormat,data,data,data,defaultObjectEncoding,defaultObjectEncoding,description,digest,domain,droppedFrames,dynamicPropertyWriter,endian,endian,extension,extension,farID,farID,farNonce,farNonce,fileList,followRedirects,followRedirects,fps,info,len,liveDelay,macType,manageCookies,manageCookies,maxBytesPerSecond,maxPauseBufferTime,maxPeerConnections,method,modificationDate,name,name,nearID,nearNonce,nearNonce,objectEncoding,objectEncoding,objectEncoding,objectEncoding,objectEncoding,oldStreamName,peerStreams,playbackBytesPerSecond,protocol,proxyType,requestHeaders,size,size,soundTransform,start,streamName,time,timeout,timeout,transition,type,unconnectedPeerStreams,uri,url,useCache,useCache,userAgent,userAgent,usingTLS,value,videoBufferByteLength,videoBufferLength,videoByteCount,videoBytesPerSecond,addEventListener,addHeader,allowDomain,allowInsecureDomain,attachAudio,attachCamera,browse,browse,call,cancel,clear,close,close,close,close,close,close,close,close,connect,connect,connect,connect,connect,decode,download,flush,flush,getClassByAlias,getLocal,getRemote,load,load,load,navigateToURL,onPeerConnect,pause,play2,play,preloadEmbeddedData,publish,readBoolean,readBoolean,readByte,readByte,readBytes,readBytes,readDouble,readDouble,readFloat,readFloat,readInt,readInt,readMultiByte,readMultiByte,readObject,readObject,readShort,readShort,readUTFBytes,readUTFBytes,readUTF,readUTF,readUnsignedByte,readUnsignedByte,readUnsignedInt,readUnsignedInt,readUnsignedShort,readUnsignedShort,receiveAudio,receiveVideoFPS,receiveVideo,registerClassAlias,resetDRMVouchers,resume,save,seek,send,send,send,send,sendToURL,setDRMAuthenticationCredentials,setDirty,setLoginCredentialsForHost,setProperty,toString,toString,togglePause,upload,uploadUnencoded,writeBoolean,writeByte,writeBytes,writeDouble,writeDynamicProperties,writeDynamicProperty,writeFloat,writeInt,writeMultiByte,writeObject,writeShort,writeUTFBytes,writeUTF,writeUnsignedInt"><title>flash.net.LocalConnection (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 = 'LocalConnection - 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/net/LocalConnection.html&amp;flash/net/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">LocalConnection</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("LocalConnection"); titleBar_setSubNav(false,true,false	,false,true,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')">flash.net</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public  class  LocalConnection</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">LocalConnection  <img src="../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> <a href="../../flash/events/EventDispatcher.html">EventDispatcher</a> <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 LocalConnection class lets you create a LocalConnection object that can invoke a method in another
 LocalConnection object. The communication can be:
        <ul>
                  <li>Within a single SWF file</li>
                  <li>Between multiple SWF files</li>
                  <li>Between content (SWF-based or HTML-based) in AIR applications</li>
                  <li>Between content (SWF-based or HTML-based) in an AIR application and SWF content running in a browser</li>
               </ul>
        
               <p>
          Local connections enable this kind of communication between SWF files without the use of
          <code>fscommand()</code>
          or JavaScript. LocalConnection objects can communicate only among files that are running 
 on the same client computer, but they can be 
 running in different applications &mdash; for example, a file running in a browser 
 and a SWF file running in Adobe AIR.
        </p>
        
               <p>LocalConnection objects created in ActionScript 3.0 can communicate with
 LocalConnection objects created in ActionScript 1.0 or 2.0. The reverse is also true:
 LocalConnection objects created in ActionScript 1.0 or 2.0 can communicate with LocalConnection
 objects created in ActionScript 3.0. Flash Player handles this communication 
 between LocalConnection objects of different versions automatically.</p>
        
               <p>
          To understand how to use LocalConnection objects to implement communication between 
 two files, it is helpful to identify the commands used in each file. 
 One file is called the
          <i>sending</i>
          file; it is the file
 that contains the method to be invoked. The sending file must contain a LocalConnection 
 object and a call to the
          <code>send()</code>
          method. 
 The other file is called the
          <i>receiving</i>
          file;
 it is the file that invokes the method. The receiving file must contain another LocalConnection
 object and a call to the
          <code>connect()</code>
          method.
        </p>
        
               <p>
          Your use of
          <code>send()</code>
          and
          <code>connect()</code>
          differs depending on whether the 
 files are in the same domain, in different domains with predictable domain names,
 or in different domains with unpredictable or dynamic domain names. The following paragraphs 
 explain the three different situations, with code samples for each.
        </p>
        
               <p>
                  <b>Same domain</b>
          . This is the simplest way to use a LocalConnection object,
 to allow communication only between LocalConnection objects that are located in the same domain,
 because same-domain communication is permitted by default. When two files from the same domain communicate,
 you do not need to implement any special security measures, and you simply pass the same
 value for the
          <code>connectionName</code>
          parameter to both the
          <code>connect()</code>
          and
          <code>send()</code>
          methods:
        </p>
        
               <p>
                  <img src="../../images/localconnection_samedomains.gif" alt="Loading from the same domain"></img>
               </p>
        
               <div class="listing"><pre>// receivingLC is in http://www.domain.com/receiving.swf
receivingLC.connect('myConnection');

// sendingLC is in http://www.domain.com/sending.swf
// myMethod() is defined in sending.swf
sendingLC.send('myConnection', 'myMethod');</pre></div>
        
               <p>
                  <b>Different domains with predictable domain names</b>
          . 
 When two SWF files from different domains communicate,
 you need to allow communication between the two domains by calling the
          <code>allowDomain()</code>
          method. You also need to qualify the connection name in the
          <code>send()</code>
          method 
 with the receiving LocalConnection object's domain name:
        </p>
        
               <p>
                  <img src="../../images/localconnection_differentdomains.gif" alt="Loading from separate domains"></img>
               </p>
        
               <div class="listing"><pre>// receivingLC is in http://www.domain.com/receiving.swf
receivingLC.allowDomain('www.anotherdomain.com');
receivingLC.connect('myConnection');

// sendingLC is in http://www.anotherdomain.com/sending.swf
sendingLC.send('www.domain.com:myConnection', 'myMethod');</pre></div>
        
               <p>
                  <b>Different domains with unpredictable domain names</b>
          .
 Sometimes, you might want to make the file with the receiving LocalConnection object
 more portable between domains. To avoid specifying the domain name in the
          <code>send()</code>
          method,
 but to indicate that the receiving and sending LocalConnection objects 
 are not in the same domain, precede the connection name
 with an underscore (_), in both the
          <code>connect()</code>
          and
          <code>send()</code>
          calls.
 To allow communication between the two domains, call the
          <code>allowDomain()</code>
          method
 and pass the domains from which you want to allow LocalConnection calls.  
 Alternatively, pass the wildcard (*) argument to allow calls from all domains:
        </p>
        
               <p>
                  <img src="../../images/localconnection_unknowndomains.gif" alt="Loading from unknown domain names"></img>
               </p>
        
               <div class="listing"><pre>// receivingLC is in http://www.domain.com/receiving.swf
receivingLC.allowDomain('*');
receivingLC.connect('_myConnection');

// sendingLC is in http://www.anotherdomain.com/sending.swf
sendingLC.send('_myConnection', 'myMethod');</pre></div>
        
               <p>You can use LocalConnection objects to send and receive data within a single file, 
 but this is not a typical implementation.</p>
        
               <p>
          For more information about the
          <code>send()</code>
          and
          <code>connect()</code>
          methods, see the discussion of the
          <code>connectionName</code>
          parameter in the
          <code>LocalConnection.send()</code>
          and
          <code>LocalConnection.connect()</code>
          entries. Also, see the
          <code>allowDomain()</code>
          and
          <code>domain</code>
          entries.
        </p>
        
            <p></p><p><a href="#includeExamplesSummary">View the examples</a></p><p><span class="classHeaderTableLabel">See also</span></p><div class="seeAlso"><a href="LocalConnection.html#send()" target="">flash.net.LocalConnection.send()</a><br/><a href="LocalConnection.html#allowDomain()" target="">flash.net.LocalConnection.allowDomain()</a><br/><a href="LocalConnection.html#domain" target="">flash.net.LocalConnection.domain</a></div><br/><hr></div><a name="propertySummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Properties</div><div class="showHideLinks"><div id="hideInheritedProperty" class="hideInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(false,'Property');"><img class="showHideLinkImage" src="../../images/expanded.gif"> Hide Inherited Public Properties</a></div><div id="showInheritedProperty" class="showInheritedProperty"><a class="showHideLink" href="#propertySummary" onclick="javascript:setInheritedVisible(true,'Property');"><img class="showHideLinkImage" src="../../images/collapsed.gif"> Show Inherited Public Properties</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableProperty"><tr><th>&nbsp;</th><th colspan="2">Property</th><th>Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#client" class="signatureLink">client</a> : <a href="../../Object.html">Object</a><div class="summaryTableDescription">Indicates the object on which callback methods are invoked.</div></td><td class="summaryTableOwnerCol">LocalConnection</td></tr><tr class="hideInheritedProperty"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><a href="../../Object.html#constructor" class="signatureLink">constructor</a> : <a href="../../Object.html">Object</a><div class="summaryTableDescription">A reference to the class object or constructor function for a given object instance.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a href="#domain" class="signatureLink">domain</a> : <a href="../../String.html">String</a><div class="summaryTableDescription">[read-only] A string representing the domain of the location of the current file.</div></td><td class="summaryTableOwnerCol">LocalConnection</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="#LocalConnection()" class="signatureLink">LocalConnection</a>()</div><div class="summaryTableDescription">Creates a LocalConnection object.</div></td><td class="summaryTableOwnerCol">LocalConnection</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="../../flash/events/EventDispatcher.html#addEventListener()" class="signatureLink">addEventListener</a>(type:<a href="../../String.html">String</a>, listener:<a href="../../Function.html">Function</a>, useCapture:<a href="../../Boolean.html">Boolean</a> = false, priority:<a href="../../int.html">int</a> = 0, useWeakReference:<a href="../../Boolean.html">Boolean</a> = false):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Registers an event listener object with an EventDispatcher object so that the listener 
 receives notification of an event.</div></td><td class="summaryTableOwnerCol"><a href="../../flash/events/EventDispatcher.html">EventDispatcher</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#allowDomain()" class="signatureLink">allowDomain</a>(<a href="../../statements.html#..._(rest)_parameter">...</a> domains):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Specifies one or more domains that can send LocalConnection calls to this LocalConnection instance.</div></td><td class="summaryTableOwnerCol">LocalConnection</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#allowInsecureDomain()" class="signatureLink">allowInsecureDomain</a>(<a href="../../statements.html#..._(rest)_parameter">...</a> domains):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Specifies one or more domains that can send LocalConnection calls to this LocalConnection object.</div></td><td class="summaryTableOwnerCol">LocalConnection</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#close()" class="signatureLink">close</a>():<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Closes (disconnects) a LocalConnection object.</div></td><td class="summaryTableOwnerCol">LocalConnection</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#connect()" class="signatureLink">connect</a>(connectionName:<a href="../../String.html">String</a>):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Prepares a LocalConnection object to receive commands from a send() command 
  (called the sending LocalConnection object).</div></td><td class="summaryTableOwnerCol">LocalConnection</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="../../flash/events/EventDispatcher.html#dispatchEvent()" class="signatureLink">dispatchEvent</a>(event:<a href="../../flash/events/Event.html">Event</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Dispatches an event into the event flow.</div></td><td class="summaryTableOwnerCol"><a href="../../flash/events/EventDispatcher.html">EventDispatcher</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="../../flash/events/EventDispatcher.html#hasEventListener()" class="signatureLink">hasEventListener</a>(type:<a href="../../String.html">String</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Checks whether the EventDispatcher object has any listeners registered for a specific type 
 of event.</div></td><td class="summaryTableOwnerCol"><a href="../../flash/events/EventDispatcher.html">EventDispatcher</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#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="../../flash/events/EventDispatcher.html#removeEventListener()" class="signatureLink">removeEventListener</a>(type:<a href="../../String.html">String</a>, listener:<a href="../../Function.html">Function</a>, useCapture:<a href="../../Boolean.html">Boolean</a> = false):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Removes a listener from the EventDispatcher object.</div></td><td class="summaryTableOwnerCol"><a href="../../flash/events/EventDispatcher.html">EventDispatcher</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#send()" class="signatureLink">send</a>(connectionName:<a href="../../String.html">String</a>, methodName:<a href="../../String.html">String</a>, <a href="../../statements.html#..._(rest)_parameter">...</a> arguments):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Invokes the method named methodName on a connection opened with the 
  connect(connectionName) method (the receiving LocalConnection 
  object).</div></td><td class="summaryTableOwnerCol">LocalConnection</td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#setPropertyIsEnumerable()" class="signatureLink">setPropertyIsEnumerable</a>(name:<a href="../../String.html">String</a>, isEnum:<a href="../../Boolean.html">Boolean</a> = true):<a href="../../specialTypes.html#void">void</a></div><div class="summaryTableDescription">Sets the availability of a dynamic property for loop operations.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#toString()" class="signatureLink">toString</a>():<a href="../../String.html">String</a></div><div class="summaryTableDescription">Returns the string representation of the specified object.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><tr class="hideInheritedMethod"><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img src="../../images/inheritedSummary.gif" alt="Inherited" title="Inherited" class="inheritedSummaryImage"></td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="../../Object.html#valueOf()" class="signatureLink">valueOf</a>():<a href="../../Object.html">Object</a></div><div class="summaryTableDescription">Returns the primitive value of the specified object.</div></td><td class="summaryTableOwnerCol"><a href="../../Object.html">Object</a></td></tr><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="../../flash/events/EventDispatcher.html#willTrigger()" class="signatureLink">willTrigger</a>(type:<a href="../../String.html">String</a>):<a href="../../Boolean.html">Boolean</a></div><div class="summaryTableDescription">Checks whether an event listener is registered with this EventDispatcher object or any of 
 its ancestors for the specified event type.</div></td><td class="summaryTableOwnerCol"><a href="../../flash/events/EventDispatcher.html">EventDispatcher</a></td></tr></table></div><a name="eventSummary"></a><div class="summarySection"><div class="summaryTableTitle">Events</div><div class="showHideLinks"><div id="hideInheritedEvent" class="hideInheritedEvent"><a class="showHideLink" href="#eventSummary" onclick="javascript:setInheritedVisible(false,'Event');"><img class="showHideLinkImage" src="../../images/expanded.gif"> Hide Inherited Events</a></div><div id="showInheritedEvent" class="showInheritedEvent"><a class="showHideLink" href="#eventSummary" onclick="javascript:setInheritedVisible(true,'Event');"><img class="showHideLinkImage" src="../../images/collapsed.gif"> Show Inherited Events</a></div></div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableEvent"><tr><th>&nbsp;</th><th colspan="2">Event</th><th> Summary </th><th>Defined By</th></tr><tr class="hideInheritedEvent"><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="../../flash/events/EventDispatcher.html#event:activate" class="signatureLink">activate</a></div></td><td class="summaryTableDescription summaryTableCol">[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.</td><td class="summaryTableOwnerCol"><a href="../../flash/events/EventDispatcher.html">EventDispatcher</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#event:asyncError" class="signatureLink">asyncError</a></div></td><td class="summaryTableDescription summaryTableCol">Dispatched when an exception is thrown asynchronously — that is, from native asynchronous code.</td><td class="summaryTableOwnerCol">LocalConnection</td></tr><tr class="hideInheritedEvent"><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="../../flash/events/EventDispatcher.html#event:deactivate" class="signatureLink">deactivate</a></div></td><td class="summaryTableDescription summaryTableCol">[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.</td><td class="summaryTableOwnerCol"><a href="../../flash/events/EventDispatcher.html">EventDispatcher</a></td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#event:securityError" class="signatureLink">securityError</a></div></td><td class="summaryTableDescription summaryTableCol">Dispatched if a call to LocalConnection.send() attempts to send data to a different security sandbox.</td><td class="summaryTableOwnerCol">LocalConnection</td></tr><tr class=""><td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#event:status" class="signatureLink">status</a></div></td><td class="summaryTableDescription summaryTableCol">Dispatched when a LocalConnection object reports its status.</td><td class="summaryTableOwnerCol">LocalConnection</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="client"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">client</td><td class="detailHeaderType">property</td></tr></table><div class="detailBody"><code>client:<a href="../../Object.html">Object</a></code>&nbsp;&nbsp;[read-write] <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>
          Indicates the object on which callback methods are invoked. The default object 
  is
          <code>this</code>
          , the local connection being created. You can set the
          <code>client</code>
          property to another object, and callback methods are 
  invoked on that other object.
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get client():<a href="../../Object.html">Object</a></code><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function set client(value:<a href="../../Object.html">Object</a>):<a href="../../specialTypes.html#void">void</a></code><br/><br/><span class="label"> Throws </span><br/><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../TypeError.html">TypeError</a> </code> &mdash; 
              The
              <code>client</code>
              property must be set to a non-null object.
            </td></tr></table></div><a name="propertyDetail"></a><a name="domain"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">domain</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code>domain:<a href="../../String.html">String</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>
          A string representing the domain of the location of the current file.
          <p>
            In content running in the
            <code>application</code>
            security sandbox in Adobe AIR (content
  installed with the AIR application), the runtime uses the string
            <code>app#</code>
            followed by the application
  ID for the AIR application (defined in the application descriptor file) in place of the superdomain. 
  For example a
            <code>connectionName</code>
            for an application with the application ID
            <code>com.example.air.MyApp</code>
            
            <code>connectionName</code>
            resolves to
            <code>"app#com.example.air.MyApp:connectionName"</code>
            .
          </p>
          
          <p>
            In SWF files published for Flash Player 9 or later, the returned string is the exact domain of 
  the file, including subdomains. For example, if the file is located at www.adobe.com, this command 
  returns
            <code>"www.adobe.com"</code>
            .
          </p>
          
          <p>
            If the current file is a local file residing on the client computer running in Flash Player, 
  this command returns
            <code>"localhost"</code>
            .
          </p>
          
          <p>
            The most common ways to use this property are to include the domain name of the sending 
  LocalConnection object as a parameter to the method you plan to invoke in the receiving 
  LocalConnection object, or to use it with
            <code>LocalConnection.allowDomain()</code>
            to accept commands 
  from a specified domain. If you are enabling communication only between LocalConnection objects 
  that are located in the same domain, you probably don't need to use this property.
          </p>
          
        </p><br/><br/><span class="label"> Implementation </span><br/><code>&nbsp;&nbsp;&nbsp;&nbsp;public function get domain():<a href="../../String.html">String</a></code><br/><p><span class="label">See also</span></p><div class="seeAlso"><a href="LocalConnection.html#allowDomain()" target="">flash.net.LocalConnection.allowDomain()</a><br/><a href="LocalConnection.html#connect()" target="">flash.net.LocalConnection.connect()</a></div></div><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="LocalConnection()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">LocalConnection</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function LocalConnection()</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 LocalConnection object. You can use LocalConnection objects to enable 
  communication between different files that are running on the same client computer.</p><p><span class="label">See also</span></p><div class="seeAlso"><a href="LocalConnection.html#connect()" target="">flash.net.LocalConnection.connect()</a><br/><a href="LocalConnection.html#send()" target="">flash.net.LocalConnection.send()</a></div></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="allowDomain()"></a><a name="allowDomain(restParam)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">allowDomain</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> public function allowDomain(<a href="../../statements.html#..._(rest)_parameter">...</a> domains):<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</td></tr></table><p></p><p></p><p>
          Specifies one or more domains that can send LocalConnection calls to this LocalConnection instance.
          <p>
            You cannot use this method to let files hosted using a secure protocol (HTTPS) allow access from 
  files hosted in nonsecure protocols; you must use the
            <code>allowInsecureDomain()</code>
            method instead.
          </p>
          
          <p>
            You may want to use this method so that a child file from a different domain can make LocalConnection
  calls to the parent file, without knowing the final domain from which the child file will come.
  This can happen, for example, when you use load-balancing redirects or third-party servers. In this situation, 
  you can use the
            <code>url</code>
            property of the LoaderInfo object used with the load, to get the domain to use with 
  the
            <code>allowDomain()</code>
            method. For example, if you use a Loader object to load a child file, once the file 
  is loaded, you can check the
            <code>contentLoaderInfo.url</code>
            property of the Loader object, and parse the domain 
  out of the full URL string. If you do this, make sure that you wait until the file is loaded, because the
            <code>contentLoaderInfo.url</code>
            property will not have its final, correct value until the file is completely loaded.
          </p>
          
          <p>
            The opposite situation can also occur: you might create a child file that wants to accept LocalConnection 
  calls from its parent but doesn't know the domain of its parent. In this situation, implement this method by 
  checking whether the domain argument matches the domain of the
            <code>loaderInfo.url</code>
            property in the 
  loaded file. Again, you must parse the domain out of the full URL from
            <code>loaderInfo.url</code>
            . 
  In this situation, you don't have to wait for the parent file to load; the parent will already be loaded 
  by the time the child loads.
          </p>
          
          <p>
            When using this method, consider the Flash Player security model. By default, a LocalConnection object 
  is associated with the sandbox of the file that created it, and cross-domain calls to LocalConnection
  objects are not allowed unless you call the
            <code>LocalConnection.allowDomain()</code>
            method in the 
  receiving file. However, in Adobe AIR, content in the
            <code>application</code>
            security sandbox 
  (content installed with the AIR application) are not restricted by these security limitations.
          </p>
          
          <p>For more information, see the following:</p>
          
          <ul><li>
              The
              <a href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" target="external">security chapter</a>
              in the
              <i>Programming ActionScript 3.0</i>
              book and the latest comments on LiveDocs
            </li><li>
              The Flash Player Developer Center Topic:
              <a href="http://www.adobe.com/go/devnet_security_en" target="external">Security</a>
            </li></ul>
          
          <p>
            <b>Note</b>
            : The
            <code>allowDomain()</code>
            method has changed 
  from the form it had in ActionScript 1.0 and 2.0.  In those earlier versions,
            <code>allowDomain</code>
            was a callback method that you
  implemented.  In ActionScript 3.0,
            <code>allowDomain()</code>
            is a built-in 
  method of LocalConnection that you call.  With this change,
            <code>allowDomain()</code>
            works in much the same way as
            <code>flash.system.Security.allowDomain()</code>
            .
          </p>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><a href="../../statements.html#..._(rest)_parameter">...</a> <span class="label">domains</span></code> &mdash; 
              One or more strings that name the domains from which
  you want to allow LocalConnection calls. This parameter has two special cases:
              <ul><li>You can specify a wildcard character "*" to allow calls from all domains.</li><li>
                  You can specify the string "
                  <code>localhost</code>
                  " to allow calls to this file from files that
   are installed locally.
                  <span>
                    Flash Player 8 introduced security restrictions 
   on local files. By default, a SWF file running in Flash Player
   that is allowed to access the Internet cannot also have access to the local file system. 
   In Flash Player, if you specify "
                    <code>localhost</code>
                    ", any local SWF file can access this 
   SWF file.
                  </span>
                  
                </li></ul>
              
            </td></tr></table></p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../ArgumentError.html">ArgumentError</a> </code> &mdash; All parameters specified must be non-null strings.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="LocalConnection.html#allowInsecureDomain()" target="">flash.net.LocalConnection.allowInsecureDomain()</a><br/><a href="../../flash/display/LoaderInfo.html#url" target="">flash.display.LoaderInfo.url</a><br/><a href="../../flash/system/Security.html#allowDomain()" target="">flash.system.Security.allowDomain()</a><br/><a href="../../flash/system/Security.html#allowDomain()" target="">flash.system.Security.allowDomain()</a><br/><a href="../../flash/display/LoaderInfo.html#url" target="">flash.display.LoaderInfo.url</a></div></div><a name="allowInsecureDomain()"></a><a name="allowInsecureDomain(restParam)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">allowInsecureDomain</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function allowInsecureDomain(<a href="../../statements.html#..._(rest)_parameter">...</a> domains):<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</td></tr></table><p></p><p></p><p>
          Specifies one or more domains that can send LocalConnection calls to this LocalConnection object.
          <p>
            The
            <code>allowInsecureDomain()</code>
            method works just like the
            <code>allowDomain()</code>
            method, 
  except that the
            <code>allowInsecureDomain()</code>
            method additionally permits SWF files 
  from non-HTTPS origins to send LocalConnection calls to files from HTTPS origins.  This difference 
  is meaningful only if you call the
            <code>allowInsecureDomain()</code>
            method from a
  file that was loaded using HTTPS.  You must call the
            <code>allowInsecureDomain()</code>
            method even 
  if you are crossing a non-HTTPS/HTTPS boundary within the same domain; by default, LocalConnection calls 
  are never permitted from non-HTTPS files to HTTPS files, even within the same domain.
          </p>
          
          <p>
            Calling
            <code>allowInsecureDomain()</code>
            is not recommended,
  because it can compromise the security offered by HTTPS.  When you
  load a file over HTTPS, you can be reasonably sure that the file
  will not be tampered with during delivery over the network.  If you
  then permit a non-HTTPS file to make LocalConnection calls to the
  HTTPS file, you are accepting calls from a file that may in fact have
  been tampered with during delivery.  This generally requires extra
  vigilance because you cannot trust the authenticity of LocalConnection
  calls arriving at your HTTPS file.
          </p>
          
          <p>By default, files hosted using the HTTPS protocol can be accessed only by other files hosted 
  using the HTTPS protocol. This implementation maintains the integrity provided by the HTTPS protocol.</p>
          
          <p>Using this method to override the default behavior is not recommended, because it compromises HTTPS security.
  However, you might need to do so, for example, if you need to permit access to HTTPS SWF files published for 
  Flash Player 9 or later from HTTP files SWF published for Flash Player 6 or earlier.</p>
          
          <p>For more information related to security, see the following:</p>
          
          <ul><li>
              The
              <a href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" target="external">security chapter</a>
              in the
              <i>Programming ActionScript 3.0</i>
              book and the latest comments on LiveDocs
            </li><li>
              The Flash Player Developer Center Topic:
              <a href="http://www.adobe.com/go/devnet_security_en" target="external">Security</a>
            </li></ul>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><a href="../../statements.html#..._(rest)_parameter">...</a> <span class="label">domains</span></code> &mdash; 
              One or more strings that name the domains from which
  you want to allow LocalConnection calls. There are two special cases
  for this parameter:
              <ul><li>You can specify the wildcard character "*" to allow calls from all domains.
   Specifying "*" does not include local hosts.</li><li>
                  You can specify the string "
                  <code>localhost</code>
                  " to allow calls to this SWF file from SWF files that
   are installed locally. Flash Player 8 introduced security restrictions on local SWF files. A SWF file
   that is allowed to access the Internet cannot also have access to the local file system. If you
   specify "
                  <code>localhost</code>
                  ", any local SWF file can access this SWF file. Remember that you must also 
   designate the calling SWF file as a local-with-networking SWF file at authoring time.
                </li></ul>
              
            </td></tr></table></p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../ArgumentError.html">ArgumentError</a> </code> &mdash; All parameters specified must be non-null strings.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="LocalConnection.html#allowDomain()" target="">flash.net.LocalConnection.allowDomain()</a></div></div><a name="close()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">close</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function close():<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</td></tr></table><p></p><p></p><p>
          Closes (disconnects) a LocalConnection object. Issue this command when you no longer want the object 
  to accept commands &mdash; for example, when you want to issue a
          <code>connect()</code>
          command using the same
          <code>connectionName</code>
          parameter in another SWF file.
        </p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../ArgumentError.html">ArgumentError</a> </code> &mdash; The LocalConnection instance is not connected, so it cannot be closed.</td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="LocalConnection.html#connect()" target="">flash.net.LocalConnection.connect()</a></div></div><a name="connect()"></a><a name="connect(String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">connect</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function connect(connectionName:<a href="../../String.html">String</a>):<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</td></tr></table><p></p><p></p><p>
          Prepares a LocalConnection object to receive commands from a
          <code>send()</code>
          command 
  (called the
          <i>sending LocalConnection object</i>
          ). The object used with this command is 
  called the
          <i>receiving LocalConnection object</i>
          . The receiving and sending objects 
  must be running on the same client computer.
          <p>To avoid a race condition, define the methods attached to the 
  receiving LocalConnection object before 
  calling this method, as shown in the LocalConnection class example.</p>
          
          <p>
            By default, the
            <code>connectionName</code>
            argument is resolved into a value of
            <code>
              "
              <i>superdomain</i>
              :connectionName"
            </code>
            , 
  where
            <code>
              <i>superdomain</i>
            </code>
            is the superdomain of the file that contains the
            <code>connect()</code>
            command. For example, if the file that contains the 
  receiving LocalConnection object is located at www.someDomain.com,
            <code>connectionName</code>
            resolves to
            <code>"someDomain.com:connectionName"</code>
            . (If a file running in Flash Player
  is located on the client computer, the value assigned to
            <code>superdomain</code>
            is
            <code>"localhost"</code>
            .)
          </p>
          
          <p>
            In content running in the
            <code>application</code>
            security sandbox in Adobe AIR (content
  installed with the AIR application), the runtime uses the string
            <code>app#</code>
            followed by the application
  ID for the AIR application (defined in the application descriptor file) in place of the superdomain. 
  For example a
            <code>connectionName</code>
            for an application with the application ID
            <code>com.example.air.MyApp</code>
            
            <code>connectionName</code>
            resolves to
            <code>"app#com.example.air.MyApp:connectionName"</code>
            .
          </p>
          
          <p>
            Also by default, Flash Player lets the receiving LocalConnection object accept commands only from 
  sending LocalConnection objects whose connection name also resolves into a value of
            <code>"</code>
            <code>
              <i>superdomain</i>
            </code>
            <code>:connectionName"</code>
            . In this way, Flash Player makes 
  it simple for files that are located in the same domain to communicate with each other.
          </p>
          
          <p>
            If you are implementing communication only between files in the same domain, specify a string 
  for
            <code>connectionName</code>
            that does not begin with an underscore (_) and that does not specify 
  a domain name (for example,
            <code>"myDomain:connectionName"</code>
            ). Use the same string in the
            <code>connect(connectionName)</code>
            method.
          </p>
          
          <p>
            If you are implementing communication between files in different domains, specifying a string 
  for
            <code>connectionName</code>
            that begins with an underscore (_) makes the file with the
  receiving LocalConnection object more portable between domains. Here are the two possible cases:
          </p>
          
          <ul><li>
              If the string for
              <code>connectionName</code>
              does not begin with an underscore (_), 
   a prefix is added with the superdomain and a colon (for example,
              <code>"myDomain:connectionName"</code>
              ). Although this ensures that your connection does not conflict 
   with connections of the same name from other domains, any sending LocalConnection objects must 
   specify this superdomain (for example,
              <code>"myDomain:connectionName"</code>
              ). 
   If the file with the receiving LocalConnection object is moved to another domain, the player changes
   the prefix to reflect the new superdomain (for example,
              <code>"anotherDomain:connectionName"</code>
              ). 
   All sending LocalConnection objects would have to be manually edited to point to the new superdomain.
            </li><li>
              If the string for
              <code>connectionName</code>
              begins with an underscore (for example,
              <code>"_connectionName"</code>
              ), a prefix is not added to the string. This means that 
   the receiving and sending LocalConnection objects use identical strings for
              <code>connectionName</code>
              . If the receiving object uses
              <code>allowDomain()</code>
              to specify that connections from any domain will be accepted, the file with the receiving LocalConnection
   object can be moved to another domain without altering any sending LocalConnection objects.
            </li></ul>
          
          <p>
            For more information, see the discussion in the class overview and the discussion 
  of
            <code>connectionName</code>
            in
            <code>send()</code>
            , and also
  the
            <code>allowDomain()</code>
            and
            <code>domain</code>
            entries.
          </p>
          
          <p>
            <b>Note:</b>
            Colons are used as special characters to separate the superdomain from the
            <code>connectionName</code>
            string. A string for
            <code>connectionName</code>
            that contains a colon is
  not valid.
          </p>
          
          <p>
            When you use this method
            
            , consider the
            <span>Flash Player</span>
            
            
            security model. By default, a LocalConnection object 
  is associated with the sandbox of the  file that created it, and cross-domain calls to LocalConnection
  objects are not allowed unless you call the
            <code>LocalConnection.allowDomain()</code>
            method in the 
  receiving file.
            <span>
              You can prevent a file from using this method by setting the
              <code>allowNetworking</code>
              parameter of the the
              <code>object</code>
              and
              <code>embed</code>
              tags in the HTML page that contains the SWF content.
            </span>
            However, in Adobe AIR, 
  content in the
            <code>application</code>
            security sandbox (content installed with the AIR application) 
  are not restricted by these security limitations.
          </p>
          
          <p>For more information, see the following:</p>
          
          <ul><li>
              The
              <a href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" target="external">security chapter</a>
              in the
              <i>Programming ActionScript 3.0</i>
              book and the latest comments on LiveDocs
            </li><li>
              The Flash Player Developer Center Topic:
              <a href="http://www.adobe.com/go/devnet_security_en" target="external">Security</a>
            </li></ul>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">connectionName</span>:<a href="../../String.html">String</a></code> &mdash; 
              A string that corresponds to the connection name specified in the
              <code>send()</code>
              command that wants to communicate with the receiving LocalConnection object.
            </td></tr></table></p><br/><span class="label">Throws</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code><a href="../../TypeError.html">TypeError</a> </code> &mdash; 
              The value passed to the
              <code>connectionName</code>
              parameter must be non-null.
            </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../ArgumentError.html">ArgumentError</a> </code> &mdash; 
              This error can occur for three reasons: 1) The string value passed to the
              <code>connectionName</code>
              parameter
  was null. Pass a non-null value. 2) The value passed to the
              <code>connectionName</code>
              parameter
  contained a colon (:). Colons are used as special characters to separate the superdomain 
  from the
              <code>connectionName</code>
              string in the
              <code>send()</code>
              method, not the
              <code>connect()</code>
              method. 3) The LocalConnection instance is already connected.
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="LocalConnection.html#send()" target="">flash.net.LocalConnection.send()</a><br/><a href="LocalConnection.html#allowDomain()" target="">flash.net.LocalConnection.allowDomain()</a><br/><a href="LocalConnection.html#domain" target="">flash.net.LocalConnection.domain</a></div></div><a name="send()"></a><a name="send(String,String,restParam)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">send</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><code> public function send(connectionName:<a href="../../String.html">String</a>, methodName:<a href="../../String.html">String</a>, <a href="../../statements.html#..._(rest)_parameter">...</a> arguments):<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</td></tr></table><p></p><p></p><p>
          Invokes the method named
          <code>methodName</code>
          on a connection opened with the
          <code>connect(</code>
          <code>connectionName</code>
          <code>)</code>
          method (the receiving LocalConnection 
  object). The object used with this command is called the
          <i>sending LocalConnection object</i>
          .
  The SWF files that contain the sending and receiving objects must be running on the same client computer.
          <p>
            There is a 40 kilobyte limit to the amount of data you can pass as parameters to this command.
  If
            <code>send()</code>
            throws an
            <code>ArgumentError</code>
            but your syntax is correct, try dividing the
            <code>send()</code>
            requests into multiple commands, each with less than 40K of data.
          </p>
          
          <p>
            As discussed in the
            <code>connect()</code>
            entry, the current superdomain in added to
            <code>connectionName</code>
            by default. If you are implementing communication between different domains,
  you need to define
            <code>connectionName</code>
            in both the sending and receiving LocalConnection 
  objects in such a way that the current superdomain is not added to
            <code>connectionName</code>
            . 
  You can do this in one of the following two ways:
          </p>
          
          <ul><li>
              Use an underscore (_) at the beginning of
              <code>connectionName</code>
              in both the sending and 
   receiving LocalConnection objects. In the file that contains the receiving object, use
              <code>LocalConnection.allowDomain()</code>
              to specify that connections from any domain will be accepted.
   This implementation lets you store your sending and receiving files in any domain.
            </li><li>
              Include the superdomain in
              <code>connectionName</code>
              in the sending LocalConnection 
   object &mdash; for example,
              <code>myDomain.com:myConnectionName</code>
              . In the receiving object, use
              <code>LocalConnection.allowDomain()</code>
              to specify that connections from the specified superdomain 
   will be accepted (in this case, myDomain.com) or that connections from any domain will be accepted.
            </li></ul>
          
          <p>
            <b>Note:</b>
            You cannot specify a superdomain in
            <code>connectionName</code>
            in the receiving 
  LocalConnection object &mdash; you can do this in only the sending LocalConnection object.
          </p>
          
          <p>
            When you use this method
            
            , consider the
            <span>Flash Player</span>
            
            
            security model. By default, a LocalConnection object 
  is associated with the sandbox of the file that created it, and cross-domain calls to LocalConnection
  objects are not allowed unless you call the
            <code>LocalConnection.allowDomain()</code>
            method in the 
  receiving file.  For SWF content running in the browser, ou can prevent a file from using this method by setting the
            <code>allowNetworking</code>
            parameter of the the
            <code>object</code>
            and
            <code>embed</code>
            tags in the HTML page that contains the SWF content. However, in Adobe AIR, content in the
            <code>application</code>
            security sandbox (content installed with the AIR application) are not 
  restricted by these security limitations.
          </p>
          
          <p>For more information, see the following:</p>
          
          <ul><li>
              The
              <a href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" target="external">security chapter</a>
              in the
              <i>Programming ActionScript 3.0</i>
              book and the latest comments on LiveDocs
            </li><li>
              The Flash Player Developer Center Topic:
              <a href="http://www.adobe.com/go/devnet_security_en" target="external">Security</a>
            </li></ul>
          
        </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">connectionName</span>:<a href="../../String.html">String</a></code> &mdash; 
              Corresponds to the connection name specified in the
              <code>connect()</code>
              command 
  that wants to communicate with the sending LocalConnection object.
            </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><span class="label">methodName</span>:<a href="../../String.html">String</a></code> &mdash; 
              The name of the method to be invoked in the receiving LocalConnection object. The 
  following method names cause the command to fail:
              <code>send</code>
              ,
              <code>connect</code>
              ,
              <code>close</code>
              ,
              <code>allowDomain</code>
              ,
              <code>allowInsecureDomain</code>
              ,
              <code>client</code>
              , and
              <code>domain</code>
              .
            </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><a href="../../statements.html#..._(rest)_parameter">...</a> <span class="label">arguments</span></code> &mdash; Additional optional parameters to be passed to the specified method.</td></tr></table></p><br/><span class="label">Events</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><b>securityError</b>:<a href="../../flash/events/SecurityErrorEvent.html"><code>SecurityErrorEvent</code></a></code> &mdash; <code>LocalConnection.send()</code> attempted
  to communicate with a SWF file from a security sandbox to which the calling
  code does not have access. You can work around this in the receiver's
  implementation of <code>LocalConnection.allowDomain()</code>.</td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20px"></td><td><code><b>status</b>:<a href="../../flash/events/StatusEvent.html"><code>StatusEvent</code></a></code> &mdash; If the value of the <code>level</code> property is <code>"status"</code>,
  the call was successful; if the value is <code>"error"</code>, the call failed. The call can fail
  if the receiving SWF file refuses the connection.</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="../../TypeError.html">TypeError</a> </code> &mdash; 
              The value of either
              <code>connectionName</code>
              or
              <code>methodName</code>
              is null. Pass non-null values for these parameters.
            </td></tr><tr><td class="paramSpacer">&nbsp;</td></tr><tr><td width="20"></td><td><code><a href="../../ArgumentError.html">ArgumentError</a> </code> &mdash; 
              This error can occur for one of the following reasons:
  1) The value of either
              <code>connectionName</code>
              or
              <code>methodName</code>
              is an empty string. Pass valid strings for these parameters.
  2) The method specified in
              <code>methodName</code>
              is restricted. 
  3) The serialized message that is being sent is too large (larger than 40K).
            </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso"><a href="LocalConnection.html#allowDomain()" target="">flash.net.LocalConnection.allowDomain()</a><br/><a href="LocalConnection.html#connect()" target="">flash.net.LocalConnection.connect()</a><br/><a href="LocalConnection.html#domain" target="">flash.net.LocalConnection.domain</a></div></div><div class="detailSectionHeader"> Event Detail </div><a name="event:asyncError"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">asyncError</td><td class="detailHeaderType"> Event </td></tr></table><div class="detailBody"><span class="label">Event Object Type: </span><a href="../../flash/events/AsyncErrorEvent.html"><code>flash.events.AsyncErrorEvent</code></a><br/><span class="label">property AsyncErrorEvent.type  =  </span><a href="../../flash/events/AsyncErrorEvent.html#ASYNC_ERROR"><code>flash.events.AsyncErrorEvent.ASYNC_ERROR</code></a><br/><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>Dispatched when an exception is thrown asynchronously &mdash; that is, 
 from native asynchronous code.</p>
          The
          <code>AsyncErrorEvent.ASYNC_ERROR</code>
          constant defines the value of the
          <code>type</code>
          property of an
          <code>asyncError</code>
          event object.
          <p>This event has the following properties:</p>
          
          <table class="innertable" ><tr><th>Property</th><th>Value</th></tr><tr><td>
                    <code>bubbles</code>
                  </td><td>
                    <code>false</code>
                    
                  </td></tr><tr><td>
                    <code>cancelable</code>
                  </td><td>
                    <code>false</code>
                    ; there is no default
 behavior to cancel.
                    
                  </td></tr><tr><td>
                    <code>currentTarget</code>
                  </td><td>
                    The object that is actively processing the
 Event object with an event listener.
                    
                  </td></tr><tr><td>
                    <code>target</code>
                  </td><td>The object dispatching the event.</td></tr><tr><td>
                    <code>error</code>
                  </td><td>The error that triggered the event.</td></tr></table>
          
        </div><a name="event:securityError"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">securityError</td><td class="detailHeaderType"> Event </td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><span class="label">Event Object Type: </span><a href="../../flash/events/SecurityErrorEvent.html"><code>flash.events.SecurityErrorEvent</code></a><br/><span class="label">property SecurityErrorEvent.type  =  </span><a href="../../flash/events/SecurityErrorEvent.html#SECURITY_ERROR"><code>flash.events.SecurityErrorEvent.SECURITY_ERROR</code></a><br/><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>
          Dispatched if a call to
          <code>LocalConnection.send()</code>
          attempts to send data to a different security sandbox.
        </p>
          The
          <code>SecurityErrorEvent.SECURITY_ERROR</code>
          constant defines the value of the
          <code>type</code>
          property of a
          <code>securityError</code>
          event object.
          <p>This event has the following properties:</p>
          
          <table class="innertable" ><tr><th>Property</th><th>Value</th></tr><tr><td>
                    <code>bubbles</code>
                  </td><td>
                    <code>false</code>
                  </td></tr><tr><td>
                    <code>cancelable</code>
                  </td><td>
                    <code>false</code>
                    ; there is no default behavior to cancel.
                  </td></tr><tr><td>
                    <code>currentTarget</code>
                  </td><td>The object that is actively processing the Event 
 object with an event listener.</td></tr><tr><td>
                    <code>target</code>
                  </td><td>The network object reporting the security error.</td></tr><tr><td>
                    <code>text</code>
                  </td><td>Text to be displayed as an error message.</td></tr></table>
          
        <p><span class="label">See also</span></p><div class="seeAlso"><a href="LocalConnection.html#send()" target="">send()</a></div></div><a name="event:status"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">status</td><td class="detailHeaderType"> Event </td><td class="detailHeaderRule">&nbsp;</td></tr></table><div class="detailBody"><span class="label">Event Object Type: </span><a href="../../flash/events/StatusEvent.html"><code>flash.events.StatusEvent</code></a><br/><span class="label">property StatusEvent.type  =  </span><a href="../../flash/events/StatusEvent.html#STATUS"><code>flash.events.StatusEvent.STATUS</code></a><br/><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>
          Dispatched when a LocalConnection object reports its status. 
 If
          <code>LocalConnection.send()</code>
          is successful, the value of the
          <code>status</code>
          event
 object's
          <code>level</code>
          property is
          <code>"status"</code>
          ; if the call fails, the
          <code>level</code>
          property
 is
          <code>"error"</code>
          . If the receiving file refuses the connection, the call can fail
 without notification to the sending file.
        </p>
          Defines the value of the
          <code>type</code>
          property of a
          <code>status</code>
          event object.
          <p>This event has the following properties:</p>
          
          <table class="innertable" ><tr><th>Property</th><th>Value</th></tr><tr><td>
                    <code>bubbles</code>
                  </td><td>
                    <code>false</code>
                  </td></tr><tr><td>
                    <code>cancelable</code>
                  </td><td>
                    <code>false</code>
                    ; there is no default behavior to cancel.
                  </td></tr><tr><td>
                    <code>code</code>
                  </td><td>A description of the object's status.</td></tr><tr><td>
                    <code>currentTarget</code>
                  </td><td>The object that is actively processing the Event 
  object with an event listener.</td></tr><tr><td>
                    <code>level</code>
                  </td><td>
                    The category of the message, such as
                    <code>"status"</code>
                    ,
                    <code>"warning"</code>
                    or
                    <code>"error"</code>
                    .
                  </td></tr><tr><td>
                    <code>target</code>
                  </td><td>The object reporting its status.</td></tr></table>
          
        <p><span class="label">See also</span></p><div class="seeAlso"><a href="LocalConnection.html#send()" target="">LocalConnection.send()</a></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">LocalConnectionSenderExample.as</div><br/><div class="detailBody">
        This example consists of two ActionScript classes which 
 should be compiled into two separate SWF files:
        <p>
          In the LocalConnectionSenderExample SWF file, a LocalConnection instance is created, 
 and when the button is pressed the
          <code>call()</code>
          method is used to 
 call the method named
          <code>lcHandler</code>
          in the SWF file with the 
 connection name "myConnection," passing the contents of the 
 TextField as a parameter.
        </p>
        
        <p>
          In the LocalConnectionReceiverExample SWF file, a LocalConnection instance is 
 created and the
          <code>connect()</code>
          method is called to designate 
 this SWF file as the recipient of messages that are addressed to the 
 connection named "myConnection." In addition, this class includes 
 a public method named
          <code>lcHandler()</code>
          ; this method is the 
 one that is called by the LocalConnectionSenderExample SWF file. When it's called, 
 the text that is passed in as a parameter is appended to the 
 TextField on the Stage.
        </p>
        
        <p>
          <b>Note:</b>
          To test the example, both SWF files must 
 be loaded on the same computer simultaneously.
        </p>
        
        <div class="listing"><pre>// Code in LocalConnectionSenderExample.as
package {
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import flash.net.LocalConnection;
    import flash.text.TextField;
    import flash.text.TextFieldType;
    import flash.events.StatusEvent;
    import flash.text.TextFieldAutoSize;

    public class LocalConnectionSenderExample extends Sprite {
        private var conn:LocalConnection;
        
        // UI elements
        private var messageLabel:TextField;
        private var message:TextField;
        private var sendBtn:Sprite;
        
        public function LocalConnectionSenderExample() {
            buildUI();
            sendBtn.addEventListener(MouseEvent.CLICK, sendMessage);
            conn = new LocalConnection();
            conn.addEventListener(StatusEvent.STATUS, onStatus);
        }
        
        private function sendMessage(event:MouseEvent):void {
            conn.send("myConnection", "lcHandler", message.text);
        }
        
        private function onStatus(event:StatusEvent):void {
            switch (event.level) {
                case "status":
                    trace("LocalConnection.send() succeeded");
                    break;
                case "error":
                    trace("LocalConnection.send() failed");
                    break;
            }
        }
        
        private function buildUI():void {
            const hPadding:uint = 5;
            // messageLabel
            messageLabel = new TextField();
            messageLabel.x = 10;
            messageLabel.y = 10;
            messageLabel.text = "Text to send:";
            messageLabel.autoSize = TextFieldAutoSize.LEFT;
            addChild(messageLabel);
            
            // message
            message = new TextField();
            message.x = messageLabel.x + messageLabel.width + hPadding;
            message.y = 10;
            message.width = 120;
            message.height = 20;
            message.background = true;
            message.border = true;
            message.type = TextFieldType.INPUT;
            addChild(message);
            
            // sendBtn
            sendBtn = new Sprite();
            sendBtn.x = message.x + message.width + hPadding;
            sendBtn.y = 10;
            var sendLbl:TextField = new TextField();
            sendLbl.x = 1 + hPadding;
            sendLbl.y = 1;
            sendLbl.selectable = false;
            sendLbl.autoSize = TextFieldAutoSize.LEFT;
            sendLbl.text = "Send";
            sendBtn.addChild(sendLbl);
            sendBtn.graphics.lineStyle(1);
            sendBtn.graphics.beginFill(0xcccccc);
            sendBtn.graphics.drawRoundRect(0, 0, (sendLbl.width + 2 + hPadding + hPadding), (sendLbl.height + 2), 5, 5);
            sendBtn.graphics.endFill();
            addChild(sendBtn);
        }
    }
}</pre></div>
      </div><div class="exampleHeader">LocalConnectionReceiverExample.as</div><br/><div class="detailBody">
        <div class="listing"><pre>// Code in LocalConnectionReceiverExample.as
package {
    import flash.display.Sprite;
    import flash.net.LocalConnection;
    import flash.text.TextField;

    public class LocalConnectionReceiverExample extends Sprite {
        private var conn:LocalConnection;
        private var output:TextField;
        
        public function LocalConnectionReceiverExample()     {
            buildUI();
            
            conn = new LocalConnection();
            conn.client = this;
            try {
                conn.connect("myConnection");
            } catch (error:ArgumentError) {
                trace("Can't connect...the connection name is already being used by another SWF");
            }
        }
        
        public function lcHandler(msg:String):void {
            output.appendText(msg + "\n");
        }
        
        private function buildUI():void {
            output = new TextField();
            output.background = true;
            output.border = true;
            output.wordWrap = true;
            addChild(output);
        }
    }
}</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">LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection LocalConnection </div><div style="display:none">flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection flash.net.LocalConnection </div></div></body></html><!-- &copy; 2004-2008 Adobe Systems Incorporated. All rights reserved. <br/>Thu Oct 30 2008, 07:08 PM -07:00  -->
