<?xml version="1.0"?>
<apiPackage id="flash.net"><apiName>flash.net</apiName><apiDetail/><apiClassifier id="flash.net:XMLSocket"><apiName>XMLSocket</apiName><shortdesc>
 
 The XMLSocket class implements client sockets that let the 
 Flash Player or AIR application communicate
 with a server computer identified by an IP address or domain name.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>XMLsocket, XMLsocket object, built-in class
 </keyword></asCustoms></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
 
 The XMLSocket class implements client sockets that let the 
 <ph platform="actionscript">Flash Player or</ph> AIR application communicate
 with a server computer identified by an IP address or domain name. The XMLSocket class is useful for
 client-server applications that require low latency, such as real-time chat systems. A traditional 
 HTTP-based chat solution frequently polls the server and downloads new messages using an HTTP 
 request. In contrast, an XMLSocket chat solution maintains an open connection to the server, which
 lets the server immediately send incoming messages without a request from the client.
 To use the XMLSocket class, the server computer must run a daemon that understands the protocol used
 by the XMLSocket class. The protocol is described in the following list: 
 <ul>
   <li>XML messages are sent over a full-duplex TCP/IP stream socket connection.</li>
   <li>Each XML message is a complete XML document, terminated by a zero (0) byte.</li>
   <li>An unlimited number of XML messages can be sent and received over a single XMLSocket 
 connection.</li>
 </ul>
 
 <p>Setting up a server to communicate with the XMLSocket object can be challenging. If your application
 does not require real-time interactivity, use the URLLoader class instead of the XMLSocket class. </p>
 
 <p>To use the methods of the XMLSocket class, first use the constructor, <codeph>new XMLSocket</codeph>,
 to create an XMLSocket object.</p>
 
 <p>SWF files in the local-with-filesystem sandbox may not use sockets.</p>
      
  <p> <i>Socket policy files</i> on the target host specify the hosts from which SWF files
  can make socket connections, and the ports to which those connections can be made.
  The security requirements with regard to socket policy files have become more stringent
  in the last several releases of Flash Player. 
  In all versions of Flash Player, Adobe recommends the use of a socket policy file; 
  in some circumstances, a socket policy file is required. Therefore, if you
  are using XMLSocket objects, make sure that the target host provides a socket policy file
  if necessary. </p>
 
  <p>The following list summarizes the requirements for socket policy files
  in different versions of Flash Player:</p>
 
  <ul>
  
   <li> In Flash Player 9.0.124.0 and later, a socket policy file is required for any XMLSocket connection.
      That is, a socket policy file on the target host is required no matter what port 
      you are connecting to, and is required even if you are connecting 
      to a port on the same host that is serving the SWF file. </li>
 
   <li> In Flash Player versions 9.0.115.0 and earlier, if you want to connect to a port number below 1024,
      or if you want to connect to a host other than the one serving the SWF file, 
      a socket policy file on the target host is required. </li>
 
  <li> In Flash Player 9.0.115.0, even if a socket policy file isn't required, 
      a warning is displayed when using the Flash Debug Player if the target host
      doesn't serve a socket policy file. </li>
 
  </ul>
 
 <p>However, in Adobe AIR, content in the <codeph>application</codeph> security sandbox (content
 installed with the AIR application) are not restricted by these security limitations.</p>
 
 <p>For more information related to security, see the following:</p>
 
 <ul>
 
 <li class="flexonly">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
 in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
 <li class="flashonly">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
 in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
 
 <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
 </ul>
 
 </apiDesc><example conref="examples\XMLSocketExample.as"> The following example uses the class XMLSocketExample class to send data using 
 an XMLSocket and print information during XMLSocket events.  This is accomplished using
 the following steps:
 <ol>
  <li>The XMLSocketExample constructor creates a XMLSocket instance named <codeph>socket</codeph> and
  passes <codeph>socket</codeph> to <codeph>ConfigureListeners()</codeph> (described below) and then calls the
  <codeph>connect()</codeph> method of XMLSocket using the host name "localhost" and port
  number of <codeph>8080</codeph>.</li>
  <li>The <codeph>configureListeners()</codeph> method is then called, which adds listeners for each of the 
  supported XMLSocket events:
  <ul>
      <li><codeph>closeHandler()</codeph>: listens for the <codeph>close</codeph> event, which is dispatched
      after the network connection has been closed.</li>
      <li><codeph>connectHandler()</codeph>: listens for the <codeph>connect</codeph> event, dispatched when the network
      connection has been established.</li>
      <li><codeph>dataHandler()</codeph>: listens for the <codeph>data</codeph> events, dispatched every time
      the XMLSocket receives new data.</li>
      <li><codeph>progressHandler()</codeph>: listens for the <codeph>progress</codeph> events, dispatched when a call to
      <codeph>send()</codeph> has been made and while the send is ongoing.</li>
      <li><codeph>securityErrorHandler()</codeph>: listens for <codeph>securityError</codeph> events, which would be
      dispatched if an attempt was made to access the XMLSocket with the wrong local playback security setting or 
      using a port lower than 1024.</li>  
      <li><codeph>ioErrorHandler()</codeph>: listens for <codeph>ioError</codeph> events, which would happen only
      if an operation to send or receive data failed.</li>  
  </ul></li>
 </ol>
 <p><b>Notes:</b>
 <ul>
  <li>You need to compile the SWF file with "Local playback security" set to "Access network only".</li>
  <li>You need a server running on your domain using port 8080 for this example to work.</li>
  <li>If you are running Flash Player 9.0.124.0 or later, you need to place a socket policy file on your server 
    that permits socket connections from your domain to port 8080. For information on serving socket policy files, 
    see the Flash Player Developer Center Topic: 
  <xref href="http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html" scope="external">
  Setting up a socket policy file server</xref>.</li>
  </ul>
 </p>
<codeblock>

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.XMLSocket;

    public class XMLSocketExample extends Sprite {
        private var hostName:String = "localhost";
        private var port:uint = 8080;
        private var socket:XMLSocket;

        public function XMLSocketExample() {
            socket = new XMLSocket();
            configureListeners(socket);
            if (hostName &amp;&amp; port) {
                socket.connect(hostName, port);
            }
        }

        public function send(data:Object):void {
            socket.send(data);
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.CLOSE, closeHandler);
            dispatcher.addEventListener(Event.CONNECT, connectHandler);
            dispatcher.addEventListener(DataEvent.DATA, dataHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
        }

        private function closeHandler(event:Event):void {
            trace("closeHandler: " + event);
        }

        private function connectHandler(event:Event):void {
            trace("connectHandler: " + event);
        }

        private function dataHandler(event:DataEvent):void {
            trace("dataHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#URLLoader/load()"><linktext>flash.net.URLLoader.load()</linktext></link><link href="flash.net.xml#URLLoader"><linktext>flash.net.URLLoader</linktext></link></related-links><adobeApiEvent id="flash.net:XMLSocket_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError"><apiName>securityError</apiName><shortdesc>
 Dispatched if a call to the XMLSocket.connect() method
 attempts to connect either to a server outside the caller's security sandbox or to a port lower than 1024.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier>flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to the <codeph>XMLSocket.connect()</codeph> method
 attempts to connect either to a server outside the caller's security sandbox or to a port lower than 1024.
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#XMLSocket/connect()"><linktext>XMLSocket.connect()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket_flash.events.IOErrorEvent.IO_ERROR_ioError"><apiName>ioError</apiName><shortdesc>
 Dispatched when an input/output error occurs that causes a send or receive operation to fail.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier>flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when an input/output error occurs that causes a send or receive operation to fail. 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket_flash.events.DataEvent.DATA_data"><apiName>data</apiName><shortdesc>
 Dispatched after raw data is sent or received.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.DataEvent.DATA</apiEventType><adobeApiEventClassifier>flash.events.DataEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched after raw data is sent or received.
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket_flash.events.Event.CONNECT_connect"><apiName>connect</apiName><shortdesc>
 Dispatched after a successful call to the XMLSocket.connect() method.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.CONNECT</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched after a successful call to the <codeph>XMLSocket.connect()</codeph> method.
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket_flash.events.Event.CLOSE_close"><apiName>close</apiName><shortdesc>
 Dispatched when the server closes the socket connection.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.CLOSE</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when the server closes the socket connection. 
 The <codeph>close</codeph> event is dispatched only when the server
 closes the connection; it is not dispatched when you call the <codeph>XMLSocket.close()</codeph> method.
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:XMLSocket:XMLSocket"><apiName>XMLSocket</apiName><shortdesc>
    Creates a new XMLSocket object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/><apiParam><apiItemName>host</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>A fully qualified DNS domain name or an IP address in the form 
    <i>.222.333.444</i>. In Flash Player 9.0.115.0 and AIR 1.0 and later, 
    you can specify IPv6 addresses, such as rtmp://[2001:db8:ccc3:ffff:0:444d:555e:666f]. 
    You can also specify <codeph>null</codeph> to connect to the host server
    on which the SWF file resides.  If the SWF file issuing this call is running in a web browser, 
    <codeph>host</codeph> must be in the same domain as the SWF file.
    
    </apiDesc></apiParam><apiParam><apiItemName>port</apiItemName><apiOperationClassifier>int</apiOperationClassifier><apiData>0</apiData><apiDesc>The TCP port number on the target host used to establish a connection. 
      In Flash Player 9.0.124.0 and later, the target host must serve a socket policy file
      specifying that socket connections are permitted from the host serving the SWF file
      to the specified port. In earlier versions of Flash Player, a socket policy file is required
      only if you want to connect to a port number below 1024,
      or if you want to connect to a host other than the one serving the SWF file.
    
    
    </apiDesc></apiParam></apiConstructorDef><apiDesc>
    Creates a new XMLSocket object. If no parameters are specified, an initially disconnected socket 
    is created. If parameters are specified, a connection is attempted to the specified host and port.
    
    <p><b>Note:</b> It is strongly advised to use the constructor form <b>without parameters</b>, then
    add any event listeners, then call the <codeph>connect</codeph> method with <codeph>host</codeph>
    and <codeph>port</codeph> parameters. This sequence guarantees that all event listeners will work
    properly.</p>
    
    </apiDesc></apiConstructorDetail><related-links><link href="flash.net.xml#XMLSocket/connect()"><linktext>connect()</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:XMLSocket:close"><apiName>close</apiName><shortdesc>
     Closes the connection specified by the XMLSocket object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>xmlsocket.close, close
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
     Closes the connection specified by the XMLSocket object. 
     The <codeph>close</codeph> event is dispatched only when the server
     closes the connection; it is not dispatched when you call the <codeph>close()</codeph> method.
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#XMLSocket/connect()"><linktext>connect()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:XMLSocket:connect"><apiName>connect</apiName><shortdesc>
     Establishes a connection to the specified Internet host using the specified TCP port.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>xmlsocket.connect, connect
     
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Local untrusted files may not communicate with
     the Internet. Work around this limitation by reclassifying the file
     as local-with-networking or trusted.
     </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>You may not specify a socket port higher than
     65535.
     </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>host</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>A fully qualified DNS domain name or an IP address in the form 
     <i>111.222.333.444</i>. You can also specify <codeph>null</codeph> to connect to the host server
     on which the SWF file resides. If the calling file is a SWF file running in a web browser,
     <codeph>host</codeph> must be in the same domain as the file.
     
     </apiDesc></apiParam><apiParam><apiItemName>port</apiItemName><apiOperationClassifier>int</apiOperationClassifier><apiDesc>The TCP port number on the target host used to establish a connection. 
       In Flash Player 9.0.124.0 and later, the target host must serve a socket policy file
       specifying that socket connections are permitted from the host serving the SWF file
       to the specified port. In earlier versions of Flash Player, a socket policy file is required
       only if you want to connect to a port number below 1024,
       or if you want to connect to a host other than the one serving the SWF file.
     
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Establishes a connection to the specified Internet host using the specified TCP port.
     
     <p>If you specify <codeph>null</codeph> for the <codeph>host</codeph> parameter, the host 
     contacted is the one where the file calling <codeph>XMLSocket.connect()</codeph> resides. 
     For example, if the calling file was downloaded from www.adobe.com, specifying <codeph>null</codeph>
     for the host parameter means you are connecting to www.adobe.com.</p>
     
     
     <p platform="actionscript">You can prevent a file from using this method by setting the 
     <codeph>allowNetworking</codeph> parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> 
     tags in the HTML page that contains the SWF content.</p>
     
     <p>For more information, see the following:</p>
	 
     <ul>
     
     <li class="flexonly">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     <li class="flashonly">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
     <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     </ul>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.events.xml#Event/CONNECT"><linktext>flash.events.Event.CONNECT</linktext></link></related-links><adobeApiEvent id="flash.net:XMLSocket:connect_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>A connect operation attempted
     to connect to a host outside the caller's security sandbox, or
     to a port that requires a socket policy file.  Work around either problem by using
     a socket policy file on the target host.
     </apiDesc></adobeApiEventDetail><shortdesc>A connect operation attempted
     to connect to a host outside the caller's security sandbox, or
     to a port that requires a socket policy file.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket:connect_data"><apiName>data</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:DataEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when raw data has been received.
     </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when raw data has been received.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket:connect_connect"><apiName>connect</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when network connection has been established. 
     </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when network connection has been established.</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:XMLSocket:send"><apiName>send</apiName><shortdesc>
     Converts the XML object or data specified in the object parameter
     to a string and transmits it to the server, followed by a zero (0) byte.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>xmlsocket.send, send
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The XMLSocket object is not connected to the server.
     
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>object</apiItemName><apiType value=""/><apiDesc>An XML object or other data to transmit to the server.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Converts the XML object or data specified in the <codeph>object</codeph> parameter
     to a string and transmits it to the server, followed by a zero (0) byte. If <codeph>object</codeph> 
	 is an XML object, the string is the XML textual representation of the XML object. The 
     send operation is asynchronous; it returns immediately, but the data may be transmitted at a 
     later time. The <codeph>XMLSocket.send()</codeph> method does not return a value indicating whether
     the data was successfully transmitted.
     
     <p>If you do not connect the XMLSocket object to the server using 
     <codeph>XMLSocket.connect()</codeph>), the <codeph>XMLSocket.send()</codeph> 
     operation fails.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#XMLSocket/connect()"><linktext>connect()</linktext></link></related-links></apiOperation><apiValue id="flash.net:XMLSocket:connected:get"><apiName>connected</apiName><shortdesc>
     Indicates whether this XMLSocket object is currently connected.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Boolean</apiValueClassifier></apiValueDef><apiDesc>
     Indicates whether this XMLSocket object is currently connected. You can also check 
     whether the connection succeeded by registering for the <codeph>connect</codeph> 
     event and <codeph>ioError</codeph> event.
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#XMLSocket/event:connect"><linktext>connect</linktext></link><link href="flash.net.xml#XMLSocket/event:ioError"><linktext>ioError</linktext></link></related-links></apiValue><apiValue id="flash.net:XMLSocket:timeout:set"><apiName>timeout</apiName><shortdesc>
     Indicates the number of milliseconds to wait for a connection.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>int</apiValueClassifier></apiValueDef><apiDesc>
     Indicates the number of milliseconds to wait for a connection.
     
     <p>If the connection doesn't succeed within the specified time, the connection fails.
     The default value is 20,000 (twenty seconds).</p>
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="flash.net:ObjectEncoding"><apiName>ObjectEncoding</apiName><shortdesc>
 The ObjectEncoding class is used in defining serialization settings in classes 
 that serialize objects (such as FileStream, NetStream, NetConnection, SharedObject,
 and ByteArray) to work with prior versions of ActionScript.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>ObjectEncoding, ObjectEncoding object, built-in class, AMF, Action Message Format
 </keyword></asCustoms></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiFinal/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 The ObjectEncoding class is used in defining serialization settings in classes 
 that serialize objects (such as FileStream, NetStream, NetConnection, SharedObject,
 and ByteArray) to work with prior versions of ActionScript. 
 
 <p>Object encoding controls
 how objects are represented in Action Message Format (AMF). Flash Player uses 
 AMF to enable efficient communication between an application and a remote server.
 AMF encodes remote procedure calls into a compact binary representation that can 
 be transferred over HTTP/HTTPS or the RTMP/RTMPS protocol used by Flash Media Server.
 Objects and data values are serialized into this binary format, 
 which is generally more compact than other representations, such as XML.</p>
 
 <p>Adobe AIR and Flash Player 9 can serialize in two different formats: AMF3 and AMF0.
 AMF3, the default serialization developed for ActionScript 3.0, provides various advantages 
 over AMF0, which is used for ActionScript 1.0 and 2.0. AMF3 sends data over
 the network more efficiently than AMF0. <ph platform="actionscript">AMF3 supports 
 sending <codeph>int</codeph> and <codeph>uint</codeph>
 objects as integers and supports data types that are available only in ActionScript 3.0, such as ByteArray,
 XML, and IExternalizable. It is available only in ActionScript 3.0 and with servers
 that use AMF3 encoding, such as Flex 2.</ph></p>
 
 <p>The ByteArray, FileStream, NetConnection, NetStream, <ph platform="actionscript">SharedObject,</ph>
 Socket, and URLStream classes contain an <codeph>objectEncoding</codeph> property that is assigned 
 a constant from the ObjectEncoding class. 
 The behavior of the <codeph>objectEncoding</codeph> property differs depending
 on the object; each class's <codeph>objectEncoding</codeph> property 
 description explains the behavior more thoroughly.</p>
 
 
 </apiDesc></apiClassifierDetail><apiValue id="flash.net:ObjectEncoding:AMF0"><apiName>AMF0</apiName><shortdesc>
	 Specifies that objects are serialized using the Action Message Format for ActionScript 1.0 and 2.0.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>0</apiData><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that objects are serialized using the Action Message Format for ActionScript 1.0 and 2.0.
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:ObjectEncoding:AMF3"><apiName>AMF3</apiName><shortdesc>
	 Specifies that objects are serialized using the Action Message Format for ActionScript 3.0.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>3</apiData><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that objects are serialized using the Action Message Format for ActionScript 3.0.
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:ObjectEncoding:DEFAULT"><apiName>DEFAULT</apiName><shortdesc>
	 Specifies the default (latest) format for the current runtime (either Flash&amp;#xAE;  
	 Player or Adobe&amp;#xAE; AIR&amp;#xAE;).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>3</apiData><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the default (latest) format for the current runtime (either Flash<sup>®</sup>  
	 Player or Adobe<sup>®</sup> AIR<sup>®</sup>). Because object encoding control is only 
	 available in Flash Player 9 and later and Adobe AIR, the earliest format used will be 
	 the Action Message Format for ActionScript 3.0.
	 
	 <p>For example, if an object has the <codeph>objectEncoding</codeph> property set to 
	 <codeph>ObjectEncoding.DEFAULT</codeph>, AMF3 encoding is used.
	 If, in the future, a later version of Flash Player or Adobe AIR introduces a new AMF version
	 and you republish your content, the application will use that new AMF version. 
	 You can use this constant only if you're not concerned at all about interoperability 
	 with previous versions.</p>
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:ObjectEncoding:dynamicPropertyWriter:get"><apiName>dynamicPropertyWriter</apiName><shortdesc>
	 Allows greater control over the serialization of dynamic properties of dynamic objects.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiStatic/><apiValueAccess value="readwrite"/><apiValueClassifier>flash.net:IDynamicPropertyWriter</apiValueClassifier></apiValueDef><apiDesc>
	 Allows greater control over the serialization of dynamic properties of dynamic objects.
	 When this property is set to <codeph>null</codeph>,
	 the default value, dynamic properties are serialized using native code, which writes
	 all dynamic properties excluding those whose value is a function.
     <p>This value is called only for properties of a dynamic object (objects declared 
     within a dynamic class) or for objects declared using the 
     <codeph>new</codeph> operator.</p>
	 
	 <p platform="actionscript">You can use this property to exclude properties of dynamic objects from 
     serialization; to write values to properties of dynamic objects; or to 
	 create new properties for dynamic objects. To do so, set this property to an object that
	 implements the IDynamicPropertyWriter interface. For more information, see the 
	 IDynamicPropertyWriter interface.</p>
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#IDynamicPropertyWriter"><linktext>IDynamicPropertyWriter</linktext></link></related-links></apiValue></apiClassifier><apiClassifier id="flash.net:Socket"><apiName>Socket</apiName><shortdesc>
 The Socket class enables code to make
 socket connections and to read and write raw binary data.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseInterface>flash.utils:IDataInput</apiBaseInterface><apiBaseInterface>flash.utils:IDataOutput</apiBaseInterface><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
 The Socket class enables code to make
 socket connections and to read and write raw binary data.  It is similar
 to XMLSocket but does not dictate the format of
 the received or transmitted data.
 
 <p>The Socket class is useful for working with servers that use binary protocols.</p>
 
 <p>To use the methods of the Socket class, first use the constructor, <codeph>new Socket</codeph>,
 to create a Socket object.</p>
 
 <p>SWF files in the local-with-filesystem sandbox may not use sockets.</p>
      
  <p> <i>Socket policy files</i> on the target host specify the hosts from which SWF files
  can make socket connections, and the ports to which those connections can be made.
  The security requirements with regard to socket policy files have become more stringent
  in the last several releases of Flash Player. 
  In all versions of Flash Player, Adobe recommends the use of a socket policy file; 
  in some circumstances, a socket policy file is required. Therefore, if you
  are using XMLSocket objects, make sure that the target host provides a socket policy file
  if necessary. </p>
 
  <p>The following list summarizes the requirements for socket policy files
  in different versions of Flash Player:</p>
 
  <ul>
  
   <li> In Flash Player 9.0.124.0 and later, a socket policy file is required for any Socket connection.
      That is, a socket policy file on the target host is required no matter what port 
      you are connecting to, and is required even if you are connecting 
      to a port on the same host that is serving the SWF file. </li>
 
   <li> In Flash Player versions 9.0.115.0 and earlier, if you want to connect to a port number below 1024,
      or if you want to connect to a host other than the one serving the SWF file, 
      a socket policy file on the target host is required. </li>
 
  <li> In Flash Player 9.0.115.0, even if a socket policy file isn't required, 
      a warning is displayed when using the Flash Debug Player if the target host
      doesn't serve a socket policy file. </li>
 
  </ul>
 
 <p>However, in Adobe AIR, content in the <codeph>application</codeph> security sandbox (content
 installed with the AIR application) are not restricted by these security limitations.</p>
  
 <p>For more information related to security, see the following:</p>
 
 <ul>
 
 <li class="flexonly">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
 in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
 <li class="flashonly">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
 in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
 
 <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
 </ul>
 
 </apiDesc><example conref="examples\SocketExample.as"> The following example reads from and writes to a socket and outputs information
 transmitted during socket events. Highlights of the example follow:
 <ol>
    <li>The constructor creates a <codeph>CustomSocket</codeph> instance named <codeph>socket</codeph> and passes the
     host name <codeph>localhost</codeph> and port 80 as arguments. Since <codeph>CustomSocket</codeph> extends
     Socket, a call to <codeph>super()</codeph> calls Socket's constructor.</li>
    <li>The example then calls the <codeph>configureListeners()</codeph> method, which adds listeners for  
     Socket events.</li>
      <li>Finally, the socket <codeph>connect()</codeph> method is called with <codeph>localhost</codeph> as the 
      host name and 80 as the port number.</li>
 </ol>
 
 <p> <b>Note:</b> To run the example, you need a server running on the same domain
 where the SWF resides (in the example, <codeph>localhost</codeph>) and listening on port 80.</p>
<codeblock>

package {
    import flash.display.Sprite;

    public class SocketExample extends Sprite {

        public function SocketExample() {
            var socket:CustomSocket = new CustomSocket("localhost", 80);
        }
    }
}

import flash.errors.*;
import flash.events.*;
import flash.net.Socket;

class CustomSocket extends Socket {
    private var response:String;

    public function CustomSocket(host:String = null, port:uint = 0) {
        super();
        configureListeners();
        if (host &amp;&amp; port)  {
            super.connect(host, port);
        }
    }

    private function configureListeners():void {
        addEventListener(Event.CLOSE, closeHandler);
        addEventListener(Event.CONNECT, connectHandler);
        addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
        addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler);
    }

    private function writeln(str:String):void {
        str += "\n";
        try {
            writeUTFBytes(str);
        }
        catch(e:IOError) {
            trace(e);
        }
    }

    private function sendRequest():void {
        trace("sendRequest");
        response = "";
        writeln("GET /");
        flush();
    }

    private function readResponse():void {
        var str:String = readUTFBytes(bytesAvailable);
        response += str;
    }

    private function closeHandler(event:Event):void {
        trace("closeHandler: " + event);
        trace(response.toString());
    }

    private function connectHandler(event:Event):void {
        trace("connectHandler: " + event);
        sendRequest();
    }

    private function ioErrorHandler(event:IOErrorEvent):void {
        trace("ioErrorHandler: " + event);
    }

    private function securityErrorHandler(event:SecurityErrorEvent):void {
        trace("securityErrorHandler: " + event);
    }

    private function socketDataHandler(event:ProgressEvent):void {
        trace("socketDataHandler: " + event);
        readResponse();
    }
}
</codeblock></example></apiClassifierDetail><adobeApiEvent id="flash.net:Socket_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError"><apiName>securityError</apiName><shortdesc>
 Dispatched if a call to Socket.connect() 
 attempts to connect either to a server outside the caller's security sandbox or to a port lower than 1024.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>BRS check this info
 </internal></asCustoms></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier>flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to <codeph>Socket.connect()</codeph> 
 attempts to connect either to a server outside the caller's security sandbox or to a port lower than 1024.
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#Socket/connect()"><linktext>Socket.connect()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:Socket_flash.events.ProgressEvent.SOCKET_DATA_socketData"><apiName>socketData</apiName><shortdesc>
 Dispatched when a socket has received data.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.ProgressEvent.SOCKET_DATA</apiEventType><adobeApiEventClassifier>flash.events.ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when a socket has received data.
 Events of type <codeph>socketData</codeph> do not use the <codeph>ProgressEvent.bytesTotal</codeph>
 property. 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:Socket_flash.events.IOErrorEvent.IO_ERROR_ioError"><apiName>ioError</apiName><shortdesc>
 Dispatched when an input/output error occurs that causes a send or load operation to fail.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier>flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when an input/output error occurs that causes a send or load operation to fail. 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:Socket_flash.events.Event.CONNECT_connect"><apiName>connect</apiName><shortdesc>
 Dispatched when a network connection has been established.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.CONNECT</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when a network connection has been established. 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:Socket_flash.events.Event.CLOSE_close"><apiName>close</apiName><shortdesc>
 Dispatched when the server closes the socket connection.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.CLOSE</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when the server closes the socket connection. 
 The <codeph>close</codeph> event is dispatched only when the server
 closes the connection; it is not dispatched when you call the <codeph>Socket.close()</codeph> method.
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:Socket:Socket"><apiName>Socket</apiName><shortdesc>
    Creates a new Socket object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>BRS determine if all above events are accurate, and which ones also apply
     </internal></asCustoms></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/><apiException><apiDesc>This error occurs in SWF content<ph platform="javascript">.</ph>
	 <ph platform="actionscript"> for the following reasons:</ph>
	 
     <ul platform="actionscript">
       <li>Local-with-filesystem files cannot communicate with the Internet. You can 
       work around this problem by reclassifying this SWF file as local-with-networking or trusted.
	 	 This limitation is not set for AIR application content in the application security sandbox.</li>
	 
      <li>You cannot specify a socket port higher than 65535.</li>
    </ul>
	 
    </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiParam><apiItemName>host</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>A fully qualified DNS domain name or an IP address in the form 
    <i>111.222.333.444</i>. In Flash Player 9.0.115.0 and AIR 1.0 and later, 
    you can specify IPv6 addresses, such as rtmp://[2001:db8:ccc3:ffff:0:444d:555e:666f]. 
    You can also specify <codeph>null</codeph> to connect to the host server
    on which the SWF file resides.  If the SWF file issuing this call is running in a web browser, 
    <codeph>host</codeph> must be in the same domain as the SWF file.
    
    </apiDesc></apiParam><apiParam><apiItemName>port</apiItemName><apiOperationClassifier>int</apiOperationClassifier><apiData>0</apiData><apiDesc>The TCP port number on the target host used to establish a connection. 
      In Flash Player 9.0.124.0 and later, the target host must serve a socket policy file
      specifying that socket connections are permitted from the host serving the SWF file
      to the specified port. In earlier versions of Flash Player, a socket policy file is required
      only if you want to connect to a port number below 1024,
      or if you want to connect to a host other than the one serving the SWF file.
    
    
	 </apiDesc></apiParam></apiConstructorDef><apiDesc>
    Creates a new Socket object. If no parameters are specified, an initially disconnected socket 
    is created. If parameters are specified, a connection is attempted to the specified host and port.
    
    <p><b>Note:</b> It is strongly advised to use the constructor form <b>without parameters</b>, then
    add any event listeners, then call the <codeph>connect</codeph> method with <codeph>host</codeph>
    and <codeph>port</codeph> parameters. This sequence guarantees that all event listeners will work
    properly.</p>
    
    </apiDesc></apiConstructorDetail><adobeApiEvent id="flash.net:Socket:Socket_connect"><apiName>connect</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when a network connection has been established.
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when a network connection has been established.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:Socket:Socket_ioError"><apiName>ioError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when an input/output error 
    occurs that causes the connection to fail.
	 </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when an input/output error 
    occurs that causes the connection to fail.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:Socket:Socket_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc><ph platform="javascript">This error occurs in SWF content.</ph>
	 <ph platform="actionscript"> Dispatched if a call to <codeph>Socket.connect()</codeph> attempts 
    to connect either to a server that doesn't serve a socket policy file, 
    or to a server whose policy file doesn't grant the calling host access to the specified port.
    For more information about socket policy files, see the "Flash Player Security" chapter in 
	 <i>Programming ActionScript 3.0</i>.</ph>
	 
    </apiDesc></adobeApiEventDetail><shortdesc>This error occurs in SWF content.
	  Dispatched if a call to Socket.connect() attempts 
    to connect either to a server that doesn't serve a socket policy file, 
    or to a server whose policy file doesn't grant the calling host access to the specified port.</shortdesc></adobeApiEvent></apiConstructor><apiOperation id="flash.net:Socket:close"><apiName>close</apiName><shortdesc>
     Closes the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The socket could not be closed, or the socket was not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
     Closes the socket. You cannot read or write any data after the <codeph>close()</codeph> method
     has been called.
     
     <p>The <codeph>close</codeph> event is dispatched only when the server
     closes the connection; it is not dispatched when you call the <codeph>close()</codeph> method.</p>
     
     <p>You can reuse the Socket object by calling the <codeph>connect()</codeph> method on it again.</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:connect"><apiName>connect</apiName><shortdesc>
     Connects the socket to the specified host and port.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>BRS compare this entire description with XMLSocket.connect() and make consistent
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>No host was specified and the connection failed.
	 
	 </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiException><apiDesc>This error occurs in SWF content<ph platform="javascript">.</ph>
	 <ph platform="actionscript"> for the following reasons:</ph>
	 
          <ul platform="actionscript">
              <li>Local untrusted SWF files may not communicate with
	              the Internet. You can work around this limitation by reclassifying the 
                  file as local-with-networking or as trusted.</li>
               <li>You cannot specify a socket port higher than 65535.</li>
           <li>In the HTML page that contains the SWF content, the
          <codeph>allowNetworking</codeph> parameter of the <codeph>object</codeph> 
          and <codeph>embed</codeph> tags is set to <codeph>"none"</codeph>.</li>
	 
          </ul>
     
     </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>host</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The name or IP address of the host to connect to. If no host is specified,
	      the host that is contacted is the host where the calling file 
          resides. If you do not specify a host, use an event listener to 
          determine whether the connection was successful.
     </apiDesc></apiParam><apiParam><apiItemName>port</apiItemName><apiOperationClassifier>int</apiOperationClassifier><apiDesc>The port number to connect to.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Connects the socket to the specified host and port.
     If the connection fails immediately, either an event is dispatched
     or an exception is thrown: an error event is dispatched if a host was
     specified, and an exception is thrown if no host was specified.
     Otherwise, the status of the connection is reported by an event.
     If the socket is already connected, the existing connection is closed first.
     
     </apiDesc></apiOperationDetail><adobeApiEvent id="flash.net:Socket:connect_connect"><apiName>connect</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when a network connection has been 
          established.
     </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when a network connection has been 
          established.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:Socket:connect_ioError"><apiName>ioError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched if a host is specified and an 
          input/output error occurs that causes the connection to fail.
     </apiDesc></adobeApiEventDetail><shortdesc>Dispatched if a host is specified and an 
          input/output error occurs that causes the connection to fail.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:Socket:connect_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched if a call to 
          <codeph>Socket.connect()</codeph> attempts to connect 
         either to a server that doesn't serve a socket policy file, 
         or to a server whose policy file doesn't grant the calling host access to the specified port.
         For more information, 
          see the "Flash Player Security" chapter in <i>Programming 
          ActionScript 3.0</i>.
     </apiDesc></adobeApiEventDetail><shortdesc>Dispatched if a call to 
          Socket.connect() attempts to connect 
         either to a server that doesn't serve a socket policy file, 
         or to a server whose policy file doesn't grant the calling host access to the specified port.</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:Socket:flush"><apiName>flush</apiName><shortdesc>
     Flushes any accumulated data in the socket's output buffer.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.       
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
     Flushes any accumulated data in the socket's output buffer.
     Data written by the <codeph>write</codeph> methods is not
     immediately transmitted; it is queued until the
     <codeph>flush()</codeph> method is called.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readBoolean"><apiName>readBoolean</apiName><shortdesc>
     Reads a Boolean value from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A value of <codeph>true</codeph> if the byte read is nonzero, 
          otherwise <codeph>false</codeph>.
     
     </apiDesc><apiOperationClassifier>Boolean</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads a Boolean value from the socket. After reading a single byte, the
     method returns <codeph>true</codeph> if the byte is nonzero, and 
     <codeph>false</codeph> otherwise.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readByte"><apiName>readByte</apiName><shortdesc>
     Reads a signed byte from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A value from -128 to 127.
     
     </apiDesc><apiOperationClassifier>int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads a signed byte from the socket.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readBytes"><apiName>readBytes</apiName><shortdesc>
     Reads the number of data bytes specified by the length 
     parameter from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is 
          not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>bytes</apiItemName><apiOperationClassifier>flash.utils:ByteArray</apiOperationClassifier><apiDesc>The ByteArray object to read data into.
     </apiDesc></apiParam><apiParam><apiItemName>offset</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiData>0</apiData><apiDesc>The offset at which data reading should begin in the byte 
          array.
     </apiDesc></apiParam><apiParam><apiItemName>length</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiData>0</apiData><apiDesc>The number of bytes to read. The default value of 0 causes
          all available data to be read.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Reads the number of data bytes specified by the <codeph>length</codeph> 
     parameter from the socket. The bytes are read into the specified byte
     array, starting at the position indicated by <codeph>offset</codeph>.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readDouble"><apiName>readDouble</apiName><shortdesc>
     Reads an IEEE 754 double-precision floating-point number from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>An IEEE 754 double-precision floating-point number.
     
     </apiDesc><apiOperationClassifier>Number</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads an IEEE 754 double-precision floating-point number from the socket.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readFloat"><apiName>readFloat</apiName><shortdesc>
     Reads an IEEE 754 single-precision floating-point number from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>An IEEE 754 single-precision floating-point number.
     </apiDesc><apiOperationClassifier>Number</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads an IEEE 754 single-precision floating-point number from the socket.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readInt"><apiName>readInt</apiName><shortdesc>
     Reads a signed 32-bit integer from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A value from -2147483648 to 2147483647.
     
     </apiDesc><apiOperationClassifier>int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads a signed 32-bit integer from the socket.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readMultiByte"><apiName>readMultiByte</apiName><shortdesc>
     Reads a multibyte string from the byte stream, using the specified character set.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>Socket, Socket.readMultiByte, readMultiByte
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiReturn><apiDesc>A UTF-8 encoded string.
     
     </apiDesc><apiOperationClassifier>String</apiOperationClassifier></apiReturn><apiParam><apiItemName>length</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiDesc>The number of bytes from the byte stream to read.
     </apiDesc></apiParam><apiParam><apiItemName>charSet</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The string denoting the character set to use to interpret the bytes. 
     Possible character set strings include <codeph>"shift_jis"</codeph>, <codeph>"CN-GB"</codeph>, and
     <codeph>"iso-8859-1"</codeph>.
     For a complete list, see <xref href="../../charset-codes.html">Supported Character Sets</xref>.
     
     <p><b>Note:</b> If the value for the <codeph>charSet</codeph> parameter is not recognized 
     by the current system, then the application uses the system's default code page as the character set. 
     For example, a value for the <codeph>charSet</codeph> parameter, as in <codeph>myTest.readMultiByte(22, "iso-8859-01")</codeph> 
     that uses <codeph>01</codeph> instead of <codeph>1</codeph> might work on your development machine, but not on another machine. 
     On the other machine, the application will use the system's default code page.</p>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Reads a multibyte string from the byte stream, using the specified character set.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readObject"><apiName>readObject</apiName><shortdesc>
     Reads an object from the socket, encoded in AMF serialized format.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>The deserialized object
     
     </apiDesc><apiType value="any"/></apiReturn></apiOperationDef><apiDesc>
     Reads an object from the socket, encoded in AMF serialized format.
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#ObjectEncoding"><linktext>ObjectEncoding</linktext></link><link href="../../flash/net/package.html#registerClassAlias()"><linktext>flash.net.registerClassAlias()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:readShort"><apiName>readShort</apiName><shortdesc>
     Reads a signed 16-bit integer from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A value from -32768 to 32767.
     
     </apiDesc><apiOperationClassifier>int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads a signed 16-bit integer from the socket.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readUTF"><apiName>readUTF</apiName><shortdesc>
     Reads a UTF-8 string from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A UTF-8 string.
     </apiDesc><apiOperationClassifier>String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads a UTF-8 string from the socket.  The string is assumed to be prefixed 
     with an unsigned short integer that indicates the length in bytes.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readUTFBytes"><apiName>readUTFBytes</apiName><shortdesc>
     Reads the number of UTF-8 data bytes specified by the length 
     parameter from the socket, and returns a string.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A UTF-8 string.
     </apiDesc><apiOperationClassifier>String</apiOperationClassifier></apiReturn><apiParam><apiItemName>length</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiDesc>The number of bytes to read.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Reads the number of UTF-8 data bytes specified by the <codeph>length</codeph> 
     parameter from the socket, and returns a string.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readUnsignedByte"><apiName>readUnsignedByte</apiName><shortdesc>
     Reads an unsigned byte from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A value from 0 to 255.
     
     </apiDesc><apiOperationClassifier>uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads an unsigned byte from the socket.  
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readUnsignedInt"><apiName>readUnsignedInt</apiName><shortdesc>
     Reads an unsigned 32-bit integer from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A value from 0 to 4294967295.
     
     </apiDesc><apiOperationClassifier>uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads an unsigned 32-bit integer from the socket.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readUnsignedShort"><apiName>readUnsignedShort</apiName><shortdesc>
     Reads an unsigned 16-bit integer from the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available to read.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A value from 0 to 65535.
     
     </apiDesc><apiOperationClassifier>uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads an unsigned 16-bit integer from the socket.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:writeBoolean"><apiName>writeBoolean</apiName><shortdesc>
     Writes a Boolean value to the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>Boolean</apiOperationClassifier><apiDesc>The value to write to the socket: 1 (<codeph>true</codeph>) or 0 (<codeph>false</codeph>).
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes a Boolean value to the socket. This method writes a single byte,
     with either a value of 1 (<codeph>true</codeph>) or 0 (<codeph>false</codeph>).
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeByte"><apiName>writeByte</apiName><shortdesc>
     Writes a byte to the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>int</apiOperationClassifier><apiDesc>The value to write to the socket. The low 8 bits of the
     value are used; the high 24 bits are ignored.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes a byte to the socket.
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeBytes"><apiName>writeBytes</apiName><shortdesc>
     Writes a sequence of bytes from the specified byte array.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>bytes</apiItemName><apiOperationClassifier>flash.utils:ByteArray</apiOperationClassifier><apiDesc>The ByteArray object to write data from.
     </apiDesc></apiParam><apiParam><apiItemName>offset</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiData>0</apiData><apiDesc>The zero-based offset into the <codeph>bytes</codeph> ByteArray
          object at which data writing should begin.
     </apiDesc></apiParam><apiParam><apiItemName>length</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiData>0</apiData><apiDesc>The number of bytes to write.  The default value of 0 causes
          the entire buffer to be written, starting at the value specified by 
          the <codeph>offset</codeph> parameter.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes a sequence of bytes from the specified byte array. The write 
     operation starts at the position specified by <codeph>offset</codeph>.
     
     <p>If you omit the <codeph>length</codeph> parameter the default
     length of 0 causes the method to write the entire buffer starting at
     <codeph>offset</codeph>.</p>
     
     <p>If you also omit the <codeph>offset</codeph> parameter, the entire buffer is written.</p> 
      
     <p>If <codeph>offset</codeph> or <codeph>length</codeph>
     is out of range, they are adjusted to match the beginning and end
     of the <codeph>bytes</codeph> array.</p>
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeDouble"><apiName>writeDouble</apiName><shortdesc>
     Writes an IEEE 754 double-precision floating-point number to the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>Number</apiOperationClassifier><apiDesc>The value to write to the socket.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes an IEEE 754 double-precision floating-point number to the socket.
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeFloat"><apiName>writeFloat</apiName><shortdesc>
     Writes an IEEE 754 single-precision floating-point number to the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>Number</apiOperationClassifier><apiDesc>The value to write to the socket.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes an IEEE 754 single-precision floating-point number to the socket.
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeInt"><apiName>writeInt</apiName><shortdesc>
     Writes a 32-bit signed integer to the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>int</apiOperationClassifier><apiDesc>The value to write to the socket.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes a 32-bit signed integer to the socket.
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeMultiByte"><apiName>writeMultiByte</apiName><shortdesc>
     Writes a multibyte string from the byte stream, using the specified character set.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>Socket, Socket.writeMultiByte, writeMultiByte
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The string value to be written.
     </apiDesc></apiParam><apiParam><apiItemName>charSet</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The string denoting the character set to use to interpret the bytes. 
     Possible character set strings include <codeph>"shift_jis"</codeph>, <codeph>"CN-GB"</codeph>, 
     and <codeph>"iso-8859-1"</codeph>. For a complete list, see 
     <xref href="../../charset-codes.html">Supported Character Sets</xref>. 
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes a multibyte string from the byte stream, using the specified character set.
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeObject"><apiName>writeObject</apiName><shortdesc>
     Write an object to the socket in AMF serialized format.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>object</apiItemName><apiType value=""/><apiDesc>The object to be serialized.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Write an object to the socket in AMF serialized format.
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link><link href="flash.net.xml#ObjectEncoding"><linktext>ObjectEncoding</linktext></link><link href="../../flash/net/package.html#registerClassAlias()"><linktext>flash.net.registerClassAlias()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeShort"><apiName>writeShort</apiName><shortdesc>
     Writes a 16-bit integer to the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>int</apiOperationClassifier><apiDesc>The value to write to the socket.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes a 16-bit integer to the socket. The bytes written are as follows:
     
     <pre><codeph>(v &gt;&gt; 8) &amp; 0xff v &amp; 0xff</codeph></pre>
     
     <p>The low 16 bits of the parameter are used; the high 16 bits
     are ignored.</p>
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeUTF"><apiName>writeUTF</apiName><shortdesc>
     Writes the following data to the socket: a 16-bit unsigned integer, which
     indicates the length of the specified UTF-8 string in bytes, followed by
     the string itself.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The length is larger than 65535.
     </apiDesc><apiItemName>RangeError</apiItemName><apiOperationClassifier>RangeError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The string to write to the socket.
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes the following data to the socket: a 16-bit unsigned integer, which
     indicates the length of the specified UTF-8 string in bytes, followed by
     the string itself.
     
     <p>Before writing the string, the method calculates the number of bytes 
     that are needed to represent all characters of the string.</p>
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeUTFBytes"><apiName>writeUTFBytes</apiName><shortdesc>
     Writes a UTF-8 string to the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The string to write to the socket.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes a UTF-8 string to the socket. 
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph>
     method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeUnsignedInt"><apiName>writeUnsignedInt</apiName><shortdesc>
     Writes a 32-bit unsigned integer to the socket.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>An I/O error occurred on the socket, or the socket is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiDesc>The value to write to the socket.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Writes a 32-bit unsigned integer to the socket.
     
     <p><b>Note:</b> Data written by this method is not
     immediately transmitted; it is queued until the <codeph>flush()</codeph> method is called.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Socket/flush()"><linktext>flush()</linktext></link></related-links></apiOperation><apiValue id="flash.net:Socket:bytesAvailable:get"><apiName>bytesAvailable</apiName><shortdesc>
     The number of bytes of data available for reading in the input buffer.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
     The number of bytes of data available for reading in the input buffer.
     
     <p>Your code must access <codeph>bytesAvailable</codeph> to ensure
     that sufficient data is available before trying to read
     it with one of the <codeph>read</codeph> methods.</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:Socket:connected:get"><apiName>connected</apiName><shortdesc>
     Indicates whether this Socket object is currently connected.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Boolean</apiValueClassifier></apiValueDef><apiDesc>
     Indicates whether this Socket object is currently connected. 
     A call to this property returns a value of <codeph>true</codeph> if the socket
     is currently connected, or <codeph>false</codeph> otherwise.
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:Socket:endian:get"><apiName>endian</apiName><shortdesc>
     Indicates the byte order for the data; possible values are
     constants from the flash.utils.Endian class,
     Endian.BIG_ENDIAN or Endian.LITTLE_ENDIAN.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier><apiDefaultValue>Endian.BIG_ENDIAN
     </apiDefaultValue></apiValueDef><apiDesc>
     Indicates the byte order for the data; possible values are
     constants from the flash.utils.Endian class,
     <codeph>Endian.BIG_ENDIAN</codeph> or <codeph>Endian.LITTLE_ENDIAN</codeph>.
     </apiDesc></apiValueDetail><related-links><link href="flash.utils.xml#Endian"><linktext>flash.utils.Endian</linktext></link></related-links></apiValue><apiValue id="flash.net:Socket:objectEncoding:get"><apiName>objectEncoding</apiName><shortdesc>
     Controls the version of AMF used when writing or reading an object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>Property documented; needs review
     </internal></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
     Controls the version of AMF used when writing or reading an object.
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#ObjectEncoding"><linktext>ObjectEncoding class</linktext></link><link href="flash.net.xml#Socket/readObject()"><linktext>readObject()</linktext></link><link href="flash.net.xml#Socket/writeObject()"><linktext>writeObject()</linktext></link></related-links></apiValue><apiValue id="flash.net:Socket:timeout:set"><apiName>timeout</apiName><shortdesc>
     Indicates the number of milliseconds to wait for a connection.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
     Indicates the number of milliseconds to wait for a connection.
     
     <p>If the connection doesn't succeed within the specified time, the connection fails.
     The default value is 20,000 (twenty seconds).</p>
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="flash.net:URLLoader"><apiName>URLLoader</apiName><shortdesc>
 The URLLoader class downloads data from a URL
 as text, binary data, or URL-encoded variables.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
 The URLLoader class downloads data from a URL
 as text, binary data, or URL-encoded variables. It is useful for downloading
 text files, XML, or other information to be used in a
 dynamic, data-driven application.
 
 <p>A URLLoader object downloads all of the data from a URL before
 making it available to code in the applications. It sends out
 notifications about the progress of the download, which you can monitor
 through the <codeph>bytesLoaded</codeph> and <codeph>bytesTotal</codeph> properties,
 as well as through dispatched events.</p>
 
 <p>When loading very large video files, such as FLV's, out-of-memory errors may occur.
 </p>
 
 
 
 <p>When you use this class <ph platform="actionscript">in Flash Player and</ph> in
 AIR application content in security sandboxes other than then application security sandbox,
 consider the following security model:</p>
 
 <ul>
 <li>A SWF file in the local-with-filesystem sandbox may not load data from,
 or provide data to, a resource that is in the network sandbox. </li>
 
 <li> By default, the calling SWF file and the URL you load must be in exactly the same domain.
 For example, a SWF file at www.adobe.com can load data only from sources that are also at www.adobe.com. 
 To load data from a different domain, place a URL policy file on the server hosting the data.</li>
 </ul>
  
 <p>For more information related to security, see the following:</p>
 
 <ul>
 
 <li product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
 in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
 <li class="flashonly">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
 in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
 
   <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
 
 </ul>
 
 
 </apiDesc><example conref="examples\URLLoaderExample.as"> The following example loads and displays the 
 data found in a local text file. It also traces event handling information.
 
 <p><b>Note:</b> To run this example, put a file named urlLoaderExample.txt
 in the same directory as your SWF file. That file should only contain the following line of text:
 <codeph>answer=42&amp;question=unknown</codeph>
 </p>
 <p>The example code does the following:</p>
 <ol>
    <li>The constructor function creates a URLLoader instance named <codeph>loader</codeph> and a URLRequest
    instance named <codeph>request</codeph>, which contains the location and name of the file to be loaded.</li>
    <li>The <codeph>loader</codeph> object is passed to the <codeph>configureListeners()</codeph> method,
     which adds listeners for each of the supported URLLoader events.</li>
    <li>The <codeph>request</codeph> object is then passed to <codeph>loader.load()</codeph>, which loads the text file.</li>
      <li>When the URLLoader has finished loading the text file the <codeph>Event.COMPLETE event</codeph> fires, 
      triggering the <codeph>completeHandler()</codeph> method. The <codeph>completeHandler()</codeph> method creates a
      URLVariables object from the text loaded from the file. The URLVariables object converts URL-encoded
      name/value pairs into ActionScript properties to make it easier to manipulate the loaded data.</li>
 </ol>
<codeblock>

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.*;

    public class URLLoaderExample extends Sprite {
        public function URLLoaderExample() {
            var loader:URLLoader = new URLLoader();
            configureListeners(loader);

            var request:URLRequest = new URLRequest("urlLoaderExample.txt");
            try {
                loader.load(request);
            } catch (error:Error) {
                trace("Unable to load requested document.");
            }
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        }

        private function completeHandler(event:Event):void {
            var loader:URLLoader = URLLoader(event.target);
            trace("completeHandler: " + loader.data);
    
            var vars:URLVariables = new URLVariables(loader.data);
            trace("The answer is " + vars.answer);
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function httpStatusHandler(event:HTTPStatusEvent):void {
            trace("httpStatusHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#URLRequest"><linktext>URLRequest</linktext></link><link href="flash.net.xml#URLVariables"><linktext>URLVariables</linktext></link><link href="flash.net.xml#URLStream"><linktext>URLStream</linktext></link></related-links><adobeApiEvent id="flash.net:URLLoader_flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS_httpResponseStatus"><apiName>httpResponseStatus</apiName><shortdesc>
 Dispatched if a call to the load() method attempts to access data over HTTP, 
 and Adobe AIR is able to detect and return the status code for the request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS</apiEventType><adobeApiEventClassifier>flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to the <codeph>load()</codeph> method attempts to access data over HTTP, 
 and Adobe AIR is able to detect and return the status code for the request. 
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLLoader/load()"><linktext>load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.HTTPStatusEvent.HTTP_STATUS_httpStatus"><apiName>httpStatus</apiName><shortdesc>
 Dispatched if a call to URLLoader.load() 
 attempts to access data over HTTP.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.HTTPStatusEvent.HTTP_STATUS</apiEventType><adobeApiEventClassifier>flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to <codeph>URLLoader.load()</codeph> 
 attempts to access data over HTTP. <ph platform="actionscript">For content running in 
 Flash Player, this event is only dispatched if the current Flash Player environment 
 is able to detect and return the status code for the request. (Some browser environments
 may not be able to provide this information.)</ph> Note that the <codeph>httpStatus</codeph> event
 (if any) is sent before (and in addition to) any <codeph>complete</codeph>
 or <codeph>error</codeph> event.
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLLoader/load()"><linktext>URLLoader.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError"><apiName>securityError</apiName><shortdesc>
 Dispatched if a call to URLLoader.load() 
 attempts to load data from a server outside the security sandbox.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier>flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to <codeph>URLLoader.load()</codeph> 
 attempts to load data from a server outside the security sandbox. 
 Also dispatched if a call to <codeph>URLLoader.load()</codeph> attempts 
 to load a SWZ file and the certificate is invalid or the digest string
 does not match the component.
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLLoader/load()"><linktext>URLLoader.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.IOErrorEvent.IO_ERROR_ioError"><apiName>ioError</apiName><shortdesc>
 Dispatched if a call to URLLoader.load()
 results in a fatal error that terminates the download.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier>flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to <codeph>URLLoader.load()</codeph>
 results in a fatal error that terminates the download.
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLLoader/load()"><linktext>URLLoader.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.ProgressEvent.PROGRESS_progress"><apiName>progress</apiName><shortdesc>
 Dispatched when data is received as the download operation progresses.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.ProgressEvent.PROGRESS</apiEventType><adobeApiEventClassifier>flash.events.ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when data is received as the download operation progresses.
 
 <p>Note that with a URLLoader object, it is not possible to access the data until it has
 been received completely. 
 So, the progress event only serves as a notification of how far the download has progressed. 
 To access the data before it's entirely downloaded, use a URLStream object. </p>
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLLoader/load()"><linktext>URLLoader.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.Event.COMPLETE_complete"><apiName>complete</apiName><shortdesc>
 Dispatched after all the received data is decoded and 
 placed in the data property of the URLLoader object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.COMPLETE</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched after all the received data is decoded and 
 placed in the <codeph>data</codeph> property of the URLLoader object. 
 The received data may be accessed once this event has been dispatched.
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLLoader/load()"><linktext>URLLoader.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.Event.OPEN_open"><apiName>open</apiName><shortdesc>
 Dispatched when the download operation commences following
 a call to the URLLoader.load() method.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.OPEN</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when the download operation commences following
 a call to the <codeph>URLLoader.load()</codeph> method. 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLLoader/load()"><linktext>URLLoader.load()</linktext></link></related-links></adobeApiEvent><apiConstructor id="flash.net:URLLoader:URLLoader"><apiName>URLLoader</apiName><shortdesc>
	 Creates a URLLoader object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/><apiParam><apiItemName>request</apiItemName><apiOperationClassifier>flash.net:URLRequest</apiOperationClassifier><apiData>null</apiData><apiDesc>A URLRequest object specifying
	                the URL to download.  If this parameter is omitted,
	                no load operation begins.  If
	                specified, the load operation begins
	                immediately (see the <codeph>load</codeph> entry for more information).
	 
	 </apiDesc></apiParam></apiConstructorDef><apiDesc>
	 Creates a URLLoader object.
	 
	 </apiDesc></apiConstructorDetail><related-links><link href="flash.net.xml#URLLoader/load()"><linktext>URLLoader.load()</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:URLLoader:addEventListener"><apiName>addEventListener</apiName><shortdesc>
	
	Registers an event listener object with an EventDispatcher object so that the listener 
	receives notification of an event.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiIsOverride/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>type</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The type of event.
	
	</apiDesc></apiParam><apiParam><apiItemName>listener</apiItemName><apiOperationClassifier>Function</apiOperationClassifier><apiDesc>The listener function that processes the event. This function must accept
    an Event object as its only parameter and must return nothing<ph platform="actionscript">, as this example shows:</ph>
	<ph platform="javascript">.</ph>
	
    <codeblock platform="actionscript">function(evt:Event):void</codeblock>
	
	<p>The function can have any name.</p>
	
	</apiDesc></apiParam><apiParam><apiItemName>useCapture</apiItemName><apiOperationClassifier>Boolean</apiOperationClassifier><apiData>false</apiData><apiDesc><ph platform="javascript">This parameter applies to display objects in the
	ActionScript 3.0 display list architecture, used by SWF content.</ph>
	
	<ph platform="actionscript">Determines whether the listener works in the capture phase or the 
	target and bubbling phases. If <codeph>useCapture</codeph> is set to <codeph>true</codeph>, 
	the listener processes the event only during the capture phase and not in the 
	target or bubbling phase. If <codeph>useCapture</codeph> is <codeph>false</codeph>, the
	listener processes the event only during the target or bubbling phase. To listen for
	the event in all three phases, call <codeph>addEventListener</codeph> twice, once with 
	<codeph>useCapture</codeph> set to <codeph>true</codeph>, then again with
	<codeph>useCapture</codeph> set to <codeph>false</codeph>.</ph>
	
	</apiDesc></apiParam><apiParam><apiItemName>priority</apiItemName><apiOperationClassifier>int</apiOperationClassifier><apiData>0</apiData><apiDesc>The priority level of the event listener. The priority is designated by
	a signed 32-bit integer. The higher the number, the higher the priority. All listeners
	with priority <i>n</i> are processed before listeners of priority <i>n</i>-1. If two
	or more listeners share the same priority, they are processed in the order in which they
	were added. The default priority is 0.
	
	</apiDesc></apiParam><apiParam><apiItemName>useWeakReference</apiItemName><apiOperationClassifier>Boolean</apiOperationClassifier><apiData>false</apiData><apiDesc>Determines whether the reference to the listener is strong or
	weak. A strong reference (the default) prevents your listener from being garbage-collected.
    A weak reference does not. <p>Class-level member functions are not subject to garbage 
    collection, so you can set <codeph>useWeakReference</codeph> to <codeph>true</codeph> for 
    class-level member functions without subjecting them to garbage collection. If you set
    <codeph>useWeakReference</codeph> to <codeph>true</codeph> for a listener that is a nested inner 
    function, the function will be garbage-collected and no longer persistent. If you create 
    references to the inner function (save it in another variable) then it is not 
    garbage-collected and stays persistent.</p>
	
	</apiDesc></apiParam></apiOperationDef><apiDesc>
	
	Registers an event listener object with an EventDispatcher object so that the listener 
	receives notification of an event. <ph platform="actionscript">You can register event listeners on all nodes in the 
	display list for a specific type of event, phase, and priority.</ph>
	
	<p platform="javascript">JavaScript code in the AIR runtime uses this method to register
	event listeners for events defined by the AIR APIs. For other JavaScript events (such as the <codeph>onload</codeph>
	event of the DOM <codeph>body</codeph> object), you can use standard event handling techniques, as you would 
	for content running in the browser.</p>
	
	<p>After you successfully register an event listener, you cannot change its priority
	through additional calls to <codeph>addEventListener()</codeph>. To change a listener's
	priority, you must first call <codeph>removeListener()</codeph>. Then you can register the
	listener again with the new priority level. </p>
	
	<p>Keep in mind that after the listener is registered, subsequent calls to
	<codeph>addEventListener()</codeph> with a different <codeph>type</codeph> or
	<codeph>useCapture</codeph> value result in the creation of a separate listener registration. 
	<ph platform="actionscript">For example, if you first register a listener with <codeph>useCapture</codeph> set to 
	<codeph>true</codeph>, it listens only during the capture phase. If you call 
	<codeph>addEventListener()</codeph> again using the same listener object, but with
	<codeph>useCapture</codeph> set to <codeph>false</codeph>, you have two separate listeners: one
	that listens during the capture phase and another that listens during the target and
	bubbling phases.</ph>
	</p>
	
	<p platform="actionscript">You cannot register an event listener for only the target phase or the bubbling 
	phase. Those phases are coupled during registration because bubbling 
	applies only to the ancestors of the target node.</p>
	
	<p>If you no longer need an event listener, remove it by calling 
	<codeph>removeEventListener()</codeph>, or memory problems could result. Event listeners are not automatically
	removed from memory because the garbage
	collector does not remove the listener as long as the dispatching object exists (unless the <codeph>useWeakReference</codeph>
	parameter is set to <codeph>true</codeph>).</p>
		
	<p>Copying an EventDispatcher instance does not copy the event listeners attached to it. 
	(If your newly created node needs an event listener, you must attach the listener after
    creating the node.) However, if you move an EventDispatcher instance, the event listeners 
    attached to it move along with it.</p>
	
	
	<p platform="actionscript">If the event listener is being registered on a node while an event is being processed
	on this node, the event listener is not triggered during the current phase but can be 
	triggered during a later phase in the event flow, such as the bubbling phase.</p>
	
	<p platform="actionscript">If an event listener is removed from a node while an event is being processed on the node,
	it is still triggered by the current actions. After it is removed, the event listener is
	never invoked again (unless registered again for future processing). </p>
	
	</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLLoader:close"><apiName>close</apiName><shortdesc>
	 Closes the load operation in progress.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
	 Closes the load operation in progress.  Any load
	 operation in progress is immediately terminated.
	 If no URL is currently being streamed, an invalid stream error is thrown.
	 
	 </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLLoader:load"><apiName>load</apiName><shortdesc>
	 Sends and loads data from the specified URL.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><codeph>URLRequest.requestHeader</codeph> objects may not
	 contain certain prohibited HTTP request headers. For more information,
	 see the URLRequestHeader class description.
	 
	 </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiException><apiDesc>This error can occur for the following reasons:
	 1) <ph platform="actionscript">Flash Player or</ph> AIR cannot 
 	 convert the <codeph>URLRequest.data</codeph>
	 parameter from UTF8 to MBCS. This error is applicable if the URLRequest object
	 passed to <codeph>load()</codeph> is set to perform a <codeph>GET</codeph> operation and 
	 if <codeph>System.useCodePage</codeph> is set to <codeph>true</codeph>.
	 2) <ph platform="actionscript">Flash Player or</ph> AIR cannot 
 	 allocate memory for the <codeph>POST</codeph> data. This error is

	 applicable if the URLRequest object passed to <codeph>load</codeph> is set
	 to perform a <codeph>POST</codeph> operation.
	 
	 </apiDesc><apiItemName>MemoryError</apiItemName><apiOperationClassifier>flash.errors:MemoryError</apiOperationClassifier></apiException><apiException><apiDesc>Local untrusted files may not communicate with
	 the Internet. This may be worked around by reclassifying this file
	 as local-with-networking or trusted.
	 
      </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>If you are trying to connect to a commonly reserved port. 
      For a complete list of blocked ports, see "Restricting Networking APIs" in the 
      security chapter of the <i>Programming ActionScript 3.0</i> book.
     
	 </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>The value of the request parameter
	 or the <codeph>URLRequest.url</codeph> property of the URLRequest object passed are
	 <codeph>null</codeph>.
	 
	 </apiDesc><apiItemName>TypeError</apiItemName><apiOperationClassifier>TypeError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>request</apiItemName><apiOperationClassifier>flash.net:URLRequest</apiOperationClassifier><apiDesc>A URLRequest object specifying the URL to download.
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Sends and loads data from the specified URL. The data can be received as
	 text, raw binary data, or URL-encoded variables, depending on the
	 value you set for the <codeph>dataFormat</codeph> property. Note that
	 the default value of the <codeph>dataFormat</codeph> property is text.
	 If you want to send data to the specified URL, you can set the <codeph>data</codeph> 
	 property in the URLRequest object.
	 
	 <p><b>Note:</b> If a file being loaded contains non-ASCII characters (as found
	 in many non-English languages), it is recommended that you save the 
	 file with UTF-8 or UTF-16 encoding as opposed to a non-Unicode format 
	 like ASCII.</p>
	 
	 <p> A SWF file in the local-with-filesystem sandbox may not load data from,
 	 or provide data to, a resource that is in the network sandbox.</p> 
	  
	 <p> By default, the calling SWF file and the URL you load must be in exactly the same domain.
 	 For example, a SWF file at www.adobe.com can load data only from sources that are also at www.adobe.com. 
 	 To load data from a different domain, place a URL policy file on the server hosting the data.</p>
	 
      <p>You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     <ph product="flex">
     <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     </ph>
     <ph product="flash">
     <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     </ph>
      of the <i>Programming ActionScript 3.0</i> book.</p>
     
     <p> In Flash Player 10 and later, if you use a multipart Content-Type (for example "multipart/form-data") 
     that contains an upload (indicated by a "filename" parameter in a "content-disposition" header within the POST body),
	 the POST operation is subject to the security rules applied to uploads:</p>
	 <ul>
	 <li>The POST operation must be performed in response to a user-initiated action, such as a mouse click or key press.</li>
	 <li>If the POST operation is cross-domain (the POST target is not on the same server as the SWF file 
	 that is sending the POST request),
	 the target server must provide a URL policy file that permits cross-domain access.</li>
	 </ul>
     <p>Also, for any multipart Content-Type, the syntax must be valid (according to the RFC2046 standards).
     If the syntax appears to be invalid, the POST operation is subject to the security rules applied to uploads.</p>
     
	 <p>For more information related to security, see the following:</p>
	 
     <ul>
     
     
	 <li>The "Understanding AIR Security" section of the "Getting started with Adobe AIR" chapter
	 in the <i>Developing AIR Applications</i> book.</li>
	 
	 <li>The <xref href="http://www.adobe.com/go/fp9_0_security" scope="external">Flash Player 9 Security white paper</xref></li>
     
     <li class="flexonly">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     <li class="flashonly">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
       <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     
     </ul>
	 
	 </apiDesc><example conref="examples\URLLoader_loadExample.as"> In the following example, an XML files is loaded and the content
 of its elements' first arguments are displayed in a text field.
 
 <p>A <codeph>URLRequest</codeph> object is created to identify the location of the
 XML file, which for this example is in the same directory as the SWF file. 
 The file is loaded in a <codeph>try...catch</codeph> block in order to catch any
 error that may occur. (Here we catch the <codeph>SecurityError</codeph> errors.) 
 If an <codeph>IO_ERROR</codeph> event occurs, the <codeph>errorHandler()</codeph> method 
 is invoked, which writes an error message in the <codeph>xmlTextField</codeph> text field. 
 Once the XML file data is received and place in the data property of the <codeph>loader</codeph> 
 URLLoader object, the <codeph>Event.COMPLETE</codeph> event is dispatched and the 
 <codeph>loaderCompleteHandler()</codeph> method is invoked.</p>
 
 <p>In the <codeph>loaderCompleteHandler()</codeph> method, a <codeph>try...catch</codeph> 
 block is used to catch any parsing error that may occur while converting the loaded 
 data from the file into an XML object. The <codeph>readNodes()</codeph> method then 
 recursively goes through all the elements in the nodes of the XML document and 
 appends the <codeph>xmlTextField</codeph> text field with a list of the first attributes 
 of all the elements.</p>
<codeblock>
package {
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.xml.*;
    import flash.events.IOErrorEvent;
  
    public class URLLoader_loadExample extends Sprite {
        private var xmlTextField:TextField = new TextField();
        private var externalXML:XML;    
        private var loader:URLLoader;

        public function URLLoader_loadExample() {
            var request:URLRequest = new URLRequest("xmlFile.xml");

            loader = new URLLoader();
            
            try {
                loader.load(request);
            }
            catch (error:SecurityError)
            {
                trace("A SecurityError has occurred.");
            }

             loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
            loader.addEventListener(Event.COMPLETE, loaderCompleteHandler);

            xmlTextField.x = 10;
            xmlTextField.y = 10;
            xmlTextField.background = true;
            xmlTextField.autoSize = TextFieldAutoSize.LEFT;

            addChild(xmlTextField);
        }

        private function loaderCompleteHandler(event:Event):void {

                try {
                    externalXML = new XML(loader.data);
                    readNodes(externalXML);    
                } catch (e:TypeError) {
                    trace("Could not parse the XML file.");
                }
        }

        private function readNodes(node:XML):void {

                for each (var element:XML in node.elements()) {
                    xmlTextField.appendText(element.attributes()[0] + "\n");

                    readNodes(element);
                }    
        }

        private function errorHandler(e:IOErrorEvent):void {
            xmlTextField.text = "Had problem loading the XML File.";
        }
    }
}
</codeblock></example></apiOperationDetail><related-links><link href="flash.net.xml#URLRequestHeader"><linktext>URLRequestHeader</linktext></link><link href="flash.net.xml#URLRequest/requestHeaders"><linktext>URLRequest.requestHeaders</linktext></link><link href="flash.net.xml#URLRequest/data"><linktext>URLRequest.data</linktext></link><link href="flash.net.xml#URLRequest/digest"><linktext>URLRequest.digest</linktext></link></related-links><adobeApiEvent id="flash.net:URLLoader:load_complete"><apiName>complete</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched after data has loaded successfully.
	 
	 </apiDesc></adobeApiEventDetail><shortdesc>Dispatched after data has loaded successfully.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_httpStatus"><apiName>httpStatus</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>If access is over HTTP, and the current
	 Flash Player environment supports obtaining status codes, you may
	 receive these events in addition to any <codeph>complete</codeph>
	 or <codeph>error</codeph> event.
	 
	 </apiDesc></adobeApiEventDetail><shortdesc>If access is over HTTP, and the current
	 Flash Player environment supports obtaining status codes, you may
	 receive these events in addition to any complete
	 or error event.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_ioError"><apiName>ioError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>The load operation could not be
	 completed.
	 
	 </apiDesc></adobeApiEventDetail><shortdesc>The load operation could not be
	 completed.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_progress"><apiName>progress</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when data is received as the download
	 operation progresses.
	 
	 </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when data is received as the download
	 operation progresses.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>A load operation attempted
	 to retrieve data from a server outside the caller's security sandbox.
	 This may be worked around using a policy file on the server.
	 </apiDesc></adobeApiEventDetail><shortdesc>A load operation attempted
	 to retrieve data from a server outside the caller's security sandbox.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>A load operation attempted
	 to load a SWZ file (a Adobe platform component), but the certificate is invalid
	 or the digest does not match the component.
	 </apiDesc></adobeApiEventDetail><shortdesc>A load operation attempted
	 to load a SWZ file (a Adobe platform component), but the certificate is invalid
	 or the digest does not match the component.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_open"><apiName>open</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when a load operation commences.
	 
	 </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when a load operation commences.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_httpResponseStatus"><apiName>httpResponseStatus</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched if a call to the <codeph>load()</codeph> 
	 method attempts to access data over HTTP and Adobe AIR is able to detect and return the 
	 status code for the request.
	 
	 </apiDesc></adobeApiEventDetail><shortdesc>Dispatched if a call to the load() 
	 method attempts to access data over HTTP and Adobe AIR is able to detect and return the 
	 status code for the request.</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.net:URLLoader:bytesLoaded"><apiName>bytesLoaded</apiName><shortdesc>
	 Indicates the number of bytes that have been loaded thus far
	 during the load operation.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiData>0</apiData><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
	 Indicates the number of bytes that have been loaded thus far
	 during the load operation.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLLoader:bytesTotal"><apiName>bytesTotal</apiName><shortdesc>
	 Indicates the total number of bytes in the downloaded data.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiData>0</apiData><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
	 Indicates the total number of bytes in the downloaded data.
	 This property contains 0 while the load operation is in progress
	 and is populated when the operation is complete. 
	 Also, a missing Content-Length header will result in bytesTotal being indeterminate.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLLoader:data"><apiName>data</apiName><shortdesc>
	 The data received from the load operation.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiType value=""/></apiValueDef><apiDesc>
	 The data received from the load operation. This property
	 is populated only when the load operation is complete.
	 The format of the data depends on the setting of the
	 <codeph>dataFormat</codeph> property:
	 
	 <p>If the <codeph>dataFormat</codeph> property is <codeph>URLLoaderDataFormat.TEXT</codeph>,
	 the received data is a string containing the text of the loaded file.</p>
	 
	 <p>If the <codeph>dataFormat</codeph> property is <codeph>URLLoaderDataFormat.BINARY</codeph>,
	 the received data is a ByteArray object containing the raw binary data.</p>
	 
	 <p>If the <codeph>dataFormat</codeph> property is <codeph>URLLoaderDataFormat.VARIABLES</codeph>,
	 the received data is a URLVariables object containing the URL-encoded variables.</p>
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLLoaderDataFormat"><linktext>URLLoaderDataFormat</linktext></link><link href="flash.net.xml#URLLoader/dataFormat"><linktext>URLLoader.dataFormat</linktext></link></related-links></apiValue><apiValue id="flash.net:URLLoader:dataFormat"><apiName>dataFormat</apiName><shortdesc>
	 Controls whether the downloaded data is received as
	 text (URLLoaderDataFormat.TEXT), raw binary data
	 (URLLoaderDataFormat.BINARY), or URL-encoded variables
	 (URLLoaderDataFormat.VARIABLES).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiData>text</apiData><apiValueClassifier>String</apiValueClassifier><apiDefaultValue>URLLoaderDataFormat.TEXT
	 
	 </apiDefaultValue></apiValueDef><apiDesc>
	 Controls whether the downloaded data is received as
	 text (<codeph>URLLoaderDataFormat.TEXT</codeph>), raw binary data
	 (<codeph>URLLoaderDataFormat.BINARY</codeph>), or URL-encoded variables
	 (<codeph>URLLoaderDataFormat.VARIABLES</codeph>).
	 
	 <p>If the value of the <codeph>dataFormat</codeph> property is <codeph>URLLoaderDataFormat.TEXT</codeph>,
	 the received data is a string containing the text of the loaded file.</p>
	 
	 <p>If the value of the <codeph>dataFormat</codeph> property is <codeph>URLLoaderDataFormat.BINARY</codeph>,
	 the received data is a ByteArray object containing the raw binary data.</p>
	 
	 <p>If the value of the <codeph>dataFormat</codeph> property is <codeph>URLLoaderDataFormat.VARIABLES</codeph>,
	 the received data is a URLVariables object containing the URL-encoded variables.</p>
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLLoaderDataFormat"><linktext>URLLoaderDataFormat</linktext></link></related-links></apiValue></apiClassifier><apiClassifier id="flash.net:NetStreamPlayOptions"><apiName>NetStreamPlayOptions</apiName><shortdesc>
 
 The NetStreamPlayOptions class specifies the various options that can be passed 
 to the NetStream.play2() method.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiDynamic/><apiTipTexts><apiTipText>The NetStreamPlayOptions class specifies the various options that can be passed 
 to the NetStream.play2() method. 
 
 </apiTipText></apiTipTexts><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
 
 The NetStreamPlayOptions class specifies the various options that can be passed 
 to the <codeph>NetStream.play2()</codeph> method. You pass a NetStreamPlayOptions object
 to <codeph>play2()</codeph>, and the properties of the class specify the various options.
 The primary use case for this class is to implement transitions between streams dynamically,
 either to switch to streams of different bit rates and sizes or to swap to different content
 in a playlist.
 
 </apiDesc></apiClassifierDetail><apiConstructor id="flash.net:NetStreamPlayOptions:NetStreamPlayOptions"><apiName>NetStreamPlayOptions</apiName><shortdesc>
     
     Creates a NetStreamPlayOptions object to specify the options that are passed to the NetStream.play2() method.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/></apiConstructorDef><apiDesc>
     
     Creates a NetStreamPlayOptions object to specify the options that are passed to the <codeph>NetStream.play2()</codeph> method. 
     
     </apiDesc></apiConstructorDetail><related-links><link href="flash.net.xml#NetStream/play2()"><linktext>NetStream.play2()</linktext></link></related-links></apiConstructor><apiValue id="flash.net:NetStreamPlayOptions:len"><apiName>len</apiName><shortdesc>
    The duration of playback, in seconds, for the stream specified in streamName.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueClassifier>Number</apiValueClassifier><apiTipTexts><apiTipText>The duration of playback, in seconds, for the stream specified in streamName.
     </apiTipText></apiTipTexts></apiValueDef><apiDesc>
    The duration of playback, in seconds, for the stream specified in <codeph>streamName</codeph>. 
    The default value is -1, which means that Flash Player plays a live stream until it is no longer available or plays a recorded stream until it ends.
    If you pass 0 for <codeph>len</codeph>, Flash Player plays the single frame that is <codeph>start</codeph> seconds from the beginning of a recorded stream
    (assuming that <codeph>start</codeph> is equal to or greater than 0).
    <p>If you pass a positive number for <codeph>len</codeph>, Flash Player plays a live stream for <codeph>len</codeph> seconds after it becomes available, 
    or plays a recorded stream for <codeph>len</codeph> seconds. (If a stream ends before <codeph>len</codeph> seconds, playback ends when the stream ends.)</p> 
    <p>If you pass a negative number other than -1 for <codeph>len</codeph>, Flash Player interprets the value as if it were -1.</p>
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStream/play()"><linktext>NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()"><linktext>NetStream.play2()</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/start"><linktext>start</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayOptions:oldStreamName"><apiName>oldStreamName</apiName><shortdesc>
    The name of the old stream or the stream to transition from.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
    The name of the old stream or the stream to transition from.   
    When <codeph>NetStream.play2()</codeph> is used to simply play a stream (not perform a transition), the value of this property
    should be either null or undefined. Otherwise, specify the stream to transition from.   
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStreamPlayOptions/streamName"><linktext>streamName</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()"><linktext>NetStream.play2()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayOptions:start"><apiName>start</apiName><shortdesc>
    The start time, in seconds, for streamName.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueClassifier>Number</apiValueClassifier><apiTipTexts><apiTipText>The start time, in seconds, for streamName.
     </apiTipText></apiTipTexts></apiValueDef><apiDesc>
    The start time, in seconds, for <codeph>streamName</codeph>. Valid values are -2, -1, and 0.
    
    <p>The default value for <codeph>start</codeph> is -2, which means that Flash Player first tries to play the live stream specified in <codeph>streamName</codeph>. 
    If a live stream of that name is not found, Flash Player plays the recorded stream specified in <codeph>streamName</codeph>. 
    If neither a live nor a recorded stream is found, Flash Player opens a live stream named <codeph>streamName</codeph>, even though no one is 
    publishing on it. When someone does begin publishing on that stream, Flash Player begins playing it.</p>
    
    <p>If you pass -1 for <codeph>start</codeph>, Flash Player plays only the live stream specified in <codeph>streamName</codeph>. If no live stream is found,
    Flash Player waits for it indefinitely if <codeph>len</codeph> is set to -1; if <codeph>len</codeph> is set to a different value, 
    Flash Player waits for <codeph>len</codeph> seconds before it begins playing the next item in the playlist.</p>
    
    <p> If you pass 0 or a positive number for <codeph>start</codeph>, Flash Player plays only a recorded stream named <codeph>streamName</codeph>, 
    beginning <codeph>start</codeph> seconds from the beginning of the stream. If no recorded stream is found, Flash Player begins playing the next item
    in the playlist immediately.</p>
    
    <p>If you pass a negative number other than -1 or -2 for <codeph>start</codeph>, Flash Player interprets the value as if it were -2.</p>
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStream/play()"><linktext>NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()"><linktext>NetStream.play2()</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/len"><linktext>len</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayOptions:streamName"><apiName>streamName</apiName><shortdesc>
    The name of the new stream to transition to or to play.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
    The name of the new stream to transition to or to play. When <codeph>oldStreamName</codeph> is null or undefined, calling
    <codeph>NetStream.play2()</codeph> simply starts playback of <codeph>streamName</codeph>. If <codeph>oldStreamName</codeph> is specified, calling <codeph>NetStream.play2()</codeph>
    transitions <codeph>oldStreamName</codeph> to <codeph>streamName</codeph> using the transition mode specified in the <codeph>transition</codeph> property. 
    
    </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStreamPlayOptions/oldStreamName"><linktext>oldStreamName</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()"><linktext>NetStream.play2()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayOptions:transition"><apiName>transition</apiName><shortdesc>
    The mode in which streamName is played or transitioned to.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueClassifier>String</apiValueClassifier><apiTipTexts><apiTipText>The mode in which streamName is played or transitioned to.
     </apiTipText></apiTipTexts></apiValueDef><apiDesc>
    The mode in which <codeph>streamName</codeph> is played or transitioned to. Possible values are constants from the NetStreamPlayTransitions class.
    Depending on whether <codeph>Netstream.play2()</codeph> is called to play or transition a stream, the transition mode results in different behaviors. 
    For more information on the transition modes, see the NetStreamPlayTransitions class.
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStreamPlayTransitions"><linktext>NetStreamPlayTransitions</linktext></link><link href="flash.net.xml#NetStream/play2()"><linktext>NetStream.play2()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier id="flash.net:IDynamicPropertyOutput"><apiName>IDynamicPropertyOutput</apiName><shortdesc>
	 This interface controls the serialization of dynamic properties of dynamic objects.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiInterface/><apiAccess value="public"/><apiStatic/><apiBaseClassifier></apiBaseClassifier></apiClassifierDef><apiDesc>
	 This interface controls the serialization of dynamic properties of dynamic objects. 
	 You use this interface with the IDynamicPropertyWriter interface
	 and the <codeph>ObjectEncoding.dynamicPropertyWriter</codeph> property.
	 
     </apiDesc></apiClassifierDetail><related-links><link href="flash.net.xml#IDynamicPropertyWriter"><linktext>IDynamicPropertyWriter</linktext></link><link href="flash.net.xml#ObjectEncoding/dynamicPropertyWriter"><linktext>ObjectEncoding.dynamicPropertyWriter</linktext></link></related-links><apiOperation id="flash.net:IDynamicPropertyOutput:flash.net:IDynamicPropertyOutput:writeDynamicProperty"><apiName>writeDynamicProperty</apiName><shortdesc>
		 Adds a dynamic property to the binary output of a serialized object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>name</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The name of the property. You can use this parameter either to specify 
                the name of an existing property of the dynamic object or to create a 
                new property.  
		 
		 </apiDesc></apiParam><apiParam><apiItemName>value</apiItemName><apiType value=""/><apiDesc>The value to write to the specified property.
		 
         </apiDesc></apiParam></apiOperationDef><apiDesc>
		 Adds a dynamic property to the binary output of a serialized object.
         When the object is subsequently read (using a method such as
         <codeph>readObject</codeph>), it contains the new property.
         You can use this method
		 to exclude properties of dynamic objects from serialization; to write values
		 to properties of dynamic objects; or to create new properties
		 for dynamic objects.
		 
         </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#IDynamicPropertyWriter"><linktext>IDynamicPropertyWriter</linktext></link><link href="flash.net.xml#ObjectEncoding/dynamicPropertyWriter"><linktext>ObjectEncoding.dynamicPropertyWriter</linktext></link></related-links></apiOperation></apiClassifier><apiClassifier id="flash.net:URLVariables"><apiName>URLVariables</apiName><shortdesc>
 
 The URLVariables class allows you to transfer
 variables between an application and a
 server.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>URLVariables, constructor
</keyword></asCustoms></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiDynamic/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 
 The URLVariables class allows you to transfer
 variables between an application and a
 server. 
 Use URLVariables objects with methods of the URLLoader
 class, with the <codeph>data</codeph> property
 of the URLRequest class, and with flash.net package 
 functions.
 
 </apiDesc><example conref="examples\URLVariablesExample.as"> The following example opens the remote application hosted at 
 http://www.[yourDomain].com/application.jsp in a new browser window and passes 
 data about a user session, captured in a URLVariables object, to the application. 
  
 <p>Highlights of the example follow:</p>
 <ol>
    <li>The constructor function creates a URLRequest
    instance named <codeph>request</codeph>, taking the URL of the remote application as a parameter.</li>
    <li>A URLVariables object is created and two of its properties are assigned values.</li>
    <li>The URLVariables object is assigned to the <codeph>data</codeph> property of the URLRequest object.</li>
    <li>The example calls <codeph>navigateToURL</codeph>, which opens a new browser window
    to the remote application's URL.</li>
 </ol>
 <p> <b>Note:</b> To run the example, the remote application URL in the example must be replaced
 with a working URL. Additionally, you would need server code 
 to process the information captured by Flash Player in the URLVariables object.</p>
<codeblock>
package {
    import flash.display.Sprite;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.net.URLVariables;

    public class URLVariablesExample extends Sprite {

        public function URLVariablesExample() {
            var url:String = "http://www.[yourDomain].com/application.jsp";
            var request:URLRequest = new URLRequest(url);
            var variables:URLVariables = new URLVariables();
            variables.exampleSessionId = new Date().getTime();
            variables.exampleUserLabel = "guest";
            request.data = variables;
            navigateToURL(request);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#URLLoader"><linktext>URLLoader</linktext></link></related-links><apiConstructor id="flash.net:URLVariables:URLVariables"><apiName>URLVariables</apiName><shortdesc>
	 Creates a new URLVariables object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/><apiParam><apiItemName>source</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>A URL-encoded string containing name/value pairs.
	 </apiDesc></apiParam></apiConstructorDef><apiDesc>
	 Creates a new URLVariables object. You pass URLVariables
	 objects to the <codeph>data</codeph> property of URLRequest objects.
	 
	 <p>If you call the URLVariables constructor with a string, 
	 the <codeph>decode()</codeph> method is automatically called
	 to convert the string to properties of the URLVariables object.</p>
	 
	 </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.net:URLVariables:decode"><apiName>decode</apiName><shortdesc>
	 Converts the variable string to properties of the specified URLVariables object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>URLVariables, URLVariables.decode, decode
	 </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The source parameter must be a URL-encoded query
	 string containing name/value pairs.
	 
	 </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>source</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>A URL-encoded query string containing name/value pairs.	 
	 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Converts the variable string to properties of the specified URLVariables object.
	 <p>This method is used internally by the URLVariables events. 
	 Most users do not need to call this method directly.</p>
	 
	 </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLVariables:toString"><apiName>toString</apiName><shortdesc>
	 Returns a string containing all enumerable variables, 
	 in the MIME content encoding application/x-www-form-urlencoded.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>URLVariables, URLVariables.toString, toString
	 </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiDesc>A URL-encoded string containing name/value pairs.
	 
	 </apiDesc><apiOperationClassifier>String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
	 Returns a string containing all enumerable variables, 
	 in the MIME content encoding <i>application/x-www-form-urlencoded</i>.
	 
	 </apiDesc></apiOperationDetail></apiOperation></apiClassifier><apiClassifier id="flash.net:IDynamicPropertyWriter"><apiName>IDynamicPropertyWriter</apiName><shortdesc>
     This interface is used with the IDynamicPropertyOutput interface to control
     the serialization of dynamic properties of dynamic objects.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiInterface/><apiAccess value="public"/><apiStatic/><apiBaseClassifier></apiBaseClassifier></apiClassifierDef><apiDesc>
     This interface is used with the IDynamicPropertyOutput interface to control
     the serialization of dynamic properties of dynamic objects. To use this interface,
     assign an object that implements the IDynamicPropertyWriter interface to 
     the <codeph>ObjectEncoding.dynamicPropertyWriter</codeph> property.
      
     </apiDesc></apiClassifierDetail><related-links><link href="flash.net.xml#IDynamicPropertyOutput"><linktext>IDynamicPropertyOutput</linktext></link><link href="flash.net.xml#ObjectEncoding/dynamicPropertyWriter"><linktext>ObjectEncoding.dynamicPropertyWriter</linktext></link></related-links><apiOperation id="flash.net:IDynamicPropertyWriter:flash.net:IDynamicPropertyWriter:writeDynamicProperties"><apiName>writeDynamicProperties</apiName><shortdesc>
         Writes the name and value of an IDynamicPropertyOutput object to an object with 
         dynamic properties.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>obj</apiItemName><apiOperationClassifier>Object</apiOperationClassifier><apiDesc>The object to write to.
		 </apiDesc></apiParam><apiParam><apiItemName>output</apiItemName><apiOperationClassifier>flash.net:IDynamicPropertyOutput</apiOperationClassifier><apiDesc>The IDynamicPropertyOutput object that contains the name and value 
		 to dynamically write to the object.
		 
		 </apiDesc></apiParam></apiOperationDef><apiDesc>
         Writes the name and value of an IDynamicPropertyOutput object to an object with 
         dynamic properties. If <codeph>ObjectEncoding.dynamicPropertyWriter</codeph> is set,
         this method is invoked for each object with dynamic properties. 
		 
		 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#IDynamicPropertyOutput"><linktext>IDynamicPropertyOutput</linktext></link><link href="flash.net.xml#ObjectEncoding/dynamicPropertyWriter"><linktext>ObjectEncoding.dynamicPropertyWriter</linktext></link></related-links></apiOperation></apiClassifier><apiClassifier id="flash.net:URLRequestDefaults"><apiName>URLRequestDefaults</apiName><shortdesc>
 The URLRequestDefaults class includes static properties that you can set to define 
 default values for the properties of the URLRequest class.</shortdesc><prolog><asMetadata><apiVersion><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 The URLRequestDefaults class includes static properties that you can set to define 
 default values for the properties of the URLRequest class. It also includes a static
 method, <codeph>URLRequestDefaults.setLoginCredentialsForHost()</codeph>, which lets you define 
 default authentication credentials for requests. The URLRequest class defines
 the information to use in an HTTP request. 
 
 <p>Any properties set in a URLRequest object override those static properties set for
 the URLRequestDefaults class.</p>
 
 <p>URLRequestDefault settings only apply to content in the caller's application domain,
 with one exception: settings made by calling <codeph>URLRequestDefaults.setLoginCredentialsForHost()</codeph>
 apply to all application domains in the currently running application.</p>
 
 <p>Only Adobe<sup>®</sup> AIR<sup>®</sup> content running in the application security sandbox can 
 use the URLRequestDefaults class. Other content will result in a SecurityError being thrown when accessing the 
 members or properties of this class.</p>
 
 </apiDesc></apiClassifierDetail><related-links><link href="flash.net.xml#URLRequest"><linktext>URLRequest</linktext></link></related-links><apiOperation id="flash.net:URLRequestDefaults:setLoginCredentialsForHost"><apiName>setLoginCredentialsForHost</apiName><shortdesc>
	Sets default user and password credentials for a selected host.</shortdesc><prolog><asMetadata><apiVersion><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiStatic/><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiReturn><apiType value="any"/></apiReturn><apiParam><apiItemName>hostname</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The host name to which the user name and password are applied. This
	can be a domain, such as <codeph>"www.example.com"</codeph> or a domain and a port number,
	such as <codeph>"www.example.com:80"</codeph>. Note that <codeph>"example.com"</codeph>,
	<codeph>"www.example.com"</codeph>, and <codeph>"sales.example.com"</codeph> are each considered
	unique hosts. 
	
	</apiDesc></apiParam><apiParam><apiItemName>user</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The default user name to use in request authentication for the specified host.
	
	</apiDesc></apiParam><apiParam><apiItemName>password</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The default password to use in request authentication for the specified host.
	
	</apiDesc></apiParam></apiOperationDef><apiDesc>
	Sets default user and password credentials for a selected host. These settings 
	apply for URLRequest objects in all application domains of the application,
	not only those in the application domain of the object calling this method
	(whereas the static properties of the URLRequest class apply to the caller's 
	application domain only). This allows content in the entire application 
	(regardless of the content's application domain) to be logged in when another 
	part of the application logs in.
	
	<p><i>Note for applications running on Mac OS:</i> On Mac OS, when you call 
	this method, the application uses these credentials for the specified host 
	until the application is closed, even if you subsequently call
	<codeph>URLRequestDefaults.setLoginCredentialsForHost()</codeph> for the same host. 
	However, if a server rejects the credentials specified by this method, 
	then a subsequent call to the <codeph>URLRequestDefaults.setLoginCredentialsForHost()</codeph> 
	method (for the same host) will be recognized.</p>
	
	<p><i>Note:</i> This method does not apply to URLRequest objects used in file upload or 
	RTMP requests.</p>
	
	</apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:URLRequestDefaults:authenticate:get"><apiName>authenticate</apiName><shortdesc>
	The default setting for the authenticate property of URLRequest objects.</shortdesc><prolog><asMetadata><apiVersion><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiStatic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc>
	The default setting for the <codeph>authenticate</codeph> property of URLRequest objects.
	Setting the <codeph>authenticate</codeph> property in a URLRequest object overrides this default setting.
	
	<p><i>Note:</i> This setting does not apply to URLRequest objects used in file upload or 
	RTMP requests.</p>
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequest/authenticate"><linktext>URLRequest.authenticate</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:cacheResponse:get"><apiName>cacheResponse</apiName><shortdesc>
	The default setting for the cacheResponse property of URLRequest objects.</shortdesc><prolog><asMetadata><apiVersion><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiStatic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc>
	The default setting for the <codeph>cacheResponse</codeph> property of URLRequest objects.
	Setting the <codeph>cacheResponse</codeph> property in a URLRequest object overrides this default setting.
	When set to <codeph>true</codeph>, the default behavior for the AIR application is to use the operating system's 
	HTTP cache. This setting does not apply to URLRequest objects used in file upload or RTMP requests.
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequest/cacheResponse"><linktext>URLRequest.cacheResponse</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:followRedirects:get"><apiName>followRedirects</apiName><shortdesc>
	The default setting for the followRedirects property of URLRequest objects.</shortdesc><prolog><asMetadata><apiVersion><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiStatic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc>
	The default setting for the <codeph>followRedirects</codeph> property of URLRequest objects.
	Setting the <codeph>followRedirects</codeph> property in a URLRequest object overrides this default setting.
	This setting does not apply to URLRequest objects used in file upload or RTMP requests.
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequest/followRedirects"><linktext>URLRequest.followRedirects</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:manageCookies:get"><apiName>manageCookies</apiName><shortdesc>
	The default setting for the manageCookies property of URLRequest objects.</shortdesc><prolog><asMetadata><apiVersion><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiStatic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc>
	The default setting for the <codeph>manageCookies</codeph> property of URLRequest objects.
	Setting the <codeph>manageCookies</codeph> property in a URLRequest object overrides this default setting.
	
	<p><i>Note:</i> This setting does not apply to URLRequest objects used in file upload or 
	RTMP requests.</p>
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequest/manageCookies"><linktext>URLRequest.manageCookies</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:useCache:get"><apiName>useCache</apiName><shortdesc>
	The default setting for the useCache property of URLRequest objects.</shortdesc><prolog><asMetadata><apiVersion><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiStatic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc>
	The default setting for the <codeph>useCache</codeph> property of URLRequest objects.
	Setting the <codeph>useCache</codeph> property in a URLRequest object overrides this default setting.
	This setting does not apply to URLRequest objects used in file upload or RTMP requests.
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequest/useCache"><linktext>URLRequest.useCache</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:userAgent:get"><apiName>userAgent</apiName><shortdesc>
	The default setting for the userAgent property of URLRequest objects.</shortdesc><prolog><asMetadata><apiVersion><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiStatic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
	The default setting for the <codeph>userAgent</codeph> property of URLRequest objects.
	Setting the <codeph>userAgent</codeph> property in a URLRequest object overrides this 
	default setting.
	
	<p>This is also the default user agent string for all HTMLLoader objects (used 
	when you call the <codeph>load()</codeph> method of the HTMLLoader object). Setting 
	the <codeph>userAgent</codeph> property of the HTMLLoader object overrides the 
	<codeph>URLRequestDefaults.userAgent</codeph> setting.</p>
	
	<p>This default value varies depending on the runtime operating system (such as Mac OS, Linux or Windows), 
	the runtime language, and the runtime version, as in the following examples:</p>
	
	<ul>
	
		<li><codeph>"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"</codeph></li>
		<li><codeph>"Mozilla/5.0 (Windows; U; en) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"</codeph></li>
     <li><codeph>"Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"</codeph></li>
	
	</ul>
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequest/userAgent"><linktext>flash.net.URLRequest.userAgent</linktext></link><link href="../../flash/html/HTMLLoader.html#userAgent"><linktext>flash.html.HTMLLoader.userAgent</linktext></link></related-links></apiValue></apiClassifier><apiOperation id="globalOperation:flash.net:getClassByAlias"><apiName>getClassByAlias</apiName><shortdesc>
     Looks up a class that previously had an alias registered through a call to the registerClassAlias()
     method.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>includeExample examples\GetClassByAliasExample.as -noswf
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The alias was not registered.
     
     </apiDesc><apiItemName>ReferenceError</apiItemName><apiOperationClassifier>ReferenceError</apiOperationClassifier></apiException><apiReturn><apiDesc>The class associated with the given alias. If not found, an exception will be thrown.
     
     </apiDesc><apiOperationClassifier>Class</apiOperationClassifier></apiReturn><apiParam><apiItemName>aliasName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The alias to find.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Looks up a class that previously had an alias registered through a call to the <codeph>registerClassAlias()</codeph>
     method.
     <p>This method does not interact with the <codeph>flash.utils.getDefinitionByName()</codeph> 
     method.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#/registerClassAlias()"><linktext>registerClassAlias()</linktext></link></related-links></apiOperation><apiOperation id="globalOperation:flash.net:navigateToURL"><apiName>navigateToURL</apiName><shortdesc>
     Opens or replaces a window in the application that contains the Flash Player container
     (usually a browser).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>throws IOError The "digest" and "importToSandbox" properties of URLRequest
     are not supported by URLLoader.navigate.
     
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The <codeph>digest</codeph> property of the <codeph>request</codeph> object is not 
     <codeph>null</codeph>. You should only set the <codeph>digest</codeph> property of a URLRequest object
     for use calling the <codeph>URLLoader.load()</codeph> method when loading a SWZ file (an Adobe 
     platform component).
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiException><apiDesc>In Flash Player (and in non-application sandbox content in Adobe AIR), 
     this error is thrown in the following situations:
     <ul>
       <li>Local untrusted SWF files may not communicate with
     the Internet. You can avoid this situation by reclassifying this SWF file
     as local-with-networking or trusted.</li>
     
       <li>A navigate operation attempted to evaluate a scripting
     pseudo-URL, but the containing document (usually an HTML document in a
     browser) is from a sandbox to which you do not have access.  You can avoid this situation 
     by specifying <codeph>allowScriptAccess="always"</codeph> in the containing
     document.</li>
     
       <li>You cannot navigate the special windows 
     <codeph>"_self"</codeph>, <codeph>"_top"</codeph>, or <codeph>"_parent"</codeph>
     if your SWF file is contained by an HTML page
     that has set the <codeph>allowScriptAccess</codeph> to 
     <codeph>"none"</codeph>, or to <codeph>"sameDomain"</codeph> 
     when the domains of the HTML file and the SWF file do not match.</li>
     
       <li>You cannot navigate a window with a nondefault name
     from within a SWF file that is in the local-with-filesystem sandbox.</li>
     
      <li>You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     security chapter of the <i>Programming ActionScript 3.0</i> book. </li>
     
     </ul>
     
     </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>If the method is not called in response to a user action, such as a mouse
     event or keypress event. This requirement only applies to content in Flash Player and 
     to non-application sandbox content in Adobe AIR.
     
     </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>request</apiItemName><apiOperationClassifier>flash.net:URLRequest</apiOperationClassifier><apiDesc>A URLRequest object that specifies the URL to navigate to.
     
     <p><ph platform="actionscript">For content running in Adobe AIR, when </ph><ph platform="javascript">When </ph>
     using the <codeph>navigateToURL()</codeph> function, the runtime treats a URLRequest that uses the POST
     method (one that has its <codeph>method</codeph> property set to <codeph>URLRequestMethod.POST</codeph>)
     as using the GET method.</p>
     
     </apiDesc></apiParam><apiParam><apiItemName>window</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>The browser window or HTML frame in which to display
                   the document indicated by the <codeph>request</codeph> parameter.
     You can enter the name of a specific window or use one of the following values:
     <ul>
     <li><codeph>"_self"</codeph> specifies the current frame in the current window.</li>
     <li><codeph>"_blank"</codeph> specifies a new window.</li>
     <li><codeph>"_parent"</codeph> specifies the parent of the current frame.</li>
     <li><codeph>"_top"</codeph> specifies the top-level frame in the current window.</li>
     </ul>
     <p>If you do not specify a value for this parameter, a new empty window is created.
     In the stand-alone player, you can either specify a new (<codeph>"_blank"</codeph>) window
     or a named window. The other values don't apply.</p>
     
     <p platform="actionscript"><b>Note:</b> When code in a SWF file that is running in the 
     local-with-filesystem sandbox calls the <codeph>navigateToURL()</codeph> 
     function and specifies a custom window name for the <codeph>window</codeph> 
     parameter, the window name is transfered into a random name. The name is in 
     the form <codeph>"_flashXXXXXXXX"</codeph>, where each X represents a random 
     hexadecimal digit. Within the same session (until you close the containing 
     browser window), if you call the function again and specify the same name for 
     the <codeph>window</codeph> parameter, the same random string is used.</p>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     <ph platform="actionscript">Opens or replaces a window in the application that contains the Flash Player container
     (usually a browser). In Adobe AIR, the function opens a URL in the default system web browser</ph>
     <ph platform="javascript">Opens a URL in the default system web browser.</ph>
     
	 	<p>  <b><i>Important Security Note  </i></b> </p>
     	<p>Developers often pass URL values to the <codeph>navigateToURL()</codeph> function that were obtained from external sources 
     such as FlashVars.  Attackers may try to manipulate these external sources to perform attacks such as cross-site scripting. 
     Therefore, developers should validate all URLs before passing them to this function. </p>
     	
     <p>Good data validation for URLs can mean different things depending on the usage of the URL within the overall application.  
     The most common data validation techniques include validating that the URL is of the appropriate scheme.  
     For instance, unintentionally allowing javascript: URLs may result in cross-site scripting.  
     Validating that the URL is a within your domain can ensure that the SWF file can't be used as an open-redirector 
     by people who conduct phishing attacks.  For additional security, you may also choose to validate the path of the URL 
     and to validate that the URL conforms to the RFC guidelines</p>
     
     <p platform="actionscript">For example, the following code shows a simple example of performing data validation by denying any URL 
     that does not begin with http:// or https:// and validating that the URL is within your domain name.  
     This example may not be appropriate for all web applications and you should consider whether additional checks 
     against the URL are necessary. </p>
	 
     	<codeblock platform="actionscript">
     // AS3 Regular expression pattern match for URLs that start with http:// and https:// plus your domain name.
     function checkProtocol (flashVarURL:String):Boolean {
        // Get the domain name for the SWF if it is not known at compile time.
        // If the domain is known at compile time, then the following two lines can be replaced with a hard coded string.
        var my_lc:LocalConnection = new LocalConnection();
        var domainName:String = my_lc.domain;
        // Build the RegEx to test the URL.
        // This RegEx assumes that there is at least one "/" after the
        // domain. http://www.mysite.com will not match.
        var pattern:RegExp = new RegExp("^http[s]?\:\\/\\/([^\\/]+)\\/");
        var result:Object = pattern.exec(flashVarURL);
        if (result == null || result[1] != domainName || flashVarURL.length &gt;= 4096) {
          return (false);
        }
        return (true);
     }  
     
     	</codeblock>
	 <p platform="actionscript">For <i>local</i> content running in a browser, calls to the 
     <codeph>navigateToURL()</codeph> method that specify a <codeph>"javascript:"</codeph> pseudo-protocol 
     (via a <codeph>URLRequest</codeph> object passed as the first parameter) are only permitted if the SWF 
     file and the containing web page (if there is one) are in the local-trusted security sandbox.
     Some browsers do not support using the javascript protocol with the <codeph>navigateToURL()</codeph>
     method. Instead, consider using the <codeph>call()</codeph> method of the <codeph>ExternalInterface</codeph>
     API to invoke JavaScript methods within the enclosing HTML page.</p>
     
      <p platform="actionscript">In Flash Player, and in non-application sandboxes in Adobe AIR, 
     you cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     security chapter of the <i>Programming ActionScript 3.0</i> book.</p>
     
     <p platform="actionscript">In Flash Player 10 and later running in a browser, using this method programmatically to
     open a pop-up window may not be successful.  Various browsers (and browser configurations) may block pop-up windows 
     at any time; it is not possible to guarantee any pop-up window will appear.  
     However, for the best chance of success, use this method to open a pop-up window only in code that executes 
     as a direct result of a user action (for example, in an event handler for a mouse click or key-press event.)</p>
     
     <p platform="actionscript"> In Flash Player 10 and later, if you use a multipart Content-Type (for example "multipart/form-data") 
     that contains an upload (indicated by a "filename" parameter in a "content-disposition" header within the POST body),
	 the POST operation is subject to the security rules applied to uploads:</p>
	 <ul platform="actionscript">
	 <li>The POST operation must be performed in response to a user-initiated action, such as a mouse click or key press.</li>
	 <li>If the POST operation is cross-domain (the POST target is not on the same server as the SWF file 
	 that is sending the POST request),
	 the target server must provide a URL policy file that permits cross-domain access.</li>
	 </ul>
     <p platform="actionscript">Also, for any multipart Content-Type, the syntax must be valid (according to the RFC2046 standards).
     If the syntax appears to be invalid, the POST operation is subject to the security rules applied to uploads.</p>
     
     <p platform="actionscript">For more information related to security, see the following:</p>
     
     <ul platform="actionscript">
     
     <li product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     <li product="flash">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
       <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     
     </ul>
     
     </apiDesc><example conref="examples\NavigateToURLExample.as"> The following example opens the URL http://www.adobe.com in a new browser window and passes data about a
 user session, captured in a URLVariables object, to the web server.
<codeblock>
package {
    import flash.display.Sprite;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.net.URLVariables;

    public class NavigateToURLExample extends Sprite {

        public function NavigateToURLExample() {
            var url:String = "http://www.adobe.com";
            var variables:URLVariables = new URLVariables();
            variables.exampleSessionId = new Date().getTime();
            variables.exampleUserLabel = "Your Name";
            var request:URLRequest = new URLRequest(url);
            request.data = variables;
            try {            
                navigateToURL(request);
            }
            catch (e:Error) {
                // handle error here
            }
        }
    }
}
</codeblock></example></apiOperationDetail><related-links><link href="flash.external.xml#ExternalInterface/call()"><linktext>flash.external.ExternalInterface.call()</linktext></link></related-links></apiOperation><apiOperation id="globalOperation:flash.net:registerClassAlias"><apiName>registerClassAlias</apiName><shortdesc>
     Preserves the class (type) of an object when the object is encoded in Action Message Format (AMF).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>If either parameter is <codeph>null</codeph>.
     
     </apiDesc><apiItemName>TypeError</apiItemName><apiOperationClassifier>TypeError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>aliasName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The alias to use.
     </apiDesc></apiParam><apiParam><apiItemName>classObject</apiItemName><apiOperationClassifier>Class</apiOperationClassifier><apiDesc>The class associated with the given alias.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Preserves the class (type) of an object when the object is encoded in Action Message Format (AMF).
     When you encode an object into AMF, this function saves the alias for its class, so that you can 
     recover the class when decoding the object.
     If the encoding context did not register an alias for an object's class, the object
     is encoded as an anonymous object. Similarly, if the decoding context does not have the same
     alias registered, an anonymous object is created for the decoded data.
     
     <p>LocalConnection, ByteArray, SharedObject, NetConnection and NetStream are all examples
     of classes that encode objects in AMF.</p>
     
     <p>The encoding and decoding contexts do not need to use the same class for an alias;
     they can intentionally change classes, provided that the destination class contains all of the members
     that the source class serializes.</p>
     
     </apiDesc><example conref="examples\RegisterClassAliasExample.as"> This example uses the <codeph>registerClassAlias()</codeph> function to register
 an alias (<codeph>com.example.eg</codeph>) for the class ExampleClass. Because
 an alias is registered for the class, the object is able to be deserialized as an instance
 of ExampleClass, and the code outputs <codeph>true</codeph>. If the <codeph>registerClassAlias()</codeph>
 call were removed, the code would output <codeph>false</codeph>. 
<codeblock>
package {
    import flash.display.Sprite;
    import flash.net.registerClassAlias;
    import flash.utils.ByteArray;

    public class RegisterClassAliasExample extends Sprite {
        public function RegisterClassAliasExample() {
            registerClassAlias("com.example.eg", ExampleClass);
            var eg1:ExampleClass = new ExampleClass();
            var ba:ByteArray = new ByteArray();
            ba.writeObject(eg1);
            ba.position = 0;
            var eg2:* = ba.readObject();
            trace(eg2 is ExampleClass); // true
        }
    }
}

class ExampleClass {}
</codeblock></example></apiOperationDetail><related-links><link href="flash.net.xml#ObjectEncoding"><linktext>ObjectEncoding class</linktext></link></related-links></apiOperation><apiOperation id="globalOperation:flash.net:sendToURL"><apiName>sendToURL</apiName><shortdesc>
     Sends a URL request to a server, but ignores any response.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>throws IOError The "digest" and "importToSandbox" properties of URLRequest
         are not supported by URLLoader.send.
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Local untrusted SWF files cannot communicate with
     the Internet. You can avoid this situation by reclassifying this SWF file
     as local-with-networking or trusted.
     
      </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     security chapter of the <i>Programming ActionScript 3.0</i> book. 
     
     </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>request</apiItemName><apiOperationClassifier>flash.net:URLRequest</apiOperationClassifier><apiDesc>A URLRequest object specifying the URL to send data to.
         </apiDesc></apiParam></apiOperationDef><apiDesc>
     Sends a URL request to a server, but ignores any response.
     <p>To examine the server response, use the <codeph>URLLoader.load()</codeph> method instead.</p>
     
      <p>You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     security chapter of the <i>Programming ActionScript 3.0</i> book.</p>
     
     <p>You can prevent a SWF file from using this method by setting the 
     <codeph>allowNetworking</codeph> parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> 
     tags in the HTML page that contains the SWF content.</p>
	 
     <p> In Flash Player 10 and later, if you use a multipart Content-Type (for example "multipart/form-data") 
     that contains an upload (indicated by a "filename" parameter in a "content-disposition" header within the POST body),
	 the POST operation is subject to the security rules applied to uploads:</p>
	 <ul>
	 <li>The POST operation must be performed in response to a user-initiated action, such as a mouse click or key press.</li>
	 <li>If the POST operation is cross-domain (the POST target is not on the same server as the SWF file 
	 that is sending the POST request),
	 the target server must provide a URL policy file that permits cross-domain access.</li>
	 </ul>
     <p>Also, for any multipart Content-Type, the syntax must be valid (according to the RFC2046 standards).
     If the syntax appears to be invalid, the POST operation is subject to the security rules applied to uploads.</p>
     
     <p>For more information related to security, see the following:</p>
     
     <ul>
     
     <li product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     <li product="flash">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
       <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     
     </ul>
         
         </apiDesc><example conref="examples\SendToURLExample.as"> The following example passes data about a
 user session, captured in a URLVariables object, to the application at http://www.yourDomain.com/application.jsp.
<codeblock>
 package {
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import flash.net.URLVariables;
    import flash.net.sendToURL;

    public class SendToURLExample extends Sprite {

        public function SendToURLExample() {
            var url:String = "http://www.yourDomain.com/application.jsp";
            var variables:URLVariables = new URLVariables();
            variables.sessionId = new Date().getTime();
            variables.userLabel = "Your Name";

            var request:URLRequest = new URLRequest(url);
            request.data = variables;
            trace("sendToURL: " + request.url + "?" + request.data);
            try {
                sendToURL(request);
            }
            catch (e:Error) {
                // handle error here
            }
        }
    }
}
</codeblock></example></apiOperationDetail></apiOperation><apiClassifier id="flash.net:Responder"><apiName>Responder</apiName><shortdesc>
 The Responder class provides an object that is used 
 in NetConnection.call() to handle return
 values from the server related to the success or failure of
 specific operations.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 The Responder class provides an object that is used 
 in <codeph>NetConnection.call()</codeph> to handle return
 values from the server related to the success or failure of
 specific operations. When working with <codeph>NetConnection.call()</codeph>,
 you may encounter a network operation fault specific to the current operation
 or a fault related to the current connection status. Operation errors target
 the Responder object instead of the NetConnection object for easier error handling.
 
 
 </apiDesc></apiClassifierDetail><related-links><link href="flash.net.xml#NetConnection/call()"><linktext>NetConnection.call()</linktext></link></related-links><apiConstructor id="flash.net:Responder:Responder"><apiName>Responder</apiName><shortdesc>
	 Creates a new Responder object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/><apiParam><apiItemName>result</apiItemName><apiOperationClassifier>Function</apiOperationClassifier><apiDesc>The function invoked if the call to the server succeeds and returns a result.
	 </apiDesc></apiParam><apiParam><apiItemName>status</apiItemName><apiOperationClassifier>Function</apiOperationClassifier><apiData>null</apiData><apiDesc>The function invoked if the server returns an error.
	 </apiDesc></apiParam></apiConstructorDef><apiDesc>
	 Creates a new Responder object. You pass a Responder object to
	 <codeph>NetConnection.call()</codeph> to handle return values
	 from the server. You may pass <codeph>null</codeph> for either or 
	 both parameters.
	 
	 </apiDesc></apiConstructorDetail></apiConstructor></apiClassifier><apiClassifier id="flash.net:URLRequestHeader"><apiName>URLRequestHeader</apiName><shortdesc>
 A URLRequestHeader object encapsulates a single HTTP request header 
 and consists of a name/value pair.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiFinal/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 A URLRequestHeader object encapsulates a single HTTP request header 
 and consists of a name/value pair. 
 
 URLRequestHeader objects are used in the <codeph>requestHeaders</codeph> property of the URLRequest class.
 
 <p>In Adobe<sup>®</sup> AIR, content in the application security sandbox (such as 
 content installed with the AIR application) can use any request headers, without error. However, for content 
 running in Adobe AIR that is in a different security sandbox, 
 <ph outputclass="actionscript">or for content running in Flash<sup>®</sup> Player,</ph> 
 using following request headers cause a runtime error to be thrown, and the 
 restricted terms are not case-sensitive (for example, <codeph>Get</codeph>, <codeph>get</codeph>, and <codeph>GET</codeph> 
 are each not allowed): </p>
 
 <p>In Flash Player and in Adobe AIR content outside of the application security sandbox, 
 the following request headers cannot be used, and the restricted terms are not case-sensitive 
 (for example, <codeph>Get</codeph>, <codeph>get</codeph>, and <codeph>GET</codeph> are all not allowed). Also,
 hyphenated terms apply if an underscore character is used (for example, both <codeph>Content-Length</codeph> and
 <codeph>Content_Length</codeph> are not allowed): </p>
 
 <p><codeph>Accept-Charset</codeph>, <codeph>Accept-Encoding</codeph>, <codeph>Accept-Ranges</codeph>, <codeph>Age</codeph>, <codeph>Allow</codeph>,
 <codeph>Allowed</codeph>, <codeph>Authorization</codeph>, <codeph>Charge-To</codeph>, <codeph>Connect</codeph>,
 <codeph>Connection</codeph>, 
 <codeph>Content-Length</codeph>, <codeph>Content-Location</codeph>, <codeph>Content-Range</codeph>, <codeph>Cookie</codeph>, 
 <codeph>Date</codeph>, <codeph>Delete</codeph>, 
 <codeph>ETag</codeph>, <codeph>Expect</codeph>, <codeph>Get</codeph>, <codeph>Head</codeph>, <codeph>Host</codeph>, <codeph>Keep-Alive</codeph>, 
 <codeph>Last-Modified</codeph>, <codeph>Location</codeph>, 
 <codeph>Max-Forwards</codeph>, <codeph>Options</codeph>, <codeph>Origin</codeph>, <codeph>Post</codeph>,
 <codeph>Proxy-Authenticate</codeph>, <codeph>Proxy-Authorization</codeph>, <codeph>Proxy-Connection</codeph>, 
 <codeph>Public</codeph>, <codeph>Put</codeph>, 
 <codeph>Range</codeph>, <codeph>Referer</codeph>, <codeph>Request-Range</codeph>, <codeph>Retry-After</codeph>, <codeph>Server</codeph>,
 <codeph>TE</codeph>, <codeph>Trace</codeph>, <codeph>Trailer</codeph>, <codeph>Transfer-Encoding</codeph>,
 <codeph>Upgrade</codeph>, <codeph>URI</codeph>, <codeph>User-Agent</codeph>, <codeph>Vary</codeph>, <codeph>Via</codeph>, <codeph>Warning</codeph>, 
 <codeph>WWW-Authenticate</codeph>, <codeph>x-flash-version</codeph>.</p>
 
 <p>URLRequestHeader objects are restricted in length. If the cumulative length of a
 URLRequestHeader object (the length of the <codeph>name</codeph> property plus the <codeph>value</codeph>
 property) or an array of URLRequestHeader objects used in the <codeph>URLRequest.requestHeaders</codeph>
 property exceeds the acceptable length, an exception is thrown.</p>
 
 <p>Content running in Adobe AIR sets the <codeph>ACCEPT</codeph> header to the following, unless you
 specify a setting for the <codeph>ACCEPT</codeph> header in the <codeph>requestHeaders</codeph>
 property of the URLRequest class:</p>
 
 <codeph>text/xml,
 application/xml,
 application/xhtml+xml,
 text/html;q=0.9,
 text/plain;q=0.8,
 image/png,
 application/x-shockwave-flash,
 video/mp4;q=0.9,
 flv-application/octet-stream;q=0.8,
 video/x-flv;q=0.7,
 audio/mp4,
 ~~/~~;q=0.5</codeph>
 <p>Not all methods that accept URLRequest parameters support the <codeph>requestHeaders</codeph> property,
 consult the documentation for the method you are calling. For example, the <codeph>FileReference.upload()</codeph>
 and <codeph>FileReference.download()</codeph> methods do not
 support the <codeph>URLRequest.requestHeaders</codeph> property.</p>
 <p>Due to browser limitations, custom HTTP request headers are only supported for <codeph>POST</codeph> requests,
 not for <codeph>GET</codeph> requests.</p>  
 
 </apiDesc><example conref="examples\URLRequestHeaderExample.as"> The following example adds a single HTTP request header <codeph>header</codeph> to the array for the <codeph>requestHeaders</codeph> property. The header indicates that the application should forward the request to the origin server even if it has a cached copy of what is being requested.
<codeblock>
package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.net.URLRequestHeader;
    import flash.net.URLRequestMethod;
    import flash.net.URLVariables;

    public class URLRequestHeaderExample extends Sprite {
        public function URLRequestHeaderExample() {
            var loader:URLLoader = new URLLoader();
            configureListeners(loader);

            var header:URLRequestHeader = new URLRequestHeader("pragma", "no-cache");
            var request:URLRequest = new URLRequest("http://www.[yourdomain].com/greeting.cfm");
            request.data = new URLVariables("name=John+Doe");
            request.method = URLRequestMethod.POST;
            request.requestHeaders.push(header);
            try {
                loader.load(request);
            } catch (error:Error) {
                trace("Unable to load requested document.");
            }
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        }

        private function completeHandler(event:Event):void {
            var loader:URLLoader = URLLoader(event.target);
            trace("completeHandler: " + loader.data);
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function httpStatusHandler(event:HTTPStatusEvent):void {
            trace("httpStatusHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#URLRequest"><linktext>URLRequest</linktext></link><link href="flash.net.xml#URLLoader"><linktext>URLLoader</linktext></link></related-links><apiConstructor id="flash.net:URLRequestHeader:URLRequestHeader"><apiName>URLRequestHeader</apiName><shortdesc>
	 Creates a new URLRequestHeader object that encapsulates a single HTTP request header.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/><apiParam><apiItemName>name</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData></apiData><apiDesc>An HTTP request header name (such as <codeph>Content-Type</codeph>
	 										or <codeph>SOAPAction</codeph>).
	 </apiDesc></apiParam><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData></apiData><apiDesc>The value associated with the <codeph>name</codeph> property 
	 (such as <codeph>text/plain</codeph>).
	 </apiDesc></apiParam></apiConstructorDef><apiDesc>
	 Creates a new URLRequestHeader object that encapsulates a single HTTP request header.
	 URLRequestHeader objects are used in the <codeph>requestHeaders</codeph> 
     property of the URLRequest class.
     
	 </apiDesc></apiConstructorDetail></apiConstructor><apiValue id="flash.net:URLRequestHeader:name"><apiName>name</apiName><shortdesc>
	 An HTTP request header name (such as Content-Type or SOAPAction).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 An HTTP request header name (such as <codeph>Content-Type</codeph> or <codeph>SOAPAction</codeph>).
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestHeader:value"><apiName>value</apiName><shortdesc>
	 The value associated with the name property (such as text/plain).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 The value associated with the <codeph>name</codeph> property (such as <codeph>text/plain</codeph>).
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="flash.net:URLRequestMethod"><apiName>URLRequestMethod</apiName><shortdesc>
 The URLRequestMethod class provides values that specify whether the URLRequest object should
 use the POST method or the GET method when sending data to a server.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiFinal/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 The URLRequestMethod class provides values that specify whether the URLRequest object should
 use the <codeph>POST</codeph> method or the <codeph>GET</codeph> method when sending data to a server.
 
 </apiDesc><example conref="examples\URLRequestMethodExample.as"> The following example loads and displays the 
 data found in a local text file. It also traces event handling information.
 
 <p><b>Note:</b>To run this example, put a file named example.txt
 in the same directory as your SWF file. That file should be a simple text file containing
 a few words or lines of text.
 </p>
 <p>The example code does the following:</p>
 <ol>
    <li>The constructor function creates a URLLoader instance named <codeph>loader</codeph>.</li>
    <li>The <codeph>loader</codeph> object is passed to the <codeph>configureListeners()</codeph> method,
       which adds listeners for each of the supported URLLoader events.</li>
  <li>A URLRequest instance named <codeph>request</codeph> is created, which specifies name of the file to be loaded.</li>
  <li>The <codeph>method</codeph> property of the request is set to <codeph>URLRequestMethod.POST</codeph>.</li>
    <li>The <codeph>request</codeph> object is then passed to <codeph>loader.load()</codeph>, which loads the text file.</li>
  <li>When the URLLoader has finished loading the text file the <codeph>Event.COMPLETE</codeph> event fires, 
    triggering the <codeph>completeHandler()</codeph> method. The <codeph>completeHandler()</codeph> method simply traces
    the <codeph>data</codeph> property, the contents of the text file.</li>
 </ol>
<codeblock>


package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.*;

    public class URLRequestMethodExample extends Sprite {

        public function URLRequestMethodExample() {
            var loader:URLLoader = new URLLoader();
            configureListeners(loader);

            var request:URLRequest = new URLRequest("example.txt");
            
            request.method = URLRequestMethod.POST;
            loader.load(request);
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        }

        private function completeHandler(event:Event):void {
            var loader:URLLoader = URLLoader(event.target);
            trace("completeHandler: " + loader.data);
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function httpStatusHandler(event:HTTPStatusEvent):void {
            trace("httpStatusHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#URLRequest"><linktext>URLRequest</linktext></link><link href="flash.net.xml#URLVariables"><linktext>URLVariables</linktext></link></related-links><apiValue id="flash.net:URLRequestMethod:DELETE"><apiName>DELETE</apiName><shortdesc>
	 Specifies that the URLRequest object is a DELETE.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>DELETE</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that the URLRequest object is a <codeph>DELETE</codeph>.
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestMethod:GET"><apiName>GET</apiName><shortdesc>
	 Specifies that the URLRequest object is a GET.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>GET</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that the URLRequest object is a <codeph>GET</codeph>.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestMethod:HEAD"><apiName>HEAD</apiName><shortdesc>
	 Specifies that the URLRequest object is a HEAD.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>HEAD</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that the URLRequest object is a <codeph>HEAD</codeph>.
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestMethod:OPTIONS"><apiName>OPTIONS</apiName><shortdesc>
	 Specifies that the URLRequest object is a OPTIONS.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>OPTIONS</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that the URLRequest object is a <codeph>OPTIONS</codeph>.
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestMethod:POST"><apiName>POST</apiName><shortdesc>
	 Specifies that the URLRequest object is a POST.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>POST</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that the URLRequest object is a <codeph>POST</codeph>.
	 
	 <p><i>Note:</i> <ph platform="actionscript">For content running in Adobe AIR, when </ph>
	 <ph platform="javascript">When </ph> using the <codeph>navigateToURL()</codeph> function, the runtime 
	 treats a URLRequest that uses the POST method (one that has its <codeph>method</codeph> property set to 
	 <codeph>URLRequestMethod.POST</codeph>) as using the GET method.</p>
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestMethod:PUT"><apiName>PUT</apiName><shortdesc>
	 Specifies that the URLRequest object is a PUT.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>PUT</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that the URLRequest object is a <codeph>PUT</codeph>.
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="flash.net:FileReferenceList"><apiName>FileReferenceList</apiName><shortdesc>
 The FileReferenceList class provides a means to let users select one or more files for uploading.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>FileReferenceList
 
  
  </keyword></asCustoms></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiTipTexts><apiTipText>Provides a means to upload one or more files.
 
 </apiTipText></apiTipTexts><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
 The FileReferenceList class provides a means to let users select one or more files for uploading.
 A FileReferenceList object represents a group of one or more local files on the user's disk as
 an array of FileReference objects. For detailed information and important considerations about
 FileReference objects and the FileReference class, which you use with FileReferenceList,
 see the FileReference class.
 
 <p>To work with the FileReferenceList class:</p>
 <ul>
 <li>Instantiate the class: <codeph>var myFileRef = new FileReferenceList();</codeph></li>
 <li>Call the <codeph>FileReferenceList.browse()</codeph> method, which opens a dialog box that
 lets the user select one or more files for upload: <codeph>myFileRef.browse();</codeph></li>
 <li>After the <codeph>browse()</codeph> method is called successfully, the <codeph>fileList</codeph> property of
 the FileReferenceList object is populated with an array of FileReference objects.</li>
 <li>Call <codeph>FileReference.upload()</codeph> on each element in the
 <codeph>fileList</codeph> array.</li>
 </ul>
 
 <p>The FileReferenceList class includes a <codeph>browse()</codeph> method and a
 <codeph>fileList</codeph> property for working with multiple files. While a call to <codeph>FileReferenceList.browse()</codeph>
 is executing, SWF file playback pauses in stand-alone and external versions of Flash Player
 and in AIR for Linux and Mac OS X 10.1 and earlier.</p>
 
 </apiDesc><example conref="examples\FileReferenceListExample.as"> The following example shows how you can use events to manage the upload of multiple files.
 The CustomFileReferenceList class extends FileReferenceList and includes a <codeph>complete</codeph> event,
 which is dispatched 
 when each individual file in the FileReferenceList object is uploaded. The <codeph>LIST_COMPLETE</codeph>
 event in the FileReferenceListExample class is dispatched when all the files in the FileReferenceList
 object have been uploaded.
 
 <p>To run this example, place a script that is written to accept
 a file upload at http://www.[yourDomain].com/yourUploadHandlerScript.cfm.
 Based on the location of your SWF file and where you are uploading files to, you 
 also might need to compile the SWF file with Local Playback Security set to Access Network Only
 or update Flash<sup>®</sup> Player security settings to allow this file network access.
 If your upload server is remote and you run this example from your desktop computer,
 your server must have a crossdomain.xml file.</p>
 
<codeblock>

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.FileReference;
    import flash.net.FileReferenceList;
 
    public class FileReferenceListExample extends Sprite {
        public static var LIST_COMPLETE:String = "listComplete";
        public function FileReferenceListExample() {
            initiateFileUpload();
        }

        private function initiateFileUpload():void {
            var fileRef:CustomFileReferenceList = new CustomFileReferenceList();
            fileRef.addEventListener(FileReferenceListExample.LIST_COMPLETE, listCompleteHandler);
            fileRef.browse(fileRef.getTypes());
        }

        private function listCompleteHandler(event:Event):void {
            trace("listCompleteHandler");
        }
    }
}
 
import flash.events.*;
import flash.net.FileReference;
import flash.net.FileReferenceList;
import flash.net.FileFilter;
import flash.net.URLRequest;
 
class CustomFileReferenceList extends FileReferenceList {
    private var uploadURL:URLRequest;
    private var pendingFiles:Array;

    public function CustomFileReferenceList() {
        uploadURL = new URLRequest();
        uploadURL.url = "http://www.[yourDomain].com/yourUploadHandlerScript.cfm";
        initializeListListeners();
    }

    private function initializeListListeners():void {
        addEventListener(Event.SELECT, selectHandler);
        addEventListener(Event.CANCEL, cancelHandler);
    }

    public function getTypes():Array {
        var allTypes:Array = new Array();
        allTypes.push(getImageTypeFilter());
        allTypes.push(getTextTypeFilter());
        return allTypes;
    }
 
    private function getImageTypeFilter():FileFilter {
        return new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg;*.jpeg;*.gif;*.png");
    }
 
    private function getTextTypeFilter():FileFilter {
        return new FileFilter("Text Files (*.txt, *.rtf)", "*.txt;*.rtf");
    }
 
    private function doOnComplete():void {
        var event:Event = new Event(FileReferenceListExample.LIST_COMPLETE);
        dispatchEvent(event);
    }
 
    private function addPendingFile(file:FileReference):void {
        trace("addPendingFile: name=" + file.name);
        pendingFiles.push(file);
        file.addEventListener(Event.OPEN, openHandler);
        file.addEventListener(Event.COMPLETE, completeHandler);
        file.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        file.addEventListener(ProgressEvent.PROGRESS, progressHandler);
        file.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
        file.upload(uploadURL);
    }
 
    private function removePendingFile(file:FileReference):void {
        for (var i:uint; i &lt; pendingFiles.length; i++) {
            if (pendingFiles[i].name == file.name) {
                pendingFiles.splice(i, 1);
                if (pendingFiles.length == 0) {
                    doOnComplete();
                }
                return;
            }
        }
    }
 
    private function selectHandler(event:Event):void {
        trace("selectHandler: " + fileList.length + " files");
        pendingFiles = new Array();
        var file:FileReference;
        for (var i:uint = 0; i &lt; fileList.length; i++) {
            file = FileReference(fileList[i]);
            addPendingFile(file);
        }
    }
 
    private function cancelHandler(event:Event):void {
        var file:FileReference = FileReference(event.target);
        trace("cancelHandler: name=" + file.name);
    }
 
    private function openHandler(event:Event):void {
        var file:FileReference = FileReference(event.target);
        trace("openHandler: name=" + file.name);
    }
 
    private function progressHandler(event:ProgressEvent):void {
        var file:FileReference = FileReference(event.target);
        trace("progressHandler: name=" + file.name + " bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
    }
 
    private function completeHandler(event:Event):void {
        var file:FileReference = FileReference(event.target);
        trace("completeHandler: name=" + file.name);
        removePendingFile(file);
    }
 
    private function httpErrorHandler(event:Event):void {
        var file:FileReference = FileReference(event.target);
        trace("httpErrorHandler: name=" + file.name);
    }
 
    private function ioErrorHandler(event:Event):void {
        var file:FileReference = FileReference(event.target);
        trace("ioErrorHandler: name=" + file.name);
    }
 
    private function securityErrorHandler(event:Event):void {
        var file:FileReference = FileReference(event.target);
        trace("securityErrorHandler: name=" + file.name + " event=" + event.toString());
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#FileReference"><linktext>FileReference</linktext></link></related-links><adobeApiEvent id="flash.net:FileReferenceList_flash.events.Event.SELECT_select"><apiName>select</apiName><shortdesc>
 Dispatched when the user selects one or more files to upload from the file-browsing dialog box.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><maelexample>The following example demonstrates the usage of the <code>select</code> event.
 <listing version="2.0">
 import flash.net.FileReferenceList;
 import flash.net.FileReference;
 
 var listener:Object = new Object();
 
 listener.onSelect = function(fileRefList:FileReferenceList) {
 	trace("onSelect");
 	var list:Array = fileRefList.fileList;
 	var item:FileReference;
 	for(var i:Number = 0; i &lt; list.length; i++) {
 		item = list[i];
 		trace("name: " + item.name);
 		trace(item.addListener(this));
 		item.upload("http://www.yourdomain.com/");
 	}
 }
 
 listener.onComplete = function(file:FileReference):void {
 	trace("onComplete: " + file.name);
 }
 
 var fileRef:FileReferenceList = new FileReferenceList();
 fileRef.addListener(listener);
 fileRef.browse();
 </listing>
 </maelexample></asCustoms></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.SELECT</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when the user selects one or more files to upload from the file-browsing dialog box.
 (This dialog box opens
 when you call the <codeph>FileReferenceList.browse()</codeph>,
 <codeph>FileReference.browse()</codeph>, or <codeph>FileReference.download()</codeph>  methods.)
 
 When the user selects a file and confirms the operation (for example, by clicking Save),
 the <codeph>FileReferenceList</codeph> object is populated with FileReference objects
 that represent the files that the user selects.
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#FileReferenceList/browse()"><linktext>FileReferenceList.browse()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReferenceList_flash.events.Event.CANCEL_cancel"><apiName>cancel</apiName><shortdesc>
 Dispatched when the user dismisses the file-browsing dialog box.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><helpid>
 </helpid></asCustoms></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.CANCEL</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when the user dismisses the file-browsing dialog box.
 (This dialog box opens
 when you call the <codeph>FileReferenceList.browse()</codeph>,
 <codeph>FileReference.browse()</codeph>, or <codeph>FileReference.download()</codeph>  methods.)
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#FileReferenceList/browse()"><linktext>FileReferenceList.browse()</linktext></link></related-links></adobeApiEvent><apiConstructor id="flash.net:FileReferenceList:FileReferenceList"><apiName>FileReferenceList</apiName><shortdesc>
 	 Creates a new FileReferenceList object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><maelexample>The following example creates a new <code>FileReferenceList</code> object,
	 iterates over each selected file, and outputs their names.
	 <listing version="2.0">
	 import flash.net.FileReferenceList;
	 
	 var listener:Object = new Object();
	 listener.onSelect = function(fileRefList:FileReferenceList) {
	 	trace("onSelect");
	 	var arr:Array = fileRefList.fileList;
	 	for(var i:Number = 0; i &lt; arr.length; i++) {
	 		trace("name: " + arr[i].name);
	 	}
	 }
	 
	 var fileRef:FileReferenceList = new FileReferenceList();
	 fileRef.addListener(listener);
	 fileRef.browse();
	 </listing>
  	 
  	 </maelexample></asCustoms></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/></apiConstructorDef><apiDesc>
 	 Creates a new FileReferenceList object. A FileReferenceList object contains nothing
	 until you call the <codeph>browse()</codeph> method on it and the user selects one or more files.
	 When you call <codeph>browse()</codeph> on the
	 FileReference object, the <codeph>fileList</codeph> property of the object is populated
	 with an array of <codeph>FileReference</codeph> objects.
	 
	 </apiDesc></apiConstructorDetail><related-links><link href="flash.net.xml#FileReference"><linktext>FileReference</linktext></link><link href="flash.net.xml#FileReferenceList/browse()"><linktext>FileReferenceList.browse()</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:FileReferenceList:browse"><apiName>browse</apiName><shortdesc>
	 Displays a file-browsing dialog box that lets the
	 user select one or more local files to upload.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><oldexample><pre>
	 // ask the user to choose an image file for upload
	 var fileRef = new FileReference();
	 if (fileRef.browse(["Images", "jpg;gif;png", "Flash Movies", "swf"])) {
	   trace("Opened " + fileRef.name);
	 } else {
	   trace("User canceled");
	 }
	 </pre>
	 
	 
	 </oldexample></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Thrown for the following reasons: 1) Another FileReference
	 or FileReferenceList browse session is in progress; only one file browsing session
	 may be performed at a time. 2) A setting in the user's mms.cfg file prohibits this operation. 
	 </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException><apiDesc>If the <codeph>typeFilter</codeph> array does not contain correctly formatted
	 FileFilter objects, an exception is thrown. For details on correct filter formatting,
	 see the FileFilter documentation.
	 
     </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiException><apiDesc>If the method is not called in response to a user action, such as a mouse
     event or keypress event.
     
	  
	  </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiReturn><apiDesc>Returns <codeph>true</codeph> if the parameters are valid and the file-browsing dialog box
	 opens.
	 
	 </apiDesc><apiOperationClassifier>Boolean</apiOperationClassifier></apiReturn><apiParam><apiItemName>typeFilter</apiItemName><apiOperationClassifier>Array</apiOperationClassifier><apiData>null</apiData><apiDesc>An array of FileFilter instances used to filter the files that are
	 displayed in the dialog box. If you omit this parameter, all files are displayed.
	 For more information, see the <xref href="FileFilter.html">FileFilter</xref> class. 
	 
	 </apiDesc></apiParam><apiTipTexts><apiTipText>Displays a file-browsing dialog box that lets the
	 user select local files to upload.
	 
	 </apiTipText></apiTipTexts></apiOperationDef><apiDesc>
	 Displays a file-browsing dialog box that lets the
	 user select one or more local files to upload. The dialog box is native to the user's
	 operating system.
	 
	 <p platform="actionscript">In Flash Player 10 and later, you can call this method successfully 
	 only in response to a user event (for example, in an event handler for a mouse click or keypress event). 
	 Otherwise, calling this method results in Flash Player throwing an Error.</p>
	 
	 <p>When you call this method and the user successfully selects files,
	 the <codeph>fileList</codeph> property of this FileReferenceList object is populated with
	 an array of FileReference objects, one for each file that the user selects.
	 Each subsequent time that the FileReferenceList.browse() method is called, the
	 <codeph>FileReferenceList.fileList</codeph> property is reset to the file(s) that the 
	 user selects in the dialog box.</p>
	 
	 <p>Using the <codeph>typeFilter</codeph> parameter, you can determine which files 
	 the dialog box displays.</p>
	 
	 <p>Only one <codeph>FileReference.browse()</codeph>, <codeph>FileReference.download()</codeph>,
	 or <codeph>FileReferenceList.browse()</codeph> session can be performed at a time 
	 on a FileReferenceList object
	 (because only one dialog box can be opened at a time).</p>
	 
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link><link href="flash.net.xml#FileReference"><linktext>FileReference class</linktext></link><link href="flash.net.xml#FileFilter"><linktext>FileFilter class</linktext></link></related-links><adobeApiEvent id="flash.net:FileReferenceList:browse_select"><apiName>select</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Invoked when the user has successfully selected an item for upload from the dialog box.
	 </apiDesc></adobeApiEventDetail><shortdesc>Invoked when the user has successfully selected an item for upload from the dialog box.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReferenceList:browse_cancel"><apiName>cancel</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Invoked when the user dismisses the dialog box by clicking Cancel or by closing it.
	 
	 </apiDesc></adobeApiEventDetail><shortdesc>Invoked when the user dismisses the dialog box by clicking Cancel or by closing it.</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.net:FileReferenceList:fileList:get"><apiName>fileList</apiName><shortdesc>
	 An array of FileReference objects.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><oldexample>The following example demonstrates the <code>fileList</code> property.
	 <listing version="2.0">
	 import flash.net.FileReferenceList;
	 import flash.net.FileReference;
	 
	 var listener:Object = new Object();
	 listener.onSelect = function(fileRefList:FileReferenceList) {
	 	trace("onSelect");
	 	var list:Array = fileRefList.fileList;
	 	var item:FileReference;
	 	for(var i:Number = 0; i &lt; list.length; i++) {
	 		item = list[i];
	 		trace("name: " + item.name);
	 	}
	 }
	 
	 var fileRef:FileReferenceList = new FileReferenceList();
	 fileRef.addListener(listener);
	 fileRef.browse();
	 </listing>
	 
	  
	  </oldexample></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Array</apiValueClassifier><apiTipTexts><apiTipText>An array of FileReference objects.
	 
	 </apiTipText></apiTipTexts></apiValueDef><apiDesc>
	 An array of <codeph>FileReference</codeph> objects.
	 
	 <p>When the <codeph>FileReferenceList.browse()</codeph> method is called and the user
	 has selected one or more files from the dialog box that the <codeph>browse()</codeph> method opens,
	 this property is populated with an array of FileReference objects,
	 each of which represents the files the user selected.
	 You can then use this array to upload each file with the <codeph>FileReference.upload()</codeph>method.
	 You must upload one file at a time.</p>
	 
	 <p>The <codeph>fileList</codeph> property is populated anew each time browse() is called on
	 that FileReferenceList object.</p>
	 
	 <p>The properties of <codeph>FileReference</codeph> objects are described
	 in the FileReference class documentation.</p>
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#FileReference"><linktext>FileReference</linktext></link><link href="flash.net.xml#FileReference/upload()"><linktext>FileReference.upload()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()"><linktext>FileReferenceList.browse()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier id="flash.net:FileReference"><apiName>FileReference</apiName><shortdesc>
  The FileReference class provides a means to upload and
  download files between a user's computer and a server.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>FileReference, FileReference.browse, FileReference.download, FileReference.create, browse, download, create
  </keyword></asCustoms></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
  The FileReference class provides a means to upload and
  download files between a user's computer and a server. An operating-system 
  dialog box prompts the user to select a file to upload or a location for
  download. Each FileReference object refers to a single file on the user's disk 
  and has properties that contain information about 
  the file's size, type, name, creation date, modification date, and creator type
  (Macintosh only). 
  
  <p><b>Note:</b> In Adobe AIR, the File class, which extends the FileReference class, 
  provides more capabilities and has less security restrictions than the FileReference class.</p>
  
  <p>FileReference instances are created in the following ways:</p>
  <ul>
  <li>When you use the <codeph>new</codeph> operator with the FileReference constructor: 
  
  <codeph>var myFileReference = new FileReference();</codeph></li>
  
  <li>When you call the <codeph>FileReferenceList.browse()</codeph> method, which creates an array of FileReference objects.</li>
  </ul>
  
  <p>During an upload operation, all the properties of a FileReference object are 
  populated by calls to the <codeph>FileReference.browse()</codeph> or <codeph>FileReferenceList.browse()</codeph> methods.
  During a download operation, the <codeph>name</codeph> property is populated when the
  <codeph>select</codeph> event is dispatched; all other properties are populated when the
  <codeph>complete</codeph> event is dispatched.</p>
  
  <p>The <codeph>browse()</codeph> method opens an operating-system dialog box that prompts the 
  user to select a file for upload. The <codeph>FileReference.browse()</codeph> method
  lets the user select a single file; the <codeph>FileReferenceList.browse()</codeph> method
  lets the user select multiple files. After a successful call to the <codeph>browse()</codeph> method,
  call the <codeph>FileReference.upload()</codeph> method to upload one file at a time. The 
  <codeph>FileReference.download()</codeph> method prompts the user for a location to save
  the file and initiates downloading from a remote URL.</p>
  
  <p>The FileReference and FileReferenceList classes do not let you set the default file location
  for the dialog box that the <codeph>browse()</codeph> or <codeph>download()</codeph> methods generate.
  The default location shown in the dialog box is the most
  recently browsed folder, if that location can be determined, or the desktop.
  The classes do not allow you to read from or write to the transferred file. 
  They do not allow the SWF file that initiated the
  upload or download to access the uploaded or downloaded file or the file's location on
  the user's disk.</p>
  
  <p>The FileReference and FileReferenceList classes also do not provide
  methods for authentication. With servers that require authentication, you can
  download files with the Flash<sup>®</sup> Player browser plug-in, but   
  uploading (on all players) and downloading (on the stand-alone or
  external player) fails. Listen for FileReference events to determine whether 
  operations complete successfully and to handle errors.</p>
  
  <p>For <ph platform="actionscript">content running in Flash Player or for</ph> 
  content running in Adobe AIR outside of the application security sandbox, 
  uploading and downloading operations can access files only within its own domain and within 
  any domains that a URL policy file specifies. Put a policy file on the file server 
  if the content initiating the upload or download doesn't come from the same domain as the file server.</p>
  
  <p>Note that because of new functionality added to the Flash Player, when publishing to Flash Player 10, you can have
  only one of the following operations active at one time: <codeph>FileReference.browse()</codeph>, 
  <codeph>FileReference.upload()</codeph>, <codeph>FileReference.download()</codeph>, <codeph>FileReference.load()</codeph>,
  <codeph>FileReference.save()</codeph>. Otherwise, Flash Player throws a runtime error (code 2174). Use <codeph>FileReference.cancel()</codeph>
  to stop an operation in progress. This restriction applies only to Flash Player 10. Previous versions of Flash Player
  are unaffected by this restriction on simultaneous multiple operations.</p>
  
  <p platform="actionscript">While calls to the <codeph>FileReference.browse()</codeph>, <codeph>FileReferenceList.browse()</codeph>, 
  or <codeph>FileReference.download()</codeph> methods are executing, SWF file playback pauses in stand-alone and external versions 
  of Flash Player and in AIR for Linux and Mac OS X 10.1 and earlier</p>
  
  <p platform="actionscript">The following sample HTTP <codeph>POST</codeph> request is sent from Flash Player to a server-side 
  script if no parameters are specified:
  </p>
  
  <pre platform="actionscript">
  POST /handler.cfm HTTP/1.1 
  Accept: text/~~
  Content-Type: multipart/form-data; 
  boundary=----------Ij5ae0ae0KM7GI3KM7 
  User-Agent: Shockwave Flash 
  Host: www.example.com 
  Content-Length: 421 
  Connection: Keep-Alive 
  Cache-Control: no-cache
  
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7
  Content-Disposition: form-data; name="Filename"
  
  MyFile.jpg
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7
  Content-Disposition: form-data; name="Filedata"; filename="MyFile.jpg"
  Content-Type: application/octet-stream
  
  FileDataHere
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7
  Content-Disposition: form-data; name="Upload"
  
  Submit Query
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7--
  </pre>
  
  <p platform="actionscript">Flash Player sends the following HTTP <codeph>POST</codeph> request if the user 
  specifies the parameters <codeph>"api_sig"</codeph>, <codeph>"api_key"</codeph>, and 
  <codeph>"auth_token"</codeph>:
  </p>
  
  <pre platform="actionscript">
  POST /handler.cfm HTTP/1.1 
  Accept: text/~~
  Content-Type: multipart/form-data; 
  boundary=----------Ij5ae0ae0KM7GI3KM7 
  User-Agent: Shockwave Flash 
  Host: www.example.com 
  Content-Length: 421 
  Connection: Keep-Alive 
  Cache-Control: no-cache
  
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7
  Content-Disposition: form-data; name="Filename"
  
  MyFile.jpg
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7
  Content-Disposition: form-data; name="api_sig"
  
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7
  Content-Disposition: form-data; name="api_key"
  
  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7
  Content-Disposition: form-data; name="auth_token"
  
  XXXXXXXXXXXXXXXXXXXXXX
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7
  Content-Disposition: form-data; name="Filedata"; filename="MyFile.jpg"
  Content-Type: application/octet-stream
  
  FileDataHere
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7
  Content-Disposition: form-data; name="Upload"
  
  Submit Query
  ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7--
  </pre>
  </apiDesc><example conref="examples\FileReferenceExample.as"> The following example displays the 
 data format and status information for a file loaded at runtime.  
 <p> <b>Note:</b>
 To run this example, change the uploadURL.url property to point to an actual URL,
 rather than the fictional one in the example. The URL should point to a file named 
 <codeph>yourUploadHandlerScript.cfm</codeph> in the root    web directory of the URL specified.
 Based on your configuration, you might also need to compile the SWF file with Local Playback Security set to Access Network Only
 or to update Flash Player security settings to allow this file network access.
 </p>
<codeblock>
package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.FileFilter;
    import flash.net.FileReference;
    import flash.net.URLRequest;

    public class FileReferenceExample extends Sprite {
        private var uploadURL:URLRequest;
        private var file:FileReference;

        public function FileReferenceExample() {
            uploadURL = new URLRequest();
            uploadURL.url = "http://www.[yourDomain].com/yourUploadHandlerScript.cfm";
            file = new FileReference();
            configureListeners(file);
            file.browse(getTypes());
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.CANCEL, cancelHandler);
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(Event.SELECT, selectHandler);
            dispatcher.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,uploadCompleteDataHandler);
        }

        private function getTypes():Array {
            var allTypes:Array = new Array(getImageTypeFilter(), getTextTypeFilter());
            return allTypes;
        }

        private function getImageTypeFilter():FileFilter {
            return new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg;*.jpeg;*.gif;*.png");
        }

        private function getTextTypeFilter():FileFilter {
            return new FileFilter("Text Files (*.txt, *.rtf)", "*.txt;*.rtf");
        }

        private function cancelHandler(event:Event):void {
            trace("cancelHandler: " + event);
        }

        private function completeHandler(event:Event):void {
            trace("completeHandler: " + event);
        }

        private function uploadCompleteDataHandler(event:DataEvent):void {
            trace("uploadCompleteData: " + event);
        }

        private function httpStatusHandler(event:HTTPStatusEvent):void {
            trace("httpStatusHandler: " + event);
        }
        
        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            var file:FileReference = FileReference(event.target);
            trace("progressHandler name=" + file.name + " bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function selectHandler(event:Event):void {
            var file:FileReference = FileReference(event.target);
            trace("selectHandler: name=" + file.name + " URL=" + uploadURL.url);
            file.upload(uploadURL);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#FileReferenceList"><linktext>flash.net.FileReferenceList</linktext></link><link href="flash.filesystem.xml#File"><linktext>flash.filesystem.File</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference_flash.events.DataEvent.UPLOAD_COMPLETE_DATA_uploadCompleteData"><apiName>uploadCompleteData</apiName><shortdesc>
    Dispatched after data is received from the server after a successful upload.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9.0.28.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.DataEvent.UPLOAD_COMPLETE_DATA</apiEventType><adobeApiEventClassifier>flash.events.DataEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
    Dispatched after data is received from the server after a successful upload.
    This event is not dispatched if data is not returned from the server.
    </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS_httpResponseStatus"><apiName>httpResponseStatus</apiName><shortdesc>
	 Dispatched if a call to the upload() or uploadUnencoded() 
	 method attempts to access data over HTTP and Adobe AIR is able to detect and return 
	 the status code for the request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS</apiEventType><adobeApiEventClassifier>flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
	 Dispatched if a call to the <codeph>upload()</codeph> or <codeph>uploadUnencoded()</codeph> 
	 method attempts to access data over HTTP and Adobe AIR is able to detect and return 
	 the status code for the request. 
	 
	 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#FileReference/upload()"><linktext>upload()</linktext></link><link href="flash.net.xml#FileReference/uploadUnencoded()"><linktext>uploadUnencoded()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.HTTPStatusEvent.HTTP_STATUS_httpStatus"><apiName>httpStatus</apiName><shortdesc>
     Dispatched when an upload fails and an HTTP status code is available 
     to describe the failure.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.HTTPStatusEvent.HTTP_STATUS</apiEventType><adobeApiEventClassifier>flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
     Dispatched when an upload fails and an HTTP status code is available 
     to describe the failure. The <codeph>httpStatus</codeph> event
     is dispatched, followed by an <codeph>ioError</codeph> event.
     
     <p>The <codeph>httpStatus</codeph> event is dispatched only for upload failures.
     For content running in Flash Player this event is not applicable for download failures.
     If a download fails because of an HTTP error, the error is reported as an I/O error.</p>
     
     </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#FileReference/upload()"><linktext>FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.Event.SELECT_select"><apiName>select</apiName><shortdesc>
	Dispatched when the user selects a file for upload or download from the file-browsing dialog box.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><helpid>
    </helpid></asCustoms></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.SELECT</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
	Dispatched when the user selects a file for upload or download from the file-browsing dialog box. 
	(This dialog box opens when you call the <codeph>FileReference.browse()</codeph>, 
	<codeph>FileReferenceList.browse()</codeph>,
	or <codeph>FileReference.download()</codeph> method.)
    When the user selects a file and confirms the operation (for example, by clicking OK), 
    the properties of the FileReference object are populated.
    
    <p>For content running <ph platform="actionscript">in Flash Player or</ph> outside of the 
    application security sandbox <ph platform="actionscript">in the Adobe AIR runtime</ph>,
    the <codeph>select</codeph> event acts slightly differently depending on what
    method invokes it. When the <codeph>select</codeph> event is dispatched after a <codeph>browse()</codeph> call, 
    <ph platform="actionscript">Flash Player or</ph> the AIR application can read all the 
    FileReference object's properties, because the file selected by the user is on the local
    file system. When the <codeph>select</codeph> event occurs after a <codeph>download()</codeph> call, 
    <ph platform="actionscript">Flash Player or</ph> the AIR application can read only 
    the <codeph>name</codeph> property, because the file hasn't yet been downloaded to the local file system
    at the moment the <codeph>select</codeph> event is dispatched. When the file is downloaded and the
    <codeph>complete</codeph> event dispatched, <ph platform="actionscript">Flash Player or</ph> 
    the AIR application  can read all other properties of the FileReference object.</p>
    
    </apiDesc><example conref="examples\FileReference_event_select.as"> The following example shows usage of the <codeph>select</codeph> event object.
 To run this example, change the <codeph>uploadURL.url</codeph> property to point to an actual domain and file,
 rather than the fictional http://www.[yourDomain].com/SomeFile.pdf.
 You might also need to compile the SWF file with Local playback security set to Access network only
 or to update Flash Player security settings to allow this file network access.
 In order for this example to run from your desktop, your server also needs to have a crossdomain.xml
 file posted.
 If the <codeph>ioErrorHandler()</codeph> function is triggered, you probably need to update the provided <codeph>uploadURL</codeph> with
 a valid url that is configured to receive uploads.
<codeblock>
 
package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.FileReference;
    import flash.net.URLRequest;

    public class FileReference_event_select extends Sprite {
        private var uploadURL:URLRequest;
        private var file:FileReference;

        public function FileReference_event_select() {
            uploadURL = new URLRequest();
            uploadURL.url = "http://www.[yourDomain].com/yourUploadHandlerScript.cfm";
            file = new FileReference();
            file.addEventListener(Event.SELECT, selectHandler);
            file.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            file.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            file.addEventListener(Event.COMPLETE, completeHandler);
            file.browse();
        }

        private function selectHandler(event:Event):void {
            var file:FileReference = FileReference(event.target);
            trace("selectHandler: name=" + file.name + " URL=" + uploadURL.url);
            file.upload(uploadURL);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            var file:FileReference = FileReference(event.target);
            trace("progressHandler: name=" + file.name + " bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
        }

        private function completeHandler(event:Event):void {
            trace("completeHandler: " + event);
        }
    }
}
</codeblock></example></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError"><apiName>securityError</apiName><shortdesc>
     Dispatched when a call to the FileReference.upload() 
     or FileReference.download() method tries to upload a file to a server or
	 get a file from a server that is outside the caller's security sandbox.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><helpid>
     
     </helpid></asCustoms></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier>flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
     Dispatched when a call to the <codeph>FileReference.upload()</codeph> 
     or <codeph>FileReference.download()</codeph> method tries to upload a file to a server or
	 get a file from a server that is outside the caller's security sandbox. The value of
     the text property that describes the specific error that occurred 
     is normally <codeph>"securitySandboxError"</codeph>.
     The calling SWF file may have tried to access a SWF file
     outside its domain and does not have permission to do so. You can
     try to remedy this error by using a URL policy file.
     
     <p>In Adobe AIR, these security restrictions do not apply 
     to content in the application security sandbox.</p>
     
	 <p>In Adobe AIR, these security restrictions do not apply 
	 to content in the application security sandbox.</p>
	 
     </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#FileReference/download()"><linktext>FileReference.download()</linktext></link><link href="flash.net.xml#FileReference/upload()"><linktext>FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.ProgressEvent.PROGRESS_progress"><apiName>progress</apiName><shortdesc>
	Dispatched periodically during the file upload or download operation.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><helpid>
    </helpid></asCustoms></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.ProgressEvent.PROGRESS</apiEventType><adobeApiEventClassifier>flash.events.ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
	Dispatched periodically during the file upload or download operation.
    The <codeph>progress</codeph> event is dispatched while Flash Player 
    transmits bytes to a server, and it is periodically dispatched during the 
    transmission, even if the transmission is ultimately not successful. 
    To determine if and when the file transmission is actually successful
    and complete, listen for the <codeph>complete</codeph> event.
    
    <p>In some cases, <codeph>progress</codeph> events are not received. For example,
    when the file being transmitted is very small or the upload or download
    happens very quickly a <codeph>progress</codeph> event might not be dispatched.</p>
    
    <p>File upload progress cannot be determined on Macintosh platforms earlier than OS X 10.3.
    The <codeph>progress</codeph> event is called during the upload operation, but the value of the 
    <codeph>bytesLoaded</codeph> property of the progress event is -1, 
    indicating that the progress cannot be determined.</p>
    
    </apiDesc><example conref="examples\FileReference_event_progress.as"> The following example shows usage of the <codeph>progress</codeph> event.
 To run this example, change the <codeph>downloadURL.url</codeph> property to point to an actual domain and file,
 rather than the fictional http://www.[yourDomain].com/SomeFile.pdf.
 You might also need to compile the SWF file with Local playback security set to Access network only
 or to update Flash Player security settings to allow this file network access.
<codeblock>

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.FileReference;
    import flash.net.URLRequest;

    public class FileReference_event_progress extends Sprite {
        private var downloadURL:URLRequest;
        private var fileName:String = "SomeFile.pdf";
        private var file:FileReference;

        public function FileReference_event_progress() {
            downloadURL = new URLRequest();
            downloadURL.url = "http://www.[yourDomain].com/SomeFile.pdf";
            file = new FileReference();
            file.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            file.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            file.addEventListener(Event.COMPLETE, completeHandler);
            file.download(downloadURL, fileName);
        }

        private function progressHandler(event:ProgressEvent):void {
            var file:FileReference = FileReference(event.target);
            trace("progressHandler: name=" + file.name + " bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
        }
        
        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }
        
        private function completeHandler(event:Event):void {
            trace("completeHandler: " + event);
        }
    }
}
</codeblock></example></adobeApiEventDetail><related-links><link href="flash.net.xml#FileReference/event:complete"><linktext>FileReference.complete</linktext></link><link href="flash.events.xml#ProgressEvent"><linktext>flash.events.ProgressEvent</linktext></link><link href="flash.net.xml#FileReference/download()"><linktext>FileReference.download()</linktext></link><link href="flash.net.xml#FileReference/upload()"><linktext>FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.Event.OPEN_open"><apiName>open</apiName><shortdesc>
	Dispatched when an upload or download operation starts.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><maelexample>The following example shows the usage of the <code>open</code> event.
    It should be made clear that there is no way to actually track the progress
    of a download, just that it hasn't yet finished or failed.
    
    <listing version="2.0">
    import flash.net.FileReference;
    
    var listener:Object = new Object();
    
    listener.onOpen = function(file:FileReference):void {
      trace("onOpen: " + file.name);
    }
    
    var fileRef:FileReference = new FileReference();
    fileRef.addListener(listener);
    var url:String = "http://www.adobe.com/platform/whitepapers/platform_overview.pdf";
    fileRef.download(url, "FlashPlatform.pdf");
    </listing>
    </maelexample></asCustoms></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.OPEN</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
	Dispatched when an upload or download operation starts.
    
    
    </apiDesc><example conref="examples\FileReference_download.as"> The following example shows usage of the <codeph>download</codeph> event object.
 To run this example, change the <codeph>downloadURL.url</codeph> property to point to an actual domain and file,
 rather than the fictional http://www.[yourDomain].com/SomeFile.pdf.
 You might also need to compile the SWF file with Local playback security set to Access network only
 or to update Flash Player security settings to allow this file network access.
<codeblock>

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.FileReference;
    import flash.net.URLRequest;
    import flash.net.FileFilter;

    public class FileReference_download extends Sprite {
        private var downloadURL:URLRequest;
        private var fileName:String = "SomeFile.pdf";
        private var file:FileReference;

        public function FileReference_download() {
            downloadURL = new URLRequest();
            downloadURL.url = "http://www.[yourDomain].com/SomeFile.pdf";
            file = new FileReference();
            configureListeners(file);
            file.download(downloadURL, fileName);
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.CANCEL, cancelHandler);
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(Event.SELECT, selectHandler);
        }

        private function cancelHandler(event:Event):void {
            trace("cancelHandler: " + event);
        }

        private function completeHandler(event:Event):void {
            trace("completeHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            var file:FileReference = FileReference(event.target);
            trace("progressHandler name=" + file.name + " bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function selectHandler(event:Event):void {
            var file:FileReference = FileReference(event.target);
            trace("selectHandler: name=" + file.name + " URL=" + downloadURL.url);
        }
    }
}
</codeblock></example></adobeApiEventDetail><related-links><link href="flash.net.xml#FileReference/download()"><linktext>FileReference.download()</linktext></link><link href="flash.net.xml#FileReference/upload()"><linktext>FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.IOErrorEvent.IO_ERROR_ioError"><apiName>ioError</apiName><shortdesc>
	Dispatched when the upload or download fails.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><maelexample>The following example shows the usage of the <code>ioError</code> event. 
    Note that for simplicity, none of the other event types are used in this
    example.
    
    <listing version="2.0">
    import flash.net.FileReference;
    
    var listener:Object = new Object();
    
    listener.onIOError = function(file:FileReference):void {
      trace("onIOError");
    }
    
    var fileRef:FileReference = new FileReference();
    fileRef.addListener(listener);
    fileRef.download("http://www.adobe.com/NonExistentFile.pdf", "NonExistentFile.pdf");
    
    </listing>
    
    </maelexample></asCustoms></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier>flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
	Dispatched when the upload or download fails. A file transfer can fail for one of the following reasons:
    
    <ul>
    <li>An input/output error occurs while the player is reading, writing, or transmitting the file.</li>
    <li>The <ph platform="actionscript">SWF file</ph><ph platform="javascript">AIR application</ph> 
    tries to upload a file to a server that requires authentication 
    (such as a user name and password). During upload, <ph platform="actionscript">Flash Player or</ph>
    Adobe AIR does not provide a means for users to enter passwords. If <ph platform="actionscript">a SWF file</ph>
    <ph platform="javascript">an AIR application</ph> tries to upload a file to a server that
    requires authentication, the upload fails.</li>
    <li>The <ph platform="actionscript">SWF file</ph><ph platform="javascript">AIR application</ph>
    tries to download a file from a server that requires authentication, 
    within the stand-alone or external player. During download, the stand-alone and external players
    do not provide a means for users to enter passwords. If <ph platform="actionscript">a SWF file</ph>
    <ph platform="javascript">an AIR application</ph> in these players tries to download
    a file from a server that requires authentication, the download fails. 
    <ph platform="actionscript">File download can succeed only in the ActiveX control, browser plug-in 
    players, and the Adobe AIR runtime.</ph></li>
    <li>The value passed to the <codeph>url</codeph> parameter in the <codeph>upload()</codeph> method contains an 
    invalid protocol. Valid protocols are HTTP and HTTPS.</li>
    </ul>
    
    <p platform="actionscript"><b>Important:</b> Only applications running 
    in a browser — that is, using the browser plug-in or ActiveX control — and 
    content running in Adobe AIR can provide a dialog box to prompt 
    the user to enter a user name and password for authentication, and then only for downloads. 
    For uploads using the plug-in or ActiveX control version of Flash Player, or for upload or 
    download using either the stand-alone or the external player, the file transfer fails.</p>
    
    </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#FileReference/download()"><linktext>FileReference.download()</linktext></link><link href="flash.net.xml#FileReference/upload()"><linktext>FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.Event.COMPLETE_complete"><apiName>complete</apiName><shortdesc>
	Dispatched when download is complete or when upload generates an HTTP status code of 200.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><maelexample>The following example shows usage of the <code>complete</code> event 
    listener. It should be made clear that there is no way to actually track the progress
    of a download, just that it hasn't yet finished or failed.
    
    <listing version="2.0">
    import flash.net.FileReference;
    
    var listener:Object = new Object();
    
    listener.onComplete = function(file:FileReference):void {
      trace("onComplete: " + file.name);
    }
    
    var fileRef:FileReference = new FileReference();
    fileRef.addListener(listener);
    var url:String = "http://www.adobe.com/platform/whitepapers/platform_overview.pdf";
    fileRef.download(url, "FlashPlatform.pdf");
    </listing>
    </maelexample></asCustoms></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.COMPLETE</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
	Dispatched when download is complete or when upload generates an HTTP status code of 200. 
	For file download, this event is dispatched when <ph platform="actionscript">Flash Player or</ph>
    Adobe AIR finishes downloading the entire file to disk. 
	For file upload, this event is dispatched after the 
    <ph platform="actionscript">Flash Player or</ph> Adobe AIR 
    receives an HTTP status code of 200 from the server receiving
    the transmission.
    
    </apiDesc><example conref="examples\FileReference_event_complete.as"> The following example shows usage of the <codeph>complete</codeph> event object.
 To run this example, change the <codeph>downloadURL.url</codeph> property to point to an actual domain and file,
 rather than the fictional http://www.[yourDomain].com/SomeFile.pdf.
 You might also need to compile the SWF file with Local playback security set to Access network only
 or to update Flash Player security settings to allow this file network access.
<codeblock>

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.FileReference;
    import flash.net.URLRequest;

    public class FileReference_event_complete extends Sprite {
        private var downloadURL:URLRequest;
        private var fileName:String = "SomeFile.pdf";
        private var file:FileReference;

        public function FileReference_event_complete() {
            downloadURL = new URLRequest();
            downloadURL.url = "http://www.[yourDomain].com/SomeFile.pdf";
            file = new FileReference();
            configureListeners(file);
            file.download(downloadURL, fileName);
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.CANCEL, cancelHandler);
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(Event.SELECT, selectHandler);
        }

        private function cancelHandler(event:Event):void {
            trace("cancelHandler: " + event);
        }

        private function completeHandler(event:Event):void {
            trace("completeHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            var file:FileReference = FileReference(event.target);
            trace("progressHandler name=" + file.name + " bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function selectHandler(event:Event):void {
            var file:FileReference = FileReference(event.target);
            trace("selectHandler: name=" + file.name + " URL=" + downloadURL.url);
        }
    }
}
</codeblock></example></adobeApiEventDetail><related-links><link href="flash.net.xml#FileReference/download()"><linktext>FileReference.download()</linktext></link><link href="flash.net.xml#FileReference/upload()"><linktext>FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.Event.CANCEL_cancel"><apiName>cancel</apiName><shortdesc>
	Dispatched when a file upload or download is canceled through the file-browsing dialog 
    box by the user.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><maelexample>The following example traces a message if the user dismisses the file-
    browsing dialog box. This method
    is triggered only if the user selects Cancel or presses the escape key after
    the dialog box opens.
    
    <listing version="2.0">
    import flash.net.FileReference;
    
    var listener:Object = new Object();
    
    listener.onCancel = function(file:FileReference):void {
      trace("onCancel");
    }
    
    var fileRef:FileReference = new FileReference();
    fileRef.addListener(listener);
    var url:String = "http://www.adobe.com/platform/whitepapers/platform_overview.pdf";
    if(!fileRef.download(url, "FlashPlatform.pdf")) {
      trace("dialog box failed to open.");
    }
    </listing>
    
    </maelexample></asCustoms></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.CANCEL</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
	Dispatched when a file upload or download is canceled through the file-browsing dialog 
    box by the user. Flash Player does not dispatch this event if the user cancels an upload
    or download through other means (closing the browser or stopping the current 
    application).
    
    </apiDesc><example conref="examples\FileReference_event_cancel.as"> The following example shows usage of the <codeph>cancel</codeph> event object.
 To run this example, change the <codeph>downloadURL.url</codeph> property to point to an actual domain and file,
 rather than the fictional http://www.[yourDomain].com/SomeFile.pdf.
 You might also need to compile the SWF file with Local playback security set to Access network only
 or to update Flash Player security settings to allow this file network access.
<codeblock>

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.FileReference;
    import flash.net.URLRequest;

    public class FileReference_event_cancel extends Sprite {
        private var downloadURL:URLRequest;
        private var fileName:String = "SomeFile.pdf";
        private var file:FileReference;

        public function FileReference_event_cancel() {
            downloadURL = new URLRequest();
            downloadURL.url = "http://www.[yourDomain].com/SomeFile.pdf";
            file = new FileReference();
            file.addEventListener(Event.CANCEL, cancelHandler);
            file.download(downloadURL, fileName);
        }
        private function cancelHandler(event:Event):void {
            trace("cancelHandler: " + event);
        }
    }
}
</codeblock></example></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:FileReference:FileReference"><apiName>FileReference</apiName><shortdesc>
    Creates a new FileReference object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><maelexample>The following example creates a new <code>FileReference</code> object and 
    initiates the download of a pdf file.
    <listing version="2.0">
    import flash.net.FileReference;
    
    var listener:Object = new Object();
    listener.onComplete = function(file:FileReference) {
      trace("onComplete : " + file.name);
    }
    
    var url:String = "http://www.adobe.com/platform/whitepapers/platform_overview.pdf";
    var fileRef:FileReference = new FileReference();
    fileRef.addListener(listener);
    fileRef.download(url, "FlashPlatform.pdf");
    </listing>
    
    </maelexample></asCustoms></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/></apiConstructorDef><apiDesc>
    Creates a new FileReference object. When populated, a FileReference object represents a file
    on the user's local disk.
    
    </apiDesc></apiConstructorDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:FileReference:browse"><apiName>browse</apiName><shortdesc>
    Displays a file-browsing dialog box that lets the
    user select a file to upload.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>browse, FileReference.browse
  </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Thrown in the following situations:
  1) Another FileReference or FileReferenceList browse session is in 
  progress; only one file browsing session may be performed at a time.
  2) A setting in the user's mms.cfg file prohibits this operation.
  
  </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException><apiDesc>If the <codeph>typeFilter</codeph> array contains 
  FileFilter objects that are incorrectly formatted, an exception is thrown.
  For information on the correct format for FileFilter objects,
  see the <xref href="FileFilter.html">FileFilter</xref> class.
  
    </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiException><apiDesc>If the method is not called in response to a user action, such as a mouse
    event or keypress event.
    
    </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiReturn><apiDesc>Returns <codeph>true</codeph> if the parameters are valid and the file-browsing dialog box 
	opens.  
  
  </apiDesc><apiOperationClassifier>Boolean</apiOperationClassifier></apiReturn><apiParam><apiItemName>typeFilter</apiItemName><apiOperationClassifier>Array</apiOperationClassifier><apiData>null</apiData><apiDesc>An array of FileFilter instances used to filter the files that are 
    displayed in the dialog box. If you omit this parameter,
    all files are displayed. 
    For more information, see the <xref href="FileFilter.html">FileFilter</xref> class.
    
    
    </apiDesc></apiParam></apiOperationDef><apiDesc>
    Displays a file-browsing dialog box that lets the
    user select a file to upload. The dialog box is native to the user's 
    operating system. The user can select a file on the local computer
    or from other systems, for example, through a UNC path on Windows.
    
    <p><b>Note:</b> The File class, available in Adobe AIR, includes methods for
    accessing more specific system file selection dialog boxes. These methods are
    <codeph>File.browseForDirectory()</codeph>, <codeph>File.browseForOpen()</codeph>,
    <codeph>File.browseForOpenMultiple()</codeph>, and <codeph>File.browseForSave()</codeph>.</p>
    
    <p>When you call this method and the user
    successfully selects a file, the properties of this FileReference object are populated with 
    the properties of that file. Each subsequent time that the <codeph>FileReference.browse()</codeph> methodsdq
    is called, the FileReference
    object's properties are reset to the file that the user selects in the dialog box.
    Only one <codeph>browse()</codeph> or <codeph>download()</codeph> session
    can be performed at a time (because only one dialog box can be invoked at a time).</p>
    
    <p>Using the <codeph>typeFilter</codeph> parameter, you can determine which files the dialog box displays.</p>
    
    <p platform="actionscript">In Flash Player 10 and Flash Player 9 Update 5, you can only call this method successfully in response
    to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling
    this method results in Flash Player throwing an Error exception.</p>
    
    <p platform="actionscript">Note that because of new functionality added to the Flash Player, when publishing to Flash Player 10, you can have
    only one of the following operations active at one time: <codeph>FileReference.browse()</codeph>, 
    <codeph>FileReference.upload()</codeph>, <codeph>FileReference.download()</codeph>, <codeph>FileReference.load()</codeph>,
    <codeph>FileReference.save()</codeph>. Otherwise, Flash Player throws a runtime error (code 2174). Use <codeph>FileReference.cancel()</codeph>
    to stop an operation in progress. This restriction applies only to Flash Player 10. Previous versions of Flash Player
    are unaffected by this restriction on simultaneous multiple operations.</p> 
    
  </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#FileReferenceList/event:select"><linktext>select event</linktext></link><link href="flash.net.xml#FileReference/event:cancel"><linktext>cancel event</linktext></link><link href="flash.net.xml#FileReference/download()"><linktext>FileReference.download()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()"><linktext>FileReferenceList.browse()</linktext></link><link href="" invalidHref="flash.filesystem.File.browseForDirectory().xml"><linktext>File.browseForDirectory()</linktext></link><link href="" invalidHref="flash.filesystem.File.browseForOpen().xml"><linktext>File.browseForOpen()</linktext></link><link href="" invalidHref="flash.filesystem.File.browseForOpenMultiple().xml"><linktext>File.browseForOpenMultiple()</linktext></link><link href="" invalidHref="flash.filesystem.File.browseForSave().xml"><linktext>File.browseForSave()</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:browse_select"><apiName>select</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the user successfully selects an item from the Browse file chooser.
  </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the user successfully selects an item from the Browse file chooser.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:browse_cancel"><apiName>cancel</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the user cancels the file upload Browse window.
  
  </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the user cancels the file upload Browse window.</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:FileReference:cancel"><apiName>cancel</apiName><shortdesc>
  Cancels any ongoing upload or download operation on this FileReference object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>cancel, FileReference.cancel
  </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiTipTexts><apiTipText>Cancels any ongoing upload or download.
  </apiTipText></apiTipTexts></apiOperationDef><apiDesc>
  Cancels any ongoing upload or download operation on this FileReference object.
  Calling this method does not dispatch the <codeph>cancel</codeph> event; that event
  is dispatched only when the user cancels the operation by dismissing the 
  file upload or download dialog box.
  
    </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:FileReference:download"><apiName>download</apiName><shortdesc>
    Opens a dialog box that lets the user download a file from a remote server.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Thrown in the following situations: 1) Another browse session is in 
    progress; only one file browsing session can be performed at a time. 
    2) The value passed to <codeph>request</codeph> does not contain
    a valid path or protocol.
    3) The filename to download contains prohibited characters.
    4) A setting in the user's mms.cfg file prohibits this operation.
    
    	</apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException><apiDesc>Local untrusted content may not communicate with the Internet. To avoid this situation, reclassify this
    SWF file as local-with-networking or trusted. This exception is thrown with a message indicating the filename
    and the URL that may not be accessed because of local file security restrictions.
    
     </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>If you are trying to connect to a commonly reserved port. 
     For a complete list of blocked ports, see "Restricting Networking APIs" in the 
     security chapter of the <i>Programming ActionScript 3.0</i> book.
    
    </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>If <codeph>url.data</codeph> is of type ByteArray, an exception is
    thrown. For use with the <codeph>FileReference.upload()</codeph> and
    <codeph>FileReference.download()</codeph> methods, <codeph>url.data</codeph> can only be of type
    URLVariables or String.
    
    </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiException><apiDesc>This error can occur for the following reasons:
    1) Flash Player cannot convert the <codeph>URLRequest.data</codeph>
    parameter from UTF8 to MBCS. This error is applicable if the URLRequest object
    passed to the <codeph>FileReference.download()</codeph> method is set to perform a GET operation and if
    <codeph>System.useCodePage</codeph> is set to <codeph>true</codeph>.
    2) Flash Player cannot allocate memory for the <codeph>POST</codeph> data. This error is
    applicable if the URLRequest object passed to the <codeph>FileReference.download()</codeph> method is set
    to perform a <codeph>POST</codeph> operation.
    
    </apiDesc><apiItemName>MemoryError</apiItemName><apiOperationClassifier>flash.errors:MemoryError</apiOperationClassifier></apiException><apiException><apiDesc>If the method is not called in response to a user action, such as a mouse
    event or keypress event.
    
    </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>request</apiItemName><apiOperationClassifier>flash.net:URLRequest</apiOperationClassifier><apiDesc>The URLRequest object. The <codeph>url</codeph> property of the URLRequest object
    should contain the URL of the file to download to the local computer. 
    If this parameter is <codeph>null</codeph>, an exception is thrown. The <codeph>requestHeaders</codeph> property
    of the URLRequest object is ignored; custom HTTP request headers are not supported in uploads or downloads.
    
    To send <codeph>POST</codeph> or GET parameters to the server, set the value of <codeph>URLRequest.data</codeph>
    to your parameters, and set <codeph>URLRequest.method</codeph> to either <codeph>URLRequestMethod.POST</codeph>
    or <codeph>URLRequestMethod.GET</codeph>.
    
    	<p platform="actionscript">On some browsers, URL strings are limited in length. Lengths greater than 256 characters may 
		fail on some browsers or servers.</p>
    
    </apiDesc></apiParam><apiParam><apiItemName>defaultFileName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>The default filename displayed in the dialog box for the file 
    to be downloaded. This string must not contain the following characters:
    / \ : ~~ ? " &lt; &gt; | %
    <p>If you omit this parameter, the filename of the
    remote URL is parsed and used as the default. </p>
    
    </apiDesc></apiParam></apiOperationDef><apiDesc>
    Opens a dialog box that lets the user download a file from a remote server. 
    	<ph platform="actionscript">Although Flash Player has no restriction on the size of files you can upload or download,
    	the player officially supports uploads or downloads of up to 100 MB.</ph>
    
    <p>The <codeph>download()</codeph> method first opens
    an operating-system dialog box that asks the user to enter a filename and 
    select a location on the local computer
    to save the file. When the user selects a location and confirms the download operation 
    (for example, by clicking Save), the download from the remote server begins. 
    Listeners receive events to indicate the progress, success, or
    failure of the download. 
    To ascertain the status of the dialog box and the download operation after calling 
    	<codeph>download()</codeph>, your code must listen for events 
    such as <codeph>cancel</codeph>, <codeph>open</codeph>,
    <codeph>progress</codeph>, and <codeph>complete</codeph>.
    </p>
    
    <p>The <codeph>FileReference.upload()</codeph> and <codeph>FileReference.download()</codeph> functions
    are nonblocking. These functions return after they are called, before the file transmission
    is complete. In addition, if the FileReference object goes out of scope, any upload or download
    that is not yet completed on that object is canceled upon leaving the scope. 
    Be sure that your FileReference object remains in scope for as long as the 
    upload or download is expected to continue.</p>
    
    <p>When the file is downloaded successfully, the
    properties of the FileReference object are populated with the properties
    of the local file. The <codeph>complete</codeph> event is dispatched if the
    download is successful.</p>
    
    <p>Only one <codeph>browse()</codeph> or <codeph>download()</codeph> session can
    be performed at a time (because only one dialog box can be invoked at a time).</p>
    
    <p>This method supports downloading of any file type, with either HTTP or HTTPS.</p>
    
     <p>You cannot connect to commonly reserved ports. For a complete list of blocked
    ports, see "Restricting Networking APIs" in the 
    <ph product="flex">
    <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
    </ph>
    <ph product="flash">
    <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
    </ph>
     of the <i>Programming ActionScript 3.0</i> book.</p>
    
    <p><b>Note</b>: If your server requires user authentication, only  
    SWF files running in a browser — that is, using the browser plug-in or ActiveX control —
    can provide a dialog box to prompt the user for a user name and password for authentication,
    and only for downloads. For uploads using the plug-in or ActiveX control, or for
    uploads and downloads using the stand-alone or external player, the file transfer fails.</p>
    
    <p>When you use this method <ph platform="javascript">in content in security sandboxes other
    than the application security sandbox</ph>, consider the <ph platform="actionscript">Flash Player</ph>
    <ph platform="javascript">AIR</ph> security model: </p>
    
    <ul>
    <li>Loading operations are not allowed if the calling SWF file is in an untrusted local sandbox.</li>
    
    <li>The default behavior is to deny access between sandboxes. A website can enable access to a 
    resource by adding a URL policy file.</li>
    
    <li platform="actionscript">You can prevent a SWF file from using this method by setting the  <codeph>allowNetworking</codeph> 
    parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> tags in the HTML 
    page that contains the SWF content.</li>
    
    <li platform="actionscript">In Flash Player 10 and Flash Player 9 Update 5, you can only call this method successfully in response
    to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling
    this method results in Flash Player throwing an Error exception.</li>
    
    </ul>
    
    <p>However, <ph platform="actionscript">in Adobe AIR,</ph>
    content in the <codeph>application</codeph> security sandbox (content
    installed with the AIR application) is not restricted by these security limitations.</p>
    
    <p>For more information related to security, see the following:</p>
    
    <ul>
           
    <li product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref> in the 
    <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
    
    <li product="flash">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref> in the 
    <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
    
    <li>The "Understanding AIR Security" section of the "Getting started with Adobe AIR" chapter
    in the <i>Developing AIR Applications</i> book.</li>
    
    <li>The Flash Player Developer Center Topic: 
    <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
    
    </ul>
    
    <p>Note that because of new functionality added to the Flash Player, when publishing to Flash Player 10, you can have
    only one of the following operations active at one time: <codeph>FileReference.browse()</codeph>, 
    <codeph>FileReference.upload()</codeph>, <codeph>FileReference.download()</codeph>, <codeph>FileReference.load()</codeph>,
    <codeph>FileReference.save()</codeph>. Otherwise, Flash Player throws a runtime error (code 2174). Use <codeph>FileReference.cancel()</codeph>
    to stop an operation in progress. This restriction applies only to Flash Player 10. Previous versions of Flash Player
    are unaffected by this restriction on simultaneous multiple operations.</p> 
	
    </apiDesc><example conref="examples\FileReference_download.as"> The following example shows usage of the <codeph>download</codeph> event object.
 To run this example, change the <codeph>downloadURL.url</codeph> property to point to an actual domain and file,
 rather than the fictional http://www.[yourDomain].com/SomeFile.pdf.
 You might also need to compile the SWF file with Local playback security set to Access network only
 or to update Flash Player security settings to allow this file network access.
<codeblock>

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.FileReference;
    import flash.net.URLRequest;
    import flash.net.FileFilter;

    public class FileReference_download extends Sprite {
        private var downloadURL:URLRequest;
        private var fileName:String = "SomeFile.pdf";
        private var file:FileReference;

        public function FileReference_download() {
            downloadURL = new URLRequest();
            downloadURL.url = "http://www.[yourDomain].com/SomeFile.pdf";
            file = new FileReference();
            configureListeners(file);
            file.download(downloadURL, fileName);
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.CANCEL, cancelHandler);
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(Event.SELECT, selectHandler);
        }

        private function cancelHandler(event:Event):void {
            trace("cancelHandler: " + event);
        }

        private function completeHandler(event:Event):void {
            trace("completeHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            var file:FileReference = FileReference(event.target);
            trace("progressHandler name=" + file.name + " bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function selectHandler(event:Event):void {
            var file:FileReference = FileReference(event.target);
            trace("selectHandler: name=" + file.name + " URL=" + downloadURL.url);
        }
    }
}
</codeblock></example></apiOperationDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()"><linktext>FileReferenceList.browse()</linktext></link><link href="flash.net.xml#FileReference/upload()"><linktext>FileReference.upload()</linktext></link><link href="flash.net.xml#FileReference/save()"><linktext>FileReference.save()</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:download_open"><apiName>open</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when a download operation starts.
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when a download operation starts.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_progress"><apiName>progress</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched periodically during the file download operation.
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched periodically during the file download operation.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_complete"><apiName>complete</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the file download operation successfully completes.
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the file download operation successfully completes.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_cancel"><apiName>cancel</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the user dismisses the dialog box.
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the user dismisses the dialog box.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_select"><apiName>select</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the user selects a file for download from the dialog box. 
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the user selects a file for download from the dialog box.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when a download fails because of a
    security error.
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when a download fails because of a
    security error.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_ioError"><apiName>ioError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched for any of the following reasons:
    <ul>
    <li>An input/output error occurs while the file is being read or transmitted.</li>
    	<li>SWF content running in the stand-alone or external versions of Flash Player tries to download a 
		file from a server that requires authentication. During download, the standalone and external players
    do not provide a means for users to enter passwords. If a SWF file in these players tries to download
    a file from a server that requires authentication, the download fails. 
    File download can succeed only in the ActiveX control and browser plug-in players.</li>
    </ul>
    
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched for any of the following reasons:
    
    An input/output error occurs while the file is being read or transmitted.
    	SWF content running in the stand-alone or external versions of Flash Player tries to download a 
		file from a server that requires authentication.</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:FileReference:load"><apiName>load</apiName><shortdesc>
    Starts the load of a local file selected by a user.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata><asCustoms><keyword>load, FileReference.load
    </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Thrown in the following situations: 1) Another FileReference or
    FileReferenceList browse session is in progress; only one file browsing session may be performed
    at a time.
    2) A setting in the user's mms.cfg file prohibits this operation.
    
    </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException><apiDesc>This error can occur if the application cannot allocate memory for the file.
    The file may be too large or available memory may be too low.
    
    </apiDesc><apiItemName>MemoryError</apiItemName><apiOperationClassifier>flash.errors:MemoryError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiTipTexts><apiTipText>Starts the load of a local file.
    
    </apiTipText></apiTipTexts></apiOperationDef><apiDesc>
    Starts the load of a local file selected by a user. 
    <ph platform="actionscript">Although Flash Player has no restriction on the size of files you can upload, 
    download, load or save, it officially supports sizes of up to 100 MB. For content running in Flash Player,
    you must call the <codeph>FileReference.browse()</codeph> or <codeph>FileReferenceList.browse()</codeph> method before 
    you call the <codeph>load()</codeph> method. However, content running in AIR in the application sandbox can call
    the <codeph>load()</codeph> method of a File object without first calling the <codeph>browse()</codeph> method. 
    (The AIR File class extends the FileReference class.)</ph>
    
    <p>Listeners receive events to indicate the progress, success, or
    failure of the load. Although you can use the FileReferenceList object to let users 
    select multiple files to load, you must load the files one by one. To load the files
    one by one, iterate through the <codeph>FileReferenceList.fileList</codeph> array of FileReference objects.</p>
    
    <p>Adobe AIR also includes the FileStream class which provides more options for 
    reading files.</p>
    
    <p>The <codeph>FileReference.upload()</codeph>, <codeph>FileReference.download()</codeph>, <codeph>FileReference.load()</codeph>
    and <codeph>FileReference.save()</codeph> functions
    are nonblocking. These functions return after they are called, before the file transmission
    is complete. In addition, if the FileReference object goes out of scope, any transaction
    that is not yet completed on that object is canceled upon leaving the scope. 
    Be sure that your FileReference object remains in scope for as long as the 
    upload, download, load or save is expected to continue.</p>
    
    <p>If the file finishes loading successfully, its contents are stored as a byte array
    in the <codeph>data</codeph> property of the FileReference object.</p>
    
    <p platform="actionscript">The following security considerations apply:</p>
    
    <ul platform="actionscript">
    <li>Loading operations are not allowed if the calling SWF file is in an untrusted local sandbox.</li>
    <li>The default behavior is to deny access between sandboxes. A website can enable access to a 
       resource by adding a cross-domain policy file.</li>
    <li>You can prevent a file from using this method by setting the  <codeph>allowNetworking</codeph> 
    parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> tags in the HTML 
    page that contains the SWF content.</li>
    </ul>
    
    <p platform="actionscript">However, these considerations do not apply to AIR content in the application sandbox.</p>
    
    <p>Note that when publishing to Flash Player 10 or AIR 1.5, you can have only one of the following operations active at one time: 
    <codeph>FileReference.browse()</codeph>, <codeph>FileReference.upload()</codeph>, <codeph>FileReference.download()</codeph>, <codeph>FileReference.load()</codeph>,
    <codeph>FileReference.save()</codeph>. Otherwise, the application throws a runtime error (code 2174). Use <codeph>FileReference.cancel()</codeph>
    to stop an operation in progress. This restriction applies only to Flash Player 10 and AIR 1.5. Previous versions of Flash Player
    or AIR are unaffected by this restriction on simultaneous multiple operations.</p>
    
    </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()"><linktext>FileReferenceList.browse()</linktext></link><link href="flash.net.xml#FileReference/data"><linktext>FileReference.data</linktext></link><link href="flash.net.xml#FileReferenceList/fileList"><linktext>FileReferenceList.fileList</linktext></link><link href="flash.net.xml#FileReference/save()"><linktext>FileReference.save()</linktext></link><link href="flash.filesystem.xml#FileStream"><linktext>flash.filesystem.FileStream</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:load_open"><apiName>open</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when an load operation starts.
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when an load operation starts.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:load_progress"><apiName>progress</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched periodically during the file load operation.
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched periodically during the file load operation.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:load_complete"><apiName>complete</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the file load operation completes successfully.
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the file load operation completes successfully.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:load_ioError"><apiName>ioError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Invoked if the load fails because of an input/output error while the application
    is reading or writing the file.
    
    </apiDesc></adobeApiEventDetail><shortdesc>Invoked if the load fails because of an input/output error while the application
    is reading or writing the file.</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:FileReference:save"><apiName>save</apiName><shortdesc>
    Opens a dialog box that lets the user save a file to the local filesystem.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Thrown in the following situations: 1) Another browse session is in 
    progress; only one file browsing session can be performed at a time. 
	2) The filename to download contains prohibited characters.
    3) A setting in the user's mms.cfg file prohibits this operation.
    
    </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException><apiDesc>If <codeph>data</codeph> is not of type ByteArray, and it does not
    have a <codeph>toString()</codeph> method, an exception is thrown.  If <codeph>data</codeph> is
    not of type XML, and it does not have a <codeph>toXMLString()</codeph> method, an exception is thrown.
    
    </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiException><apiDesc>If the method is not called in response to a user action, such as a mouse
    event or keypress event.
    
    </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiException><apiDesc>This error can occur if Flash Player cannot allocate memory for the file.
    The file may be too large or available memory may be too low.
    
    </apiDesc><apiItemName>MemoryError</apiItemName><apiOperationClassifier>flash.errors:MemoryError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>data</apiItemName><apiType value=""/><apiDesc>The data to be saved. The data can be in one of several formats, and will be treated
    appropriately:
    <ul>
    <li>If the value is <codeph>null</codeph>, the application throws an ArgumentError exception.</li> 
    <li>If the value is a String, it is saved as a UTF-8 text file.</li>
    <li platform="actionscript">If the value is XML, it is written to a text file in XML format, with all formatting preserved.</li> 
    <li>If the value is a ByteArray object, it is written to a data file verbatim.</li> 
    <li>If the value is none of the above, the <codeph>save()</codeph> method calls the <codeph>toString()</codeph> method of the 
    object to convert the data to a string, and it then saves the data as a text file. If that fails, the application throws 
    an ArgumentError exception.</li> 
    </ul>
    
    </apiDesc></apiParam><apiParam><apiItemName>defaultFileName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>The default filename displayed in the dialog box for the file 
    to be saved. This string must not contain the following characters:
	/ \ : ~~ ? " &lt; &gt; | %
    <p><ph platform="javascript">In Flash Player, if you omit this parameter, the filename will be blank by default.</ph>
    If a File object calls this method, the filename will be that of the file the File object references. (The AIR File class
    extends the FileReference class.)</p>
    
	</apiDesc></apiParam></apiOperationDef><apiDesc>
    Opens a dialog box that lets the user save a file to the local filesystem. 
    <ph platform="actionscript">Although Flash Player has no restriction on 
    the size of files you can upload, download, load or save,
    the player officially supports sizes of up to 100 MB.</ph>
    
    <p>The <codeph>save()</codeph> method first opens
    an operating-system dialog box that asks the user to enter a filename and 
    select a location on the local computer
    to save the file. When the user selects a location and confirms the save operation 
    (for example, by clicking Save), the save process begins. 
    Listeners receive events to indicate the progress, success, or
    failure of the save operation. 
    To ascertain the status of the dialog box and the save operation after calling 
    <codeph>save()</codeph>, your code must listen for events 
    such as <codeph>cancel</codeph>, <codeph>open</codeph>,
    <codeph>progress</codeph>, and <codeph>complete</codeph>.
    </p>
    
    <p>Adobe AIR also includes the FileStream class which provides more options for 
    saving files locally.</p>
    
    <p>The <codeph>FileReference.upload()</codeph>, <codeph>FileReference.download()</codeph>, <codeph>FileReference.load()</codeph>
    and <codeph>FileReference.save()</codeph> functions
    are nonblocking. These functions return after they are called, before the file transmission
    is complete. In addition, if the FileReference object goes out of scope, any transaction
    that is not yet completed on that object is canceled upon leaving the scope. 
    Be sure that your FileReference object remains in scope for as long as the 
    upload, download, load or save is expected to continue.</p>
    
    <p>When the file is saved successfully, the
    properties of the FileReference object are populated with the properties
    of the local file. The <codeph>complete</codeph> event is dispatched if the
    save is successful.</p>
    
    <p>Only one <codeph>browse()</codeph> or <codeph>save()</codeph> session can
    be performed at a time (because only one dialog box can be invoked at a time).</p>
    
    <p platform="actionscript">In Flash Player, you can only call this method successfully in response to  
    a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling
    this method results in Flash Player throwing an Error exception. This limitation does not apply to
    AIR content in the application sandbox.</p>
    
    </apiDesc><example conref="examples\FileReference_save.as"> The following example saves the content typed into a text field to a file.
 The example creates an editable text field (<codeph>MyTextField</codeph>)
 and another text field that is not editable (<codeph>MyButtonField</codeph>)to serve as a "button"
 to respond to a mouse click. A user can edit the first text field and click the button
 to save the text field contents to a local file. The mouse click event handler <codeph>clickhandler</codeph>
 uses the <codeph>FileReference.save()</codeph> method (for a FileReference object named <codeph>MyFileReference</codeph>)
 to open a dialog on the user's current operating system so the user can save the contents to a local file with the
 name the user provides.
<codeblock>
var MyTextField:TextField = new TextField();
var MyButtonField:TextField = new TextField();
var MyFile:FileReference = new FileReference();

MyTextField.border = true;
MyTextField.type = TextFieldType.INPUT;

MyButtonField.background = true;
MyButtonField.backgroundColor = 0x339933;
MyButtonField.x = 150;
MyButtonField.height = 20;
MyButtonField.text = "Click here to save";

addChild(MyTextField);
addChild(MyButtonField);
MyButtonField.addEventListener(MouseEvent.CLICK, clickhandler);

function clickhandler(e:MouseEvent): void {
    MyFile.save(MyTextField.text);
}
</codeblock></example></apiOperationDetail><related-links><link href="flash.net.xml#FileReferenceList/browse()"><linktext>FileReferenceList.browse()</linktext></link><link href="flash.net.xml#FileReferenceList/load()"><linktext>FileReferenceList.load()</linktext></link><link href="flash.net.xml#FileReferenceList/data"><linktext>FileReferenceList.data</linktext></link><link href="flash.net.xml#FileReferenceList/upload"><linktext>FileReferenceList.upload</linktext></link><link href="flash.net.xml#FileReferenceList/download"><linktext>FileReferenceList.download</linktext></link><link href="flash.filesystem.xml#FileStream"><linktext>FileStream</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:save_open"><apiName>open</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when a download operation starts.
	</apiDesc></adobeApiEventDetail><shortdesc>Dispatched when a download operation starts.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:save_progress"><apiName>progress</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched periodically during the file download operation.
	</apiDesc></adobeApiEventDetail><shortdesc>Dispatched periodically during the file download operation.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:save_complete"><apiName>complete</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the file download operation successfully completes.
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the file download operation successfully completes.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:save_cancel"><apiName>cancel</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the user dismisses the dialog box.
	</apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the user dismisses the dialog box.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:save_select"><apiName>select</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the user selects a file for download from the dialog box. 
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the user selects a file for download from the dialog box.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:save_ioError"><apiName>ioError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched if an input/output error occurs while the file is being read or transmitted.
    
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched if an input/output error occurs while the file is being read or transmitted.</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:FileReference:upload"><apiName>upload</apiName><shortdesc>
    Starts the upload of a file selected by a user to a remote server.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>upload, FileReference.upload
    </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Local untrusted SWF files may not communicate with
    the Internet. To avoid this situation, reclassify this SWF file
    as local-with-networking or trusted. This exception is thrown with a message indicating the name of
    the local file and the URL that may not be accessed.
    
      </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>If you are trying to connect to a commonly reserved port. 
      For a complete list of blocked ports, see "Restricting Networking APIs" in the 
      security chapter of the <i>Programming ActionScript 3.0</i> book.
     
    </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>Thrown in the following situations: 1) Another FileReference or
    FileReferenceList browse session is in progress; only one file browsing session may be performed
    at a time.
    2) The URL parameter is not a valid path or protocol. File upload must use HTTP,
    and file download must use FTP or HTTP.
    3) The <codeph>uploadDataFieldName</codeph> parameter is set to <codeph>null</codeph>.
    4) A setting in the user's mms.cfg file prohibits this operation.
    
    </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException><apiDesc>Thrown in the following situations: 1) The <codeph>uploadDataFieldName</codeph>
    parameter is an empty string. 2) <codeph>url.data</codeph> is of type ByteArray. 
    For use with the <codeph>FileReference.upload()</codeph> and
    <codeph>FileReference.download()</codeph> methods, <codeph>url.data</codeph> may only be of type
    URLVariables or String. 3) In the AIR runtime (in the application security sandbox), the method of the 
    URLRequest is not GET or POST (use <codeph>uploadEncoded()</codeph> instead).
    
    </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiException><apiDesc>This error can occur for the following reasons:
    1) Flash Player cannot convert the <codeph>URLRequest.data</codeph>
    parameter from UTF8 to MBCS. This error is applicable if the URLRequest object
    passed to <codeph>FileReference.upload()</codeph> is set to perform a GET operation and if
    <codeph>System.useCodePage</codeph> is set to <codeph>true</codeph>.
    2) Flash Player cannot allocate memory for the <codeph>POST</codeph> data. This error is
    applicable if the URLRequest object passed to <codeph>FileReference.upload()</codeph> is set
    to perform a <codeph>POST</codeph> operation.
    
    </apiDesc><apiItemName>MemoryError</apiItemName><apiOperationClassifier>flash.errors:MemoryError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>request</apiItemName><apiOperationClassifier>flash.net:URLRequest</apiOperationClassifier><apiDesc>The URLRequest object; the <codeph>url</codeph> property of the URLRequest object
    should contain the URL of the server script
    configured to handle upload through HTTP <codeph>POST</codeph> calls.
    On some browsers, URL strings are limited in length. 
    Lengths greater than 256 characters may fail on some browsers or servers.
    If this parameter is <codeph>null</codeph>, an exception is thrown. The <codeph>requestHeaders</codeph> property
    of the URLRequest object is ignored; custom HTTP request headers are not supported in uploads or downloads.
     
    <p>The URL can be HTTP or, for secure uploads, HTTPS. 
    To use HTTPS, use an HTTPS url in the <codeph>url</codeph> parameter.
    If you do not specify a port number in the <codeph>url</codeph>
	parameter, port 80 is used for HTTP and port 443 us used for HTTPS, by default.</p>
    
    <p>To send <codeph>POST</codeph> or <codeph>GET</codeph> parameters to the server, set the <codeph>data</codeph> property
    of the URLRequest object to your parameters, and set the <codeph>method</codeph> property 
    to either <codeph>URLRequestMethod.POST</codeph> or
    <codeph>URLRequestMethod.GET</codeph>.</p>
    
    
    </apiDesc></apiParam><apiParam><apiItemName>uploadDataFieldName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>Filedata</apiData><apiDesc>The field name that precedes the file data in the upload <codeph>POST</codeph> operation.
    The <codeph>uploadDataFieldName</codeph> value must be non-null and a non-empty String.
    By default, the value of <codeph>uploadDataFieldName</codeph> is <codeph>"Filedata"</codeph>,
    as shown in the following sample <codeph>POST</codeph> request:
    <pre>
    Content-Type: multipart/form-data; boundary=AaB03x
    --AaB03x 
    Content-Disposition: form-data; name="Filedata"; filename="example.jpg" 
    Content-Type: application/octet-stream
    ... contents of example.jpg ... 
    --AaB03x-- 
    </pre>
    
    </apiDesc></apiParam><apiParam><apiItemName>testUpload</apiItemName><apiOperationClassifier>Boolean</apiOperationClassifier><apiData>false</apiData><apiDesc>A setting to request a test file upload. If <codeph>testUpload</codeph>
    is <codeph>true</codeph>, for files larger than 10 KB, Flash Player attempts
    a test file upload <codeph>POST</codeph> with a Content-Length of 0. The test upload
    checks whether the actual file upload will be successful and that server
    authentication, if required, will succeed. A test upload 
    is only available for Windows players.
    
    
    </apiDesc></apiParam><apiTipTexts><apiTipText>Starts the upload of a file to a remote server.
    
    </apiTipText></apiTipTexts></apiOperationDef><apiDesc>
    Starts the upload of a file selected by a user to a remote server. <ph platform="actionscript">Although 
	Flash Player has no restriction on the size of files you can upload or download,
	the player officially supports uploads or downloads of up to 100 MB.</ph>
    You must call the <codeph>FileReference.browse()</codeph> or <codeph>FileReferenceList.browse()</codeph>
    method before you call this method.
    
    <p>Listeners receive events to indicate the progress, success, or
    failure of the upload. Although you can use the FileReferenceList object to let users 
    select multiple files for upload, you must upload the files one by one; to do so, iterate through
    the <codeph>FileReferenceList.fileList</codeph> array of FileReference objects.</p>
    
    <p>The <codeph>FileReference.upload()</codeph> and <codeph>FileReference.download()</codeph> functions
    are nonblocking. These functions return after they are called, before the file transmission
    is complete. In addition, if the FileReference object goes out of scope, any upload or download
    that is not yet completed on that object is canceled upon leaving the scope. 
    Be sure that your FileReference object remains in scope for as long as the 
    upload or download is expected to continue.</p>
    
    <p>The file is uploaded to the URL passed in the <codeph>url</codeph> parameter. The URL 
    must be a server script configured to accept uploads. Flash Player uploads files by using 
    the HTTP <codeph>POST</codeph> method. The server script that handles the upload
    should expect a <codeph>POST</codeph> request with the following elements:</p>
    <ul>
    <li><codeph>Content-Type</codeph> of <codeph>multipart/form-data</codeph></li>
    <li><codeph>Content-Disposition</codeph> with a <codeph>name</codeph> attribute set to <codeph>"Filedata"</codeph> by default
    and a <codeph>filename</codeph> attribute set to the name of the original file</li>
    <li>The binary contents of the file</li></ul>
    
     <p>You cannot connect to commonly reserved ports. For a complete list of blocked
    ports, see "Restricting Networking APIs" in the 
    <ph product="flex">
    <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
    </ph>
    <ph product="flash">
    <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
    </ph>
     of the <i>Programming ActionScript 3.0</i> book.</p>
    
    <p>For a sample <codeph>POST</codeph> request, see the description of the <codeph>uploadDataFieldName</codeph>
    parameter. You can send <codeph>POST</codeph> or <codeph>GET</codeph> parameters to the server with the <codeph>upload()</codeph>
    method; see the description of the <codeph>request</codeph> parameter.</p>
    
    <p>If the <codeph>testUpload</codeph> parameter is <codeph>true</codeph>, 
    and the file to be uploaded is bigger than approximately 10 KB, Flash Player on Windows
    first sends a test upload <codeph>POST</codeph> operation with zero content before uploading the actual file,
    to verify that the transmission is likely to succeed. Flash Player then sends 
    a second <codeph>POST</codeph> operation that contains the actual file content. 
    For files smaller than 10 KB, Flash Player performs a single
    upload <codeph>POST</codeph> with the actual file content to be uploaded. 
    Flash Player on Macintosh does not perform test upload <codeph>POST</codeph> operations.</p>
    
    <p><b>Note</b>: If your server requires user authentication, only  
    SWF files running in a browser — that is, using the browser plug-in or ActiveX control —
    can provide a dialog box to prompt the user for a username and password for authentication,
    and only for downloads. For uploads using the plug-in or ActiveX control, or for
    uploads and downloads using the stand-alone or external player, the file transfer fails.</p>
    
    <p>When you use this method <ph platform="javascript">in content in security sandboxes other
    than the application security sandbox</ph>, consider the <ph platform="actionscript">Flash Player</ph>
    <ph platform="javascript">AIR</ph> security model: </p>
    
    
    <ul>
    <li>Loading operations are not allowed if the calling SWF file is in an untrusted local sandbox.</li>
    
    <li>The default behavior is to deny access between sandboxes. A website can enable access to a 
    resource by adding a URL policy file.</li>
    
	<li platform="actionscript">You can prevent a SWF file from using this method by setting the  <codeph>allowNetworking</codeph> 
    parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> tags in the HTML 
    page that contains the SWF content.</li>
    
    </ul>
    
    <p>However, in Adobe AIR, content in the <codeph>application</codeph> 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 product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref> in the 
    <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
    
    <li class="flashonly">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
    in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
    
    <li>The "Understanding AIR Security" section of the "Getting started with Adobe AIR" chapter
    in the <i>Developing AIR Applications</i> book.</li>
    
    <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
    </ul>
    <p>Note that because of new functionality added to the Flash Player, when publishing to Flash Player 10, you can have
    only one of the following operations active at one time: <codeph>FileReference.browse()</codeph>, 
    <codeph>FileReference.upload()</codeph>, <codeph>FileReference.download()</codeph>, <codeph>FileReference.load()</codeph>,
    <codeph>FileReference.save()</codeph>. Otherwise, Flash Player throws a runtime error (code 2174). Use <codeph>FileReference.cancel()</codeph>
    to stop an operation in progress. This restriction applies only to Flash Player 10. Previous versions of Flash Player
    are unaffected by this restriction on simultaneous multiple operations.</p>
    
    </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()"><linktext>FileReferenceList.browse()</linktext></link><link href="flash.net.xml#FileReference/download()"><linktext>FileReference.download()</linktext></link><link href="flash.net.xml#FileReferenceList/fileList"><linktext>FileReferenceList.fileList</linktext></link><link href="flash.net.xml#FileReference/load()"><linktext>FileReference.load()</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:upload_open"><apiName>open</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when an upload operation starts.
	
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when an upload operation starts.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_progress"><apiName>progress</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched periodically during the file upload operation.
	
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched periodically during the file upload operation.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_complete"><apiName>complete</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the file upload operation completes successfully.
	
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the file upload operation completes successfully.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_uploadCompleteData"><apiName>uploadCompleteData</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:DataEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when data has been received from the server after a successful file upload.
	
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when data has been received from the server after a successful file upload.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when an upload fails because of a
    security violation.
	
    </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when an upload fails because of a
    security violation.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_httpStatus"><apiName>httpStatus</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when an upload fails because of an HTTP error.
	
 	</apiDesc></adobeApiEventDetail><shortdesc>Dispatched when an upload fails because of an HTTP error.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_httpResponseStatus"><apiName>httpResponseStatus</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>The upload operation completes successfully and the server 
	returns a response URL and response headers.
	
    </apiDesc></adobeApiEventDetail><shortdesc>The upload operation completes successfully and the server 
	returns a response URL and response headers.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_ioError"><apiName>ioError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Invoked in any of the following situations:
    <ul>
    <li>The upload fails because of an input/output error while <ph platform="actionscript">Flash 
    Player or</ph> Adobe AIR is reading, writing, or transmitting the file.</li>
    <li>The upload fails because an attempt to upload a file to a server that requires 
	authentication (such as a user name and password). During upload, no mean is provided
    for users to enter passwords.</li>
    <li>The upload fails because the <codeph>url</codeph> parameter contains an invalid protocol.
    <codeph>FileReference.upload()</codeph> must use HTTP or HTTPS.</li>
    
    </ul>
    
    </apiDesc></adobeApiEventDetail><shortdesc>Invoked in any of the following situations:
    
    The upload fails because of an input/output error while Flash 
    Player or Adobe AIR is reading, writing, or transmitting the file.
    The upload fails because an attempt to upload a file to a server that requires 
	authentication (such as a user name and password).</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:FileReference:uploadUnencoded"><apiName>uploadUnencoded</apiName><shortdesc>
    Initiate uploading a file to a URL without any encoding.</shortdesc><prolog><asMetadata><apiVersion><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Local untrusted SWF files may not communicate with
	the Internet. To avoid this situation, reclassify this SWF file
	as local-with-networking or trusted. This exception is thrown with a message indicating the name of
	the local file and the URL that may not be accessed.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>Thrown in the following situations: 1) Another FileReference or FileReferenceList 
	browse session is in progress; only one file browsing session may be performed at a time. 2) The URL parameter 
	is not a valid path or protocol. File upload must use HTTP.
	
    </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>request</apiItemName><apiOperationClassifier>flash.net:URLRequest</apiOperationClassifier><apiDesc>The URLRequest object; the <codeph>url</codeph> property of the URLRequest object
	should contain the URL of the server script
	configured to handle upload through HTTP <codeph>POST</codeph> calls.
	On some browsers, URL strings are limited in length. 
	Lengths greater than 256 characters may fail on some browsers or servers.
	If this parameter is <codeph>null</codeph>, an exception is thrown.  
	 
	<p>The URL can be HTTP or, for secure uploads, HTTPS. 
	To use HTTPS, use an HTTPS url in the <codeph>url</codeph> parameter.
	If you do not specify a port number in the <codeph>url</codeph>
	parameter, port 80 is used for HTTP and port 443 us used for HTTPS, by default.</p>
	
	<p>To send <codeph>POST</codeph> or <codeph>GET</codeph> parameters to the server, set the <codeph>data</codeph> property
	of the URLRequest object to your parameters, and set the <codeph>method</codeph> property 
	to either <codeph>URLRequestMethod.POST</codeph> or
   	<codeph>URLRequestMethod.GET</codeph>.</p>
   	
    </apiDesc></apiParam><apiTipTexts><apiTipText>Starts the upload of a file to a remote server without encoding. 
    
    </apiTipText></apiTipTexts></apiOperationDef><apiDesc>
    Initiate uploading a file to a URL without any encoding. Whereas the <codeph>upload()</codeph> method encodes 
	the file in a form-data envelope, the <codeph>uploadUnencoded()</codeph> method passes the file contents as-is
	in the HTTP request body. Use the uploadUnencoded() method if the data you wish to send is already encoded
	in a format that the receiving server can understand.You typically use the <codeph>uploadeUnencoded()</codeph> 
	method with the <codeph>HTTP/WebDAV PUT</codeph> method.
	
	</apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()"><linktext>FileReferenceList.browse()</linktext></link><link href="flash.net.xml#FileReference/download()"><linktext>FileReference.download()</linktext></link><link href="flash.net.xml#FileReferenceList/fileList"><linktext>FileReferenceList.fileList</linktext></link><link href="flash.net.xml#FileReference/upload()"><linktext>upload()</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_open"><apiName>open</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when an upload operation starts.
	
	</apiDesc></adobeApiEventDetail><shortdesc>Dispatched when an upload operation starts.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_progress"><apiName>progress</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched periodically during the file upload operation.
	
	</apiDesc></adobeApiEventDetail><shortdesc>Dispatched periodically during the file upload operation.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_complete"><apiName>complete</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when the file upload operation completes successfully.
	
	</apiDesc></adobeApiEventDetail><shortdesc>Dispatched when the file upload operation completes successfully.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_uploadCompleteData"><apiName>uploadCompleteData</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:DataEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when data has been received from the server after a 
	successful file upload.
	
	</apiDesc></adobeApiEventDetail><shortdesc>Dispatched when data has been received from the server after a 
	successful file upload.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when an upload fails because of a
	security violation.
	
	</apiDesc></adobeApiEventDetail><shortdesc>Dispatched when an upload fails because of a
	security violation.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_httpStatus"><apiName>httpStatus</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when an upload fails because of an HTTP error.
	
 	</apiDesc></adobeApiEventDetail><shortdesc>Dispatched when an upload fails because of an HTTP error.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_httpResponseStatus"><apiName>httpResponseStatus</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>The upload operation completes successfully and the server 
	returns a response URL and response headers.
	
	</apiDesc></adobeApiEventDetail><shortdesc>The upload operation completes successfully and the server 
	returns a response URL and response headers.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_ioError"><apiName>ioError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Invoked in any of the following situations:
    <ul>
	<li>The upload fails because of an input/output error while Adobe AIR is reading, 
	writing, or transmitting the file.</li>
	<li>The upload fails because an attempt to upload a file to a server that requires 
	authentication (such as a user name and password). During upload, no mean is provided
	for users to enter passwords.</li>
	<li>The upload fails because the <codeph>url</codeph> parameter contains an invalid protocol.
    <codeph>FileReference.upload()</codeph> must use HTTP or HTTPS.</li>
	</ul>
	
	</apiDesc></adobeApiEventDetail><shortdesc>Invoked in any of the following situations:
    
	The upload fails because of an input/output error while Adobe AIR is reading, 
	writing, or transmitting the file.
	The upload fails because an attempt to upload a file to a server that requires 
	authentication (such as a user name and password).</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.net:FileReference:creationDate:get"><apiName>creationDate</apiName><shortdesc>
    The creation date of the file on the local disk.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>creationDate, FileReference.creationDate
    
    </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Date</apiValueClassifier><apiException><apiDesc>If the <codeph>FileReference.browse()</codeph>,
    <codeph>FileReferenceList.browse()</codeph>, or <codeph>FileReference.download()</codeph> method was not called 
    successfully, an exception is thrown with a message indicating that functions were called in the 
    incorrect sequence or an earlier call was unsuccessful. 
    In this case, the value of the <codeph>creationDate</codeph> property is <codeph>null</codeph>.
    
    </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException><apiDesc>If the file information cannot be accessed, an exception is thrown with a message
    indicating a file I/O error.
    
    </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiTipTexts><apiTipText>Gets the creation date of the file as a Date object.
    
    </apiTipText></apiTipTexts></apiValueDef><apiDesc>
    The creation date of the file on the local disk. If the object is
    was not populated, a call to get the value of this property returns <codeph>null</codeph>.
    
    </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:creator:get"><apiName>creator</apiName><shortdesc>
    The Macintosh creator type of the file, which is only used in Mac OS versions 
	prior to Mac OS X.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>creator, FileReference.creator
    </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier><apiException><apiDesc>On Macintosh, if the <codeph>FileReference.browse()</codeph>,
    <codeph>FileReferenceList.browse()</codeph>, or <codeph>FileReference.download()</codeph> method was not called 
    successfully, an exception is thrown with a message indicating that functions were called in the 
    incorrect sequence or an earlier call was unsuccessful. In this case, the value of the <codeph>creator</codeph> property 
    is <codeph>null</codeph>.
    
    </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiTipTexts><apiTipText>The Macintosh creator type.
    </apiTipText></apiTipTexts></apiValueDef><apiDesc>
    The Macintosh creator type of the file, which is only used in Mac OS versions 
	prior to Mac OS X. In Windows or Linux, this property is <codeph>null</codeph>.
    If the FileReference object
    was not populated, a call to get the value of this property returns <codeph>null</codeph>.
    
    </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link><link href="flash.net.xml#FileReference/extension"><linktext>FileReference.extension</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:data:get"><apiName>data</apiName><shortdesc>
    The ByteArray object representing the data from the loaded file after a successful call to the load() method.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata><asCustoms><refpath>
    </refpath></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>flash.utils:ByteArray</apiValueClassifier><apiException><apiDesc>If the <codeph>load()</codeph> method was not called 
    successfully, an exception is thrown with a message indicating that functions were called in the 
    incorrect sequence or an earlier call was unsuccessful. In this case, the value of the <codeph>data</codeph> property 
    is <codeph>null</codeph>.
    
    </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException><apiDesc>If the file cannot be opened or read, or if a similar error is encountered in 
    accessing the file, an exception is thrown with a message indicating a file I/O error. In this case, the value 
    of the <codeph>data</codeph> property is <codeph>null</codeph>.
    
    </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiTipTexts><apiTipText>The loaded data of the file, as a ByteArray.
    </apiTipText></apiTipTexts></apiValueDef><apiDesc>
    The ByteArray object representing the data from the loaded file after a successful call to the <codeph>load()</codeph> method.
    
    </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link><link href="flash.net.xml#FileReference/load()"><linktext>FileReference.load()</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:extension:get"><apiName>extension</apiName><shortdesc>
	 The filename extension.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier><apiException><apiDesc>If the reference is not initialized.
	 
	 </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
	 The filename extension.
	 
	 <p>A file's extension is the part of the name following (and not including) the final dot (".").
	 If there is no dot in the filename, the extension is <codeph>null</codeph>.</p>
	 
	 <p><i>Note:</i> You should use the <codeph>extension</codeph> property to determine a file's type; do not use the 
	 <codeph>creator</codeph> or <codeph>type</codeph> properties. You should consider the <codeph>creator</codeph> and <codeph>type</codeph>
	 properties to be considered deprecated. They apply to older versions of Mac OS.</p>
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:FileReference:modificationDate:get"><apiName>modificationDate</apiName><shortdesc>
   The date that the file on the local disk was last modified.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>modificationDate, FileReference.modificationDate
   
   </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Date</apiValueClassifier><apiException><apiDesc>If the <codeph>FileReference.browse()</codeph>,
   <codeph>FileReferenceList.browse()</codeph>, or <codeph>FileReference.download()</codeph> method was not called 
   successfully, an exception is thrown with a message indicating that functions were called in the 
   incorrect sequence or an earlier call was unsuccessful. In this case,
   the value of the <codeph>modificationDate</codeph> property is <codeph>null</codeph>.
   
   </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException><apiDesc>If the file information cannot be accessed, an exception is thrown with a message
   indicating a file I/O error.
   
   </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiTipTexts><apiTipText>Gets the modification date of the file as a Date object.
   </apiTipText></apiTipTexts></apiValueDef><apiDesc>
   The date that the file on the local disk was last modified. If the FileReference 
   object was not populated, a call to get the value of this property returns <codeph>null</codeph>.
   
   </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:name:get"><apiName>name</apiName><shortdesc>
   The name of the file on the local disk.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><refpath>
   </refpath></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier><apiException><apiDesc>If the <codeph>FileReference.browse()</codeph>,
   <codeph>FileReferenceList.browse()</codeph>, or <codeph>FileReference.download()</codeph> method was not called 
   successfully, an exception is thrown with a message indicating that functions were called in the 
   incorrect sequence or an earlier call was unsuccessful.
   
   </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiTipTexts><apiTipText>Gets the name of the file as a String.
   </apiTipText></apiTipTexts></apiValueDef><apiDesc>
   The name of the file on the local disk. If the FileReference object
   was not populated (by a valid call to <codeph>FileReference.download()</codeph> or <codeph>
   FileReference.browse()</codeph>), Flash Player throws an error when you try to get the 
   value of this property.
   <p>All the properties of a FileReference object are populated by calling the <codeph>browse()</codeph> method.
   Unlike other FileReference properties, if you call the <codeph>download()</codeph> method, 
   the <codeph>name</codeph> property is populated when the <codeph>select</codeph> event is dispatched.</p>
   
   </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:size:get"><apiName>size</apiName><shortdesc>
  The size of the file on the local disk in bytes.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><refpath>
  </refpath></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier><apiException><apiDesc>If the <codeph>FileReference.browse()</codeph>,
  <codeph>FileReferenceList.browse()</codeph>, or <codeph>FileReference.download()</codeph> method was not called 
  successfully, an exception is thrown with a message indicating that functions were called in the 
  incorrect sequence or an earlier call was unsuccessful.
  
  </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException><apiDesc>If the file cannot be opened or read, or if a similar error is encountered in 
  accessing the file, an exception is thrown with a message indicating a file I/O error.
  
  </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiTipTexts><apiTipText>The size of the file in bytes.
  </apiTipText></apiTipTexts></apiValueDef><apiDesc>
  The size of the file on the local disk in bytes. <ph platform="actionscript">If <codeph>size</codeph> is 0, 
  an exception is thrown.</ph>
  
  <p platform="actionscript"><i>Note:</i> In the initial version of ActionScript 3.0, the <codeph>size</codeph> property was 
  defined as a uint object, which supported files with sizes up to about 4 GB. It is now implimented as a Number 
  object to support larger files. </p>
  
  </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#FileReference/browse()"><linktext>FileReference.browse()</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:type:get"><apiName>type</apiName><shortdesc>
  The file type.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>type, FileReference.type
  </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier><apiException><apiDesc>If the <codeph>FileReference.browse()</codeph>,
  <codeph>FileReferenceList.browse()</codeph>, or <codeph>FileReference.download()</codeph> method was not called 
  successfully, an exception is thrown with a message indicating that functions were called in the 
  incorrect sequence or an earlier call was unsuccessful. In this case, the value of the <codeph>type</codeph> property 
  is <codeph>null</codeph>.
  
  </apiDesc><apiItemName>IllegalOperationError</apiItemName><apiOperationClassifier>flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiTipTexts><apiTipText>Gets the type or extension of the file.
  </apiTipText></apiTipTexts></apiValueDef><apiDesc>
  The file type. 
  
  <p>In Windows or Linux, this property is the file extension. On the Macintosh, this property is
  the four-character file type, which is only used in Mac OS versions prior to Mac OS X. If the FileReference object
    was not populated, a call to get the value of this property returns <codeph>null</codeph>.</p>
    
	<p>For Windows, Linux, and Mac OS X, the file extension — the portion of the <codeph>name</codeph> property that 
	follows the last occurrence of the dot (.) character — identifies the file type.</p>
	
  
  </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#FileReference/extension"><linktext>FileReference.extension</linktext></link></related-links></apiValue></apiClassifier><apiClassifier id="flash.net:SharedObjectFlushStatus"><apiName>SharedObjectFlushStatus</apiName><shortdesc>
 The SharedObjectFlushStatus class provides values for the code returned from a call to the SharedObject.flush() method.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiFinal/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 The SharedObjectFlushStatus class provides values for the code returned from a call to the <codeph>SharedObject.flush()</codeph> method.
 
 </apiDesc></apiClassifierDetail><related-links><link href="flash.net.xml#SharedObject/flush()"><linktext>SharedObject.flush()</linktext></link></related-links><apiValue id="flash.net:SharedObjectFlushStatus:FLUSHED"><apiName>FLUSHED</apiName><shortdesc>
 Indicates that the flush completed successfully.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>flushed</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
 Indicates that the flush completed successfully.
 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#SharedObject/flush()"><linktext>SharedObject.flush()</linktext></link></related-links></apiValue><apiValue id="flash.net:SharedObjectFlushStatus:PENDING"><apiName>PENDING</apiName><shortdesc>
 Indicates that the user is being prompted to increase disk space for the shared object
 before the flush can occur.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>pending</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
 Indicates that the user is being prompted to increase disk space for the shared object
 before the flush can occur.
 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#SharedObject/flush()"><linktext>SharedObject.flush()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier id="flash.net:URLRequest"><apiName>URLRequest</apiName><shortdesc>
  The URLRequest class captures all of the information in a single HTTP request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>The above include is not a mistake, but rather code re-use.
 </internal></asCustoms></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiFinal/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
  The URLRequest class captures all of the information in a single HTTP request. URLRequest
  objects are passed to the <codeph>load()</codeph> methods of the Loader, URLStream, 
  and URLLoader classes, and to other loading operations, to initiate URL downloads.  
  They are also passed to the <codeph>upload()</codeph> and <codeph>download()</codeph> methods 
  of the FileReference class.
 
  <p platform="actionscript">A SWF file in the local-with-filesystem sandbox may not load data from,
  or provide data to, a resource that is in the network sandbox. </p>
 
  <p>By default, the calling <ph platform="actionscript">SWF </ph>file 
  and the URL you load must be in the same domain. For example, a <ph platform="actionscript">SWF </ph>file 
  at www.adobe.com can load data only from sources that are also at www.adobe.com. 
  <ph platform="actionscript">To load data from a different domain, place a URL policy file on the server 
  hosting the data.</ph></p>
 
  <p> However, in Adobe AIR, content in the application security sandbox (content
  installed with the AIR application) is not restricted by these security limitations. 
  For content running in Adobe AIR, files in the application security sandbox
  can access URLs using any of the following URL schemes:</p>

  <p platform="javascript"> Files in the application security domain
  — files installed with the AIR application — can access URLs using any of the 
  following URL schemes:</p>
 
 <ul>
 
  <li><codeph>http</codeph> and <codeph>https</codeph> </li>
 
  <li><codeph>file</codeph> </li>
 
  <li><codeph>app-storage</codeph> </li>
 
  <li><codeph>app</codeph> </li>
 
 </ul>
 
  <p>Content <ph platform="actionscript">running in Adobe AIR </ph>that is not in the application security 
  sandbox observes the same restrictions as content running in the browser 
  <ph platform="actionscript">(in Flash Player)</ph>, and loading is
  governed by the content's domain<ph platform="actionscript"> and any permissions granted in URL
  policy files</ph>.</p>
 
 <p>For more information related to security, see the following:</p>
 
 <ul>
 
 <li product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
 in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
 <li product="flash">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
 in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
 
 <li>The "Understanding AIR Security" section of the "Getting started with Adobe AIR" chapter in the 
 <i>Developing AIR Applications</i> book.</li>
 
  <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
 </ul>
 
 </apiDesc><example conref="examples\URLRequestExample.as"> The following example creates a new Loader object and passes it
 a URLRequest object that contains the path to an XML file. If the loading operation is
 successful, a <codeph>complete</codeph> event is dispatched and the data in the XML
 file traces to the output. Additional event handlers capture other events, including error
 events.
 <p>To run this example, place a file named XMLFile.xml in the same directory
 as your SWF file.</p>
<codeblock>

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.*;

    public class URLRequestExample extends Sprite {

        public function URLRequestExample() {
            var loader:URLLoader = new URLLoader();
            configureListeners(loader);

            var request:URLRequest = new URLRequest("XMLFile.xml");
            try {
                loader.load(request);
            } catch (error:Error) {
                trace("Unable to load requested document.");
            }
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        }

        private function completeHandler(event:Event):void {
            var loader:URLLoader = URLLoader(event.target);
            trace("completeHandler: " + loader.data);
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function httpStatusHandler(event:HTTPStatusEvent):void {
            trace("httpStatusHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#FileReference"><linktext>FileReference</linktext></link><link href="flash.net.xml#URLRequestHeader"><linktext>URLRequestHeader</linktext></link><link href="flash.net.xml#URLRequestDefaults"><linktext>URLRequestDefaults</linktext></link><link href="flash.net.xml#URLLoader"><linktext>URLLoader</linktext></link><link href="flash.net.xml#URLStream"><linktext>URLStream</linktext></link><link href="../../flash/html/HTMLLoader.html"><linktext>HTMLLoader class</linktext></link></related-links><apiConstructor id="flash.net:URLRequest:URLRequest"><apiName>URLRequest</apiName><shortdesc>
     Creates a URLRequest object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/><apiParam><apiItemName>url</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>The URL to be requested. You can set the URL later by using the <codeph>url</codeph> property.
     
     </apiDesc></apiParam></apiConstructorDef><apiDesc>
     Creates a URLRequest object.
     
     If <codeph>System.useCodePage</codeph> is <codeph>true</codeph>, the request is encoded using the
     system code page, rather than Unicode.
     
     If <codeph>System.useCodePage</codeph> is <codeph>false</codeph>, the request is encoded using Unicode, rather than the
     system code page.
     
     </apiDesc></apiConstructorDetail><related-links><link href="flash.system.xml#System/useCodePage"><linktext>flash.system.System.useCodePage</linktext></link></related-links></apiConstructor><apiValue id="flash.net:URLRequest:authenticate:get"><apiName>authenticate</apiName><shortdesc>
	Specifies whether authentication requests should be handled (true
	or not (false) for this request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc>
	Specifies whether authentication requests should be handled (<codeph>true</codeph>
	or not (<codeph>false</codeph>) for this request. If <codeph>false</codeph>, authentication 
	challenges return an HTTP error.  
	
	<p>The supported authentication methods are:</p>
    
	<ul>
	
		<li>Windows—HTTP Basic/Digest, Windows Integrated Authentication 
			(including NTLM and Kerberos), SSL Certificate Authentication.</li>
    
		<li>Mac—HTTP Basic/Digest, NTLM, SSL Certificate Authentication.</li>
	
	</ul>
	
	<p><b>Note</b>:The <codeph>FileReference.upload()</codeph>,
	<codeph>FileReference.download()</codeph>, and <codeph>HTMLLoader.load()</codeph> 
	methods do not support the <codeph>URLRequest.authenticate</codeph> property.</p>
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequestDefaults/authenticate"><linktext>flash.net.URLRequestDefaults.authenticate</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:cacheResponse:get"><apiName>cacheResponse</apiName><shortdesc>
	Specifies whether successful response data should be cached for this request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc>
	Specifies whether successful response data should be cached for this request. 
	When set to <codeph>true</codeph>, the AIR application uses the operating system's 
	HTTP cache.
	
	<p><b>Note</b>:The <codeph>HTMLLoader.load()</codeph> method
	does not support the <codeph>URLRequest.cacheResponse</codeph> property.</p>
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequestDefaults/cacheResponse"><linktext>flash.net.URLRequestDefaults.cacheResponse</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:contentType:get"><apiName>contentType</apiName><shortdesc>
     The MIME content type of the content in the the data property.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     The MIME content type of the content in the the <codeph>data</codeph> property.
     
     <p>The default value is <codeph>application/x-www-form-urlencoded</codeph>.</p>
     
     <p><b>Note</b>:The <codeph>FileReference.upload()</codeph>,
     <codeph>FileReference.download()</codeph>, and <codeph>HTMLLoader.load()</codeph> methods do not
     support the <codeph>URLRequest.contentType</codeph> property.</p>
     
     <p>When sending a POST request, the values of the <codeph>contentType</codeph> 
     and <codeph>data</codeph> properties must correspond properly. The value of the <codeph>contentType</codeph> 
     property instructs servers on how to interpret the value of the <codeph>data</codeph> property. </p>
     
     <ul> 
     <li>If the value of the <codeph>data</codeph> property is a URLVariables object, the value of 
     <codeph>contentType</codeph> must be <codeph>application/x-www-form-urlencoded</codeph>. </li>
     
     <li> If the value of the <codeph>data</codeph> property is any other type, the value of <codeph>contentType</codeph> 
     should indicate the type of the POST data that will be sent (which is the binary or string data 
     contained in the value of the <codeph>data</codeph> property). </li>
     
     <li>For <codeph>FileReference.upload()</codeph>, 
     the Content-Type of the request is set automatically to <codeph>multipart/form-data</codeph>, 
     and the value of the <codeph>contentType</codeph> property is ignored.</li>
     </ul>
     
     <p> In Flash Player 10 and later, if you use a multipart Content-Type (for example "multipart/form-data") 
     that contains an upload (indicated by a "filename" parameter in a "content-disposition" header within the POST body),
	 the POST operation is subject to the security rules applied to uploads:</p>
	 <ul>
	 <li>The POST operation must be performed in response to a user-initiated action, such as a mouse click or key press.</li>
	 <li>If the POST operation is cross-domain (the POST target is not on the same server as the SWF file 
	 that is sending the POST request),
	 the target server must provide a URL policy file that permits cross-domain access.</li>
	 </ul>
     <p>Also, for any multipart Content-Type, the syntax must be valid (according to the RFC2046 standards).
     If the syntax appears to be invalid, the POST operation is subject to the security rules applied to uploads.</p>
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequest/data"><linktext>data</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:data:get"><apiName>data</apiName><shortdesc>
     An object containing data to be transmitted with the URL request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Object</apiValueClassifier></apiValueDef><apiDesc>
     An object containing data to be transmitted with the URL request. 
     
     <p>This property is used in conjunction with the <codeph>method</codeph> property.
     When the value of <codeph>method</codeph> is <codeph>GET</codeph>,
     the value of <codeph>data</codeph> is appended to the value of <codeph>URLRequest.url</codeph>, 
     using HTTP query-string syntax. When the <codeph>method</codeph> value is <codeph>POST</codeph> 
     (or any value other than <codeph>GET</codeph>), the value 
     of <codeph>data</codeph> is transmitted in the body of the HTTP request.</p>
     
     <p>The URLRequest API offers binary <codeph>POST</codeph> support and support for URL-encoded variables,
     as well as support for strings. The data object can be a ByteArray, URLVariables, 
     or String object.</p>
     
     <p>The way in which the data is used depends on the type of object used:</p>
     
     <ul>
     
         <li>If the object is a ByteArray object, the binary
     data of the ByteArray object is used as <codeph>POST</codeph> data. For <codeph>GET</codeph>, data of ByteArray type
     is not supported. Also, data of ByteArray type is not supported for
     <codeph>FileReference.upload()</codeph> and <codeph>FileReference.download()</codeph>.</li>
     
         <li>If the object is a URLVariables object and the method is <codeph>POST</codeph>,
     the variables are encoded using <i>x-www-form-urlencoded</i> format
     and the resulting string is used as <codeph>POST</codeph> data. An exception is a call to 
     <codeph>FileReference.upload()</codeph>, in which the variables are sent as separate fields in
     a <codeph>multipart/form-data</codeph> post.</li>
     
      <li>If the object is a URLVariables object and the method is <codeph>GET</codeph>,
     the URLVariables object defines variables to be sent with the URLRequest object.</li>
     
         <li>Otherwise, the object is converted to a string, and the string
     is used as the <codeph>POST</codeph> or <codeph>GET</codeph> data.</li>
     
     </ul>
     
     <p>This data is not sent until a method, such as <codeph>navigateToURL()</codeph> 
     or <codeph>FileReference.upload()</codeph>, uses the URLRequest object.</p>
     
     <p><b>Note</b>: The value of <codeph>contentType</codeph> must correspond to the type of data 
     in the <codeph>data</codeph> property. See the note in the description of the 
     <codeph>contentType</codeph> property.</p>
     
     </apiDesc><example conref="examples\URLVariablesExample.as"> The following example opens the remote application hosted at 
 http://www.[yourDomain].com/application.jsp in a new browser window and passes 
 data about a user session, captured in a URLVariables object, to the application. 
  
 <p>Highlights of the example follow:</p>
 <ol>
    <li>The constructor function creates a URLRequest
    instance named <codeph>request</codeph>, taking the URL of the remote application as a parameter.</li>
    <li>A URLVariables object is created and two of its properties are assigned values.</li>
    <li>The URLVariables object is assigned to the <codeph>data</codeph> property of the URLRequest object.</li>
    <li>The example calls <codeph>navigateToURL</codeph>, which opens a new browser window
    to the remote application's URL.</li>
 </ol>
 <p> <b>Note:</b> To run the example, the remote application URL in the example must be replaced
 with a working URL. Additionally, you would need server code 
 to process the information captured by Flash Player in the URLVariables object.</p>
<codeblock>
package {
    import flash.display.Sprite;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.net.URLVariables;

    public class URLVariablesExample extends Sprite {

        public function URLVariablesExample() {
            var url:String = "http://www.[yourDomain].com/application.jsp";
            var request:URLRequest = new URLRequest(url);
            var variables:URLVariables = new URLVariables();
            variables.exampleSessionId = new Date().getTime();
            variables.exampleUserLabel = "guest";
            request.data = variables;
            navigateToURL(request);
        }
    }
}
</codeblock></example></apiValueDetail><related-links><link href="flash.net.xml#URLRequest/method"><linktext>URLRequest.method</linktext></link><link href="flash.net.xml#URLRequestMethod"><linktext>URLRequestMethod</linktext></link><link href="flash.net.xml#URLVariables"><linktext>URLVariables</linktext></link><link href="flash.utils.xml#ByteArray"><linktext>flash.utils.ByteArray</linktext></link><link href="flash.net.xml#URLRequest/contentType"><linktext>contentType</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:digest:set"><apiName>digest</apiName><shortdesc>
     A string that uniquely identifies the signed Adobe platform component to be stored 
     to (or retrieved from) the Flash Player cache.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9.0.115.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier><apiException><apiDesc>The digest provided does not match the digest of the file that is 
     extracted from the downloaded signed file or the signed file loaded out of the cache. The 
     application also throws this error if the provided digest is the wrong length or contains invalid 
     (nonhexadecimal) characters.
     
     </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
     A string that uniquely identifies the signed Adobe platform component to be stored 
     to (or retrieved from) the Flash Player cache. <ph platform="actionscript"> An Adobe 
     platform component is a signed file (a SWZ file) that contains SWF content that is cached  
     persistently on a user's machine. All SWZ files are signed by Adobe. A digest 
     corresponds to a single cached file; if you change the file in any way, its digest
     will change in an unpredictable way. By using a digest, you can verify the cached file across
     multiple domains. Two files with the same digest are the same file, and two files with different
     digests are not the same file. A file cannot (practically) be created to "spoof" a digest and 
     pretend to be another digest. </ph><ph platform="javascript">This property applies to
     SWF content only; it does not apply to JavaScript code running in AIR.</ph>
     
     <p platform="actionscript">The digest is based on an SHA-256 message digest algorithm 
     (64 characters long in hexadecimal format).</p>
     
     <p platform="actionscript">For example, the Flex SDK includes a SWZ for the Flex framework (and it
     provides the digest string for that SWZ file). You can post this SWZ on your web server and load it 
     in your SWF file (using the <codeph>load()</codeph> method of a URLLoader object). If the end user's 
     machine already has the matching SWZ file cached, the application uses the cached SWZ file. 
     (A SWZ file matches if its <codeph>digest</codeph> matches the one you provide.) Otherwise, the 
     application downloads the SWZ file from the URL you specify. </p>
     
     <p platform="actionscript">Only set the <codeph>digest</codeph> parameter in a URLRequest object
     used in a call to the <codeph>URLLoader.load()</codeph> method to load a SWZ file. If the <codeph>digest</codeph>
     property of a a URLRequest object is set when it is used in other methods, the application throws an
     IOError exception.</p>
     
     </apiDesc><example conref="examples\URLRequest_digest.as"> The following example loads a remote file into the cache. At the end of the load, the byte array 
 contains the actual file (not the signed file). The example completes the load operation by calling <codeph>loadBytes()</codeph>:
<codeblock>
 
var myURLReq:URLRequest = new URLRequest();
myURLReq.url = "http://yourdomain/users/jdoe/test01/_rsc/Automated/AssetCaching_rsc/test01/rsl.swz";
myURLReq.digest = "3B0AA28C7A990385E044D80F5637FB036317BB41E044D80F5637FB036317BB41";
var myURLLoader:URLLoader = new URLLoader();
myURLLoader.dataFormat = URLLoaderDataFormat.BINARY;
myURLLoader.addEventListener("complete", onC);

myURLLoad.load(myURLReq);

function onC(e) {
    var someLoader:Loader = new Loader();
    addChild(someLoader);
    someLoader.loadBytes((ByteArray)(myURLLoad.data)); 
}

</codeblock></example></apiValueDetail></apiValue><apiValue id="flash.net:URLRequest:followRedirects:get"><apiName>followRedirects</apiName><shortdesc>
	Specifies whether redirects are to be followed (true) 
	or not (false).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc>
	Specifies whether redirects are to be followed (<codeph>true</codeph>) 
	or not (<codeph>false</codeph>). 
	
	<p><b>Note</b>:The <codeph>FileReference.upload()</codeph>,
	<codeph>FileReference.download()</codeph>, and <codeph>HTMLLoader.load()</codeph> methods do not
	support the <codeph>URLRequest.followRedirects</codeph> property.</p>
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequestDefaults/followRedirects"><linktext>URLRequestDefaults.followRedirects</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:manageCookies:get"><apiName>manageCookies</apiName><shortdesc>
	Specifies whether the HTTP protocol stack should manage cookies for this
	request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true 
	
	</apiDefaultValue></apiValueDef><apiDesc>
	Specifies whether the HTTP protocol stack should manage cookies for this
	request. When <codeph>true</codeph>, cookies are added to the request 
	and response cookies are remembered. If <codeph>false</codeph>, cookies are 
	<i>not</i> added to the request and response cookies are <i>not</i>
	remembered, but users can manage cookies themselves by direct header 
	manipulation. 
	
	<p>On Mac OS, cookies are shared with Safari. To clear cookies on Mac OS:</p>
	
	<ol>
		<li>Open Safari.</li>
      <li>Select Safari &gt; Preferences, and click the Security panel.</li>
      <li>Click the Show Cookies button.</li>
		<li>Click the Reomove All button.</li>
	</ol>
	
	<p>To clear cookies on Windows:</p>
	
	<ol>
		<li>Open the Internet Properties control panel, and click the General tab.</li>
		<li>Click the Delete Cookies button. </li>
	</ol>
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequestDefaults/manageCookies"><linktext>flash.net.URLRequestDefaults.manageCookies</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:method:get"><apiName>method</apiName><shortdesc>
     Controls the HTTP form submission method.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier><apiException><apiDesc>If the <codeph>value</codeph> parameter is not 
     <codeph>URLRequestMethod.GET</codeph> or <codeph>URLRequestMethod.POST</codeph>.
     
     </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiDefaultValue>URLRequestMethod.GET
     
     </apiDefaultValue></apiValueDef><apiDesc>
     Controls the HTTP form submission method. 
     
     <p><ph platform="actionscript">For SWF content running in Flash Player 
     (in the browser), this property is limited to GET or 
     POST operations, and valid values are <codeph>URLRequestMethod.GET</codeph> 
     or <codeph>URLRequestMethod.POST</codeph>.</ph></p>
     
     <p><ph platform="actionscript">For content running in Adobe AIR, you </ph>
     <ph platform="javascript">You </ph>can use any string value
     if the content is in the application security sandbox. Otherwise,
     <ph platform="actionscript">as with content running in Flash Player,</ph> 
     you are restricted to using GET or POST operations<ph platform="javascript">, and valid values are 
     <codeph>URLRequestMethod.GET</codeph> or <codeph>URLRequestMethod.POST</codeph></ph>.</p>
     
     <p><ph platform="actionscript">For content running in Adobe AIR, when </ph><ph platform="javascript">When </ph>
     using the <codeph>navigateToURL()</codeph> function, the runtime treats a URLRequest that uses the POST
     method (one that has its <codeph>method</codeph> property set to <codeph>URLRequestMethod.POST</codeph>)
     as using the GET method.</p>
     
     <p><ph platform="actionscript"><b>Note:</b> 
     If running in Flash Player and the referenced form has no body, 
     Flash Player automatically uses a GET operation, even if the method is set to 
     <codeph>URLRequestMethod.POST</codeph>. For this reason, it is recommended to always include 
     a "dummy" body to ensure that the correct method is used.</ph></p>
     
     </apiDesc><example conref="examples\URLRequest_method.as"> The following example opens the remote application hosted at 
 http://www.[yourDomain].com/application.jsp in a new browser window and passes 
 data about a user session, captured in a URLVariables object, to the application. 
 It explicitly sets the value of the <codeph>URLRequest.method</codeph> property to 
 <codeph>URLRequestMethod.POST</codeph>.
 <p>Highlights of the example follow:</p>
 <ol>
    <li>The constructor function creates a URLRequest
    instance named <codeph>request</codeph>, taking the URL of the remote application as a parameter.</li>
    <li>A URLVariables object is created and two of its properties are assigned values.</li>
    <li>The URLVariables object is assigned to the <codeph>data</codeph> property of the URLRequest object.</li>
  <li>The value of the <codeph>URLRequest.method</codeph> property is set to 
 <codeph>URLRequestMethod.POST</codeph>.</li>
    <li>The example calls <codeph>navigateToURL</codeph>, which opens a new browser window
    to the remote application's URL.</li>
 </ol>
 <p> <b>Note:</b> To run the example, the remote application URL in the example must be replaced
 with a working URL. Additionally, you would need server code 
 to process the information captured by Flash Player in the URLVariables object.</p>
<codeblock>
package {
    import flash.display.Sprite;
    import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.net.URLRequestMethod;
    import flash.net.URLVariables;

    public class URLRequest_method extends Sprite {

        public function URLRequest_method() {
            var url:String = "http://www.[yourDomain].com/application.jsp";
            var request:URLRequest = new URLRequest(url);
            
            var variables:URLVariables = new URLVariables();
            variables.exampleSessionId = new Date().getTime();
            variables.exampleUserLabel = "guest";
            request.data = variables;
            request.method = URLRequestMethod.POST;
            
            navigateToURL(request);
        }
    }
}
</codeblock></example></apiValueDetail><related-links><link href="flash.net.xml#URLRequestMethod"><linktext>URLRequestMethod class</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:requestHeaders:get"><apiName>requestHeaders</apiName><shortdesc>
     The array of HTTP request headers to be appended to the
     HTTP request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Array</apiValueClassifier></apiValueDef><apiDesc>
     The array of HTTP request headers to be appended to the
     HTTP request. The array is composed of URLRequestHeader objects.
     Each object in the array must be a URLRequestHeader object that 
     contains a name string and a value string, as follows: 
     <codeblock>
     var rhArray:Array = new Array(new URLRequestHeader("Content-Type", "text/html"));
     </codeblock>
     
     <p><ph platform="actionscript">Flash Player and the AIR runtime impose</ph> 
     <ph platform="javascript">The AIR runtime imposes</ph> certain restrictions on request headers; 
     for more information, see the URLRequestHeader class description.</p>
     
     <p>Not all methods that accept URLRequest parameters support the <codeph>requestHeaders</codeph> property,
     consult the documentation for the method you are calling. For example, the <codeph>FileReference.upload()</codeph>
     and <codeph>FileReference.download()</codeph> methods do not
     support the <codeph>URLRequest.requestHeaders</codeph> property.</p>
     <p>Due to browser limitations, custom HTTP request headers are only supported for <codeph>POST</codeph> requests,
     not for <codeph>GET</codeph> requests.</p> 
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequestHeader"><linktext>URLRequestHeader</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:url:get"><apiName>url</apiName><shortdesc>
     The URL to be requested.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     The URL to be requested. 
     
     <p>Be sure to encode any characters that are either described as unsafe in the Uniform Resource Locator 
     specification (see http://www.faqs.org/rfcs/rfc1738.html) or that are reserved in the 
     URL scheme of the URLRequest object (when not used for their reserved purpose). For example, 
     use <codeph>"%25"</codeph> for the percent (%) symbol and <codeph>"%23"</codeph> for the number sign (#), as in 
     <codeph>"http://www.example.com/orderForm.cfm?item=%23B-3&amp;discount=50%25"</codeph>.</p>
     
      <p>By default, the URL must be in the same domain as the calling file,
      unless the content is running in the <ph platform="actionscript">Adobe AIR </ph>application 
      security sandbox. <ph platform="actionscript">If you need to load data from a different domain,
      put a URL policy file on the server that is hosting the data</ph>. For more information,
      see the description of the URLRequest class.</p>
     
     <p><ph platform="actionscript">For content running in Adobe AIR, files</ph> 
     <ph platform="javascript">Files</ph> in the application security sandobx
     — files installed with the AIR application — can access URLs using any of the 
     following URL schemes:</p>
     
     <ul>
     
      <li><codeph>http</codeph> and <codeph>https</codeph> </li>
     
      <li><codeph>file</codeph> </li>
     
      <li><codeph>app-storage</codeph> </li>
     
      <li><codeph>app</codeph> </li>
     
     </ul>
     
     <p><b>Note:</b> IPv6 (Internet Protocol version 6) is supported<ph platform="actionscript"> in
     AIR and in Flash Player 9.0.115.0 and later</ph>. 
     
     IPv6 is a version of Internet Protocol that supports 
     128-bit addresses (an improvement on the earlier IPv4 protocol that supports 32-bit 
     addresses). You might need to activate IPv6 on your networking interfaces. For more 
     information, see the Help for the operating system hosting the data.
     If IPv6 is supported on the hosting system, you can specify numeric IPv6 literal addresses
     in URLs enclosed in brackets ([])<ph platform="actionscript">, as in the following</ph>. </p>
     
     <ph platform="actionscript">
     <pre>
     rtmp://[2001:db8:ccc3:ffff:0:444d:555e:666f]:1935/test
     </pre>
     </ph>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequest:useCache:get"><apiName>useCache</apiName><shortdesc>
	Specifies whether the local cache should be consulted before this URLRequest 
	fetches data.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc>
	Specifies whether the local cache should be consulted before this URLRequest 
	fetches data. 
	
	<p><b>Note</b>:The <codeph>HTMLLoader.load()</codeph> method
	does not support the <codeph>URLRequest.useCache</codeph> property.</p>
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequestDefaults/useCache"><linktext>flash.net.URLRequestDefaults.useCache</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:userAgent:get"><apiName>userAgent</apiName><shortdesc>
	Specifies the user-agent string to be used in the HTTP request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier><apiException><apiDesc>The caller is not in the AIR application security sandbox.
	
	</apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
	Specifies the user-agent string to be used in the HTTP request. 
	
	<p platform="actionscript">The default value is the same user agent string that is used by 
	Flash Player, which is different on Mac, Linux, and Windows.</p>
	
	<p><i>Note:</i> This property does not affect the user agent string when
	the URLRequest object is used with the <codeph>load()</codeph> method of an
	HTMLLoader object. To set the user agent string for an HTMLLoader object, 
	set the <codeph>userAgent</codeph> property of the HTMLLoader object or set
	the static <codeph>URLRequestDefaults.userAgent</codeph> property.</p>
	
	</apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLRequestDefaults/userAgent"><linktext>flash.net.URLRequestDefaults.userAgent</linktext></link><link href="../../flash/html/HTMLLoader.html#userAgent"><linktext>flash.html.HTMLLoader.userAgent</linktext></link></related-links></apiValue></apiClassifier><apiClassifier id="flash.net:FileFilter"><apiName>FileFilter</apiName><shortdesc>
 The FileFilter class is used to indicate what files on the user's system are shown
 in the file-browsing dialog box that is displayed when the FileReference.browse() 
 method, the FileReferenceList.browse() method is called or a
 browse method of a File, FileReference, or FileReferenceList object is called.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiFinal/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 The FileFilter class is used to indicate what files on the user's system are shown
 in the file-browsing dialog box that is displayed when the <codeph>FileReference.browse()</codeph> 
 method, the <codeph>FileReferenceList.browse()</codeph> method is called or a
 browse method of a File, FileReference, or FileReferenceList object is called.
 FileFilter instances are passed as a value for the optional <codeph>typeFilter</codeph> parameter to the method. 
 If you use a FileFilter instance, extensions and file types that aren't specified in the FileFilter instance
 are filtered out; that is, they are not available to the user for selection. 
 If no FileFilter object is passed to the method, all files are shown in the dialog box.
 
 <p>You can use FileFilter instances in one of two ways:</p>
 
 <ul>
 
   <li>A description with file extensions only</li>
 
   <li>A description with file extensions and Macintosh file types</li>
 
 </ul>
 
 <p>The two formats are not interchangeable within a single call to the browse method. 
 You must use one or the other.</p>
 
 <p>You can pass one or more FileFilter instances to the browse method, as shown in the following:</p>
 
 <codeblock platform="actionscript">
 var imagesFilter:FileFilter = new FileFilter("Images", "~~.jpg;~~.gif;~~.png");
 var docFilter:FileFilter = new FileFilter("Documents", "~~.pdf;~~.doc;~~.txt");
 var myFileReference:FileReference = new FileReference();
 myFileReference.browse([imagesFilter, docFilter]);
 </codeblock>
 
 <p platform="actionscript">Or in an AIR application:</p>
 
 <codeblock platform="actionscript">
 var imagesFilter:FileFilter = new FileFilter("Images", "~~.jpg;~~.gif;~~.png");
 var docFilter:FileFilter = new FileFilter("Documents", "~~.pdf;~~.doc;~~.txt");
 var myFile:File = new File();
 myFile.browseForOpen("Open", [imagesFilter, docFilter]);
 </codeblock>
 
 <codeblock platform="javascript">
 var imagesFilter = new air.FileFilter("Images", "~~.jpg;~~.gif;~~.png");
 var docFilter = new air.FileFilter("Documents", "~~.pdf;~~.doc;~~.txt");
 var myFile = new air.File();
 myFile.browseForOpen("Open", [imagesFilter, docFilter]);
 </codeblock>
 
 <p>The list of extensions in the <codeph>FileFilter.extension</codeph> property 
 is used to filter the files shown in the file browsing dialog. The list is not actually 
 displayed in the dialog box; to display the file types 
 for users, you must list the file types in the description string as well as in the extension
 list. The description string is displayed in the dialog box in Windows and Linux.
 (It is not used on the Macintosh<sup>®</sup>.) On the Macintosh, if you supply a list of Macintosh file types,
 that list is used to filter the files. If not, the list of file extensions is used. </p> 
 
 </apiDesc></apiClassifierDetail><apiConstructor id="flash.net:FileFilter:FileFilter"><apiName>FileFilter</apiName><shortdesc>
	 Creates a new FileFilter instance.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/><apiParam><apiItemName>description</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The description string that is visible to users when they select files for uploading.
	 
	 </apiDesc></apiParam><apiParam><apiItemName>extension</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>A list of file extensions that indicate which file formats are visible to users
	 when they select files for uploading.
	 
	 </apiDesc></apiParam><apiParam><apiItemName>macType</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>A list of Macintosh file types that indicate which file types are visible to
	 users when they select files for uploading. If no value is passed, this parameter is set to <codeph>null</codeph>.
	 
	 </apiDesc></apiParam></apiConstructorDef><apiDesc>
	 Creates a new FileFilter instance.
	 </apiDesc></apiConstructorDetail></apiConstructor><apiValue id="flash.net:FileFilter:description:get"><apiName>description</apiName><shortdesc>
	 The description string for the filter.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 The description string for the filter. The description 
	 is visible to the user in the dialog box that opens 
	 when <codeph>FileReference.browse()</codeph>
	 or <codeph>FileReferenceList.browse()</codeph> is called.
	 The description string contains a string, such as
	 <codeph>"Images (~~.gif, ~~.jpg, ~~.png)"</codeph>, that can
	 help instruct the user on what file types can be uploaded
	 or downloaded. Note that the actual file types that are supported by
	 this FileReference object are stored in the <codeph>extension</codeph>
	 property.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:FileFilter:extension:get"><apiName>extension</apiName><shortdesc>
	 A list of file extensions.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 A list of file extensions. This list indicates the types of files
	 that you want to show in the file-browsing dialog box. (The list 
	 is not visible to the user; the user sees only the value of the
	 <codeph>description</codeph> property.) The <codeph>extension</codeph> property contains
	 a semicolon-delimited list of file extensions, 
	 with a wildcard (~~) preceding each extension, as shown
	 in the following string: <codeph>"~~.jpg;~~.gif;~~.png"</codeph>.
	 
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:FileFilter:macType:get"><apiName>macType</apiName><shortdesc>
	 A list of Macintosh file types.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 A list of Macintosh file types. This list indicates the types of files
	 that you want to show in the file-browsing dialog box. (This list 
	 itself is not visible to the user; the user sees only the value of the
	 <codeph>description</codeph> property.) The <codeph>macType</codeph> property contains
	 a semicolon-delimited list of Macintosh file types, as shown
	 in the following string: <codeph>"JPEG;jp2_;GIFF"</codeph>.
	 
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="flash.net:NetStream"><apiName>NetStream</apiName><shortdesc>
 The NetStream class opens a one-way streaming connection between an AIR
 or Flash Player application
 and Flash Media Server, or between an AIR or Flash  
 Player application and the local file system.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream
 
 </keyword></asCustoms></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
 The NetStream class opens a one-way streaming connection between an AIR
 <ph platform="actionscript">or Flash Player</ph> application
 and Flash Media Server, or between an AIR <ph platform="actionscript">or Flash  
 Player</ph> application and the local file system. 
 A NetStream object is a channel within a
 NetConnection object. This channel can either publish a stream, using 
 <codeph>NetStream.publish()</codeph>,
 or subscribe to a published stream and receive data, using 
 <codeph>NetStream.play()</codeph>.
 You can publish or play live (real-time) data and previously recorded data. 
 You can also call the <codeph>NetStream.send()</codeph> method to send text messages to all subscribed clients.
 
 <p platform="actionscript">Playing external video files provides several advantages over embedding video
 in a SWF file, such as better performance and memory management, 
 and independent video and SWF frame rates. </p>
 
 <p>Adobe AIR and Flash Player 9.0.115.0 and later versions 
 support files derived from the standard MPEG-4 container format including F4V, MP4, M4A, MOV, MP4V, 3GP, and 3G2 
 if they contain H.264 video and/or HEAAC v2 encoded audio. H.264 delivers higher quality video at lower bitrates 
 when compared to the same encoding profile in Sorenson or On2. HE-AAC v2 is an extension of AAC 
 (a standard audio format defined in the MPEG-4 video standard) that uses Spectral Band Replication (SBR) 
 and Parametric Stereo (PS) techniques to increase coding efficiency at low bitrates.
 For information about supported codecs and file formats, see <xref href="http://www.adobe.com/go/hardware_scaling_en" scope="external">http://www.adobe.com/go/hardware_scaling_en</xref>
 and the <xref href="http://www.adobe.com/go/learn_fms_fileformats_en" scope="external">www.adobe.com/go/learn_fms_fileformats_en</xref>.</p>
 
 <p><b>Workflow for publishing and playing streams:</b></p>
 
 <ol>
 <li>Create a NetConnection object.</li>
 <li>Call the <codeph>NetConnection.connect()</codeph> method to connect
 to the application instance on the server.</li>
 <li>Create a NetStream object to create a stream within the 
 connection.</li>
 <li>To capture, encode, and publish audio and video, call the <codeph>NetStream.attachAudio()</codeph>method
 and the <codeph>NetStream.attachCamera()</codeph> 
 method.</li>
 <li>Call the <codeph>NetStream.publish()</codeph> method to give the stream a 
 unique name and send data over the stream to the server so that others can receive it. 
 You can also record the data
 as you publish it, so that users can play it back later.</li>
 <li>Call the <codeph>NetStream.play()</codeph> method to play a live stream or a recorded stream. 
 Pass the <codeph>play()</codeph> method the name of the string passed to the <codeph>publish()</codeph> method.</li>
 </ol>
 
 <p><b>Using data keyframes with Flash Media Server:</b>
 After creating the NetConnection and NetStream objects, you can 
 use <codeph>NetStream.send()</codeph> to add metadata
 to live audio or video as you stream it to the server.
 Metadata can be information such as the height or width of a video,
 its duration, the name of its creator, and so on.
 To define the metadata, use the special handler name 
 <codeph>@setDataFrame</codeph> as the first argument to
 <codeph>NetStream.send()</codeph>.</p>
 
 <p><b>Receiving data from a Flash Media Server stream, progressive F4V file, or progressive FLV file:</b>
 Flash Media Server, F4V files, and FLV files can send event objects containing data at specific
 data points during streaming or playback. You can handle data from a stream or FLV file during playback in two ways:</p>
 
 <ul><li>Associate a client property with an event handler to receive the data object.
 Use the <codeph>NetStream.client</codeph> property to assign an object to call specific
 data handling functions. The object assigned to the <codeph>NetStream.client</codeph> property
 can listen for the following data points: <codeph>onCuePoint()</codeph>, 
 <codeph>onImageData()</codeph>, <codeph>onMetaData()</codeph>, <codeph>onPlayStatus()</codeph>, 
 <codeph>onTextData()</codeph>, and <codeph>onXMPData()</codeph>. Then write procedures within those functions
 to handle the data object returned from the stream or FLV file during playback. 
 See the <codeph>NetStream.client</codeph> property for more information.</li>
 <li>Associate a client property with a subclass of the NetStream class, then write
 an event handler to receive the data object. NetStream is 
 a sealed class, which means that properties or methods cannot be added to a NetStream object
 at runtime. However, you can create a subclass of NetStream and define your event handler 
 in the subclass or make the subclass dynamic and add the event handler function to an 
 instance of the subclass.</li></ul>
 
 <p><b>Note:</b> To send data through an audio file, like an MP3 file, use the Sound class
 to associate the audio file with a Sound object. Then, use the <codeph>Sound.id3</codeph> property
 to read metadata from the sound file.</p>
 
 </apiDesc><example conref="examples\NetConnectionExample.as"> The following example uses a Video object with the NetConnection and 
 NetStream classes to load and play an FLV file. To run this example, you need an FLV file 
 whose name and location match the variable passed to <codeph>videoURL</codeph>; 
 in this case, an FLV file called Video.flv that is in the same directory as the SWF file.
 <p>In this example, the code that creates the Video and NetStream objects and calls the
 <codeph>Video.attachNetStream()</codeph> and <codeph>NetStream.play()</codeph> methods is placed 
 in a handler function. The handler is called only if the
 attempt to connect to the NetConnection object is successful; that is, 
 when the <codeph>netStatus</codeph> event returns an <codeph>info</codeph> object with a <codeph>code</codeph>
 property that indicates success. 
 It is recommended that you wait for a successful connection before you call
 <codeph>NetStream.play()</codeph>. </p>
 <codeblock>

package {
    import flash.display.Sprite;
    import flash.events.NetStatusEvent;
    import flash.events.SecurityErrorEvent;
    import flash.media.Video;
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.events.Event;

    public class NetConnectionExample extends Sprite {
        private var videoURL:String = "Video.flv";
        private var connection:NetConnection;
        private var stream:NetStream;

        public function NetConnectionExample() {
            connection = new NetConnection();
            connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            connection.connect(null);
        }

        private function netStatusHandler(event:NetStatusEvent):void {
            switch (event.info.code) {
                case "NetConnection.Connect.Success":
                    connectStream();
                    break;
                case "NetStream.Play.StreamNotFound":
                    trace("Stream not found: " + videoURL);
                    break;
            }
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function connectStream():void {
            var stream:NetStream = new NetStream(connection);
            stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            stream.client = new CustomClient();
            var video:Video = new Video();
            video.attachNetStream(stream);
            stream.play(videoURL);
            addChild(video);
        }
    }
}

class CustomClient {
    public function onMetaData(info:Object):void {
        trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate);
    }
    public function onCuePoint(info:Object):void {
        trace("cuepoint: time=" + info.time + " name=" + info.name + " type=" + info.type);
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.media.xml#Video"><linktext>flash.media.Video</linktext></link><link href="flash.net.xml#NetConnection"><linktext>flash.net.NetConnection</linktext></link><link href="flash.net.xml#NetStream/event:onImageData"><linktext>onImageData</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData"><linktext>onMetaData</linktext></link></related-links><adobeApiEvent id="flash.net:NetStream_flash.events.DRMStatusEvent.DRM_STATUS_drmStatus"><apiName>drmStatus</apiName><shortdesc>
 Dispatched when the digital rights management (DRM) encrypted content 
 begins playing (when the user is authenticated and authorized to play the content).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.DRMStatusEvent.DRM_STATUS</apiEventType><adobeApiEventClassifier>flash.events.DRMStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when the digital rights management (DRM) encrypted content 
 begins playing (when the user is authenticated and authorized to play the content).
 <p>
 DRMStatusEvent object contains information related to the voucher, such as whether the content
 can be made available offline or when the voucher will expire and the content can no longer 
 be viewed.
 </p>
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.events.xml#DRMStatusEvent"><linktext>flash.events.DRMStatusEvent</linktext></link><link href="flash.net.xml#NetStream/resetDRMVouchers()"><linktext>resetDRMVouchers()</linktext></link><link href="flash.net.xml#NetStream/setDRMAuthenticationCredentials()"><linktext>setDRMAuthenticationCredentials()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.DRMErrorEvent.DRM_ERROR_drmError"><apiName>drmError</apiName><shortdesc>
 Dispatched when a NetStream object, trying to play a digital rights management (DRM) encrypted
 file, encounters a DRM-related error.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.DRMErrorEvent.DRM_ERROR</apiEventType><adobeApiEventClassifier>flash.events.DRMErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when a NetStream object, trying to play a digital rights management (DRM) encrypted
 file, encounters a DRM-related error. For example, a DRMErrorEvent object is dispatched when 
 the user authorization fails. This may be because the user has not purchased the rights to view the content 
 or because the content provider does not support the viewing application.
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.events.xml#DRMErrorEvent"><linktext>flash.events.DRMErrorEvent</linktext></link><link href="flash.net.xml#NetStream/resetDRMVouchers()"><linktext>resetDRMVouchers()</linktext></link><link href="flash.net.xml#NetStream/setDRMAuthenticationCredentials()"><linktext>setDRMAuthenticationCredentials()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.DRMAuthenticateEvent.DRM_AUTHENTICATE_drmAuthenticate"><apiName>drmAuthenticate</apiName><shortdesc>
 Dispatched when a NetStream object tries to play a digital rights management (DRM) encrypted
 content that requires a user credential for authentication before playing.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.DRMAuthenticateEvent.DRM_AUTHENTICATE</apiEventType><adobeApiEventClassifier>flash.events.DRMAuthenticateEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when a NetStream object tries to play a digital rights management (DRM) encrypted
 content that requires a user credential for authentication before playing. 
 
 <p>
 Use the <codeph> setDRMAuthenticationCredentials()</codeph> method of the NetStream object
 to authenticate the user. If user authentication failed, the application will retry 
 authentication and dispatch a new DRMAuthenticateEvent event for the NetStream object.
 </p>
 
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.events.xml#DRMAuthenticateEvent"><linktext>flash.events.DRMAuthenticateEvent</linktext></link><link href="flash.net.xml#NetStream/resetDRMVouchers()"><linktext>resetDRMVouchers()</linktext></link><link href="flash.net.xml#NetStream/setDRMAuthenticationCredentials()"><linktext>setDRMAuthenticationCredentials()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onDRMContentData"><apiName>onDRMContentData</apiName><shortdesc>
 Establishes a listener to respond when AIR extracts DRM content metadata embedded in a media file.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier></adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Establishes a listener to respond when AIR extracts DRM content metadata embedded in a media file.
 
 <p>A DRMContentData object contains the information needed to obtain
 a voucher required to play a DRM-protected media file.  Use the DRMManager class to download the voucher with
 this information.</p>
 
 <p><codeph>onDRMContentData</codeph> is actually a property of the <codeph>NetStream.client</codeph>
 object. It isn't an event, but is listed in the Events section because it responds to a data
 event when preloading embedded data from a local media file. 
 For more information, see the NetStream class 
 description. You cannot use the <codeph>addEventListener()</codeph> method, or any
 other EventDispatcher methods, to listen for, or process <codeph>onDRMContentData</codeph> as an event. 
 Rather, you must define a single 
 callback function and attach it directly to one of the following objects:</p>
 <ul>
  <li>The object that the <codeph>client</codeph> property of a NetStream instance references.</li>    
  <li>An instance of a NetStream subclass. NetStream is a sealed class, which means that properties 
 or methods cannot be added to a NetStream object at runtime. However, you can create a subclass of 
 NetStream and define your event handler in the subclass or make the subclass dynamic and add the 
 event handler function to an instance of the subclass.</li>
 </ul>
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.drm.xml#DRMContentData"><linktext>flash.net.drm.DRMContentData</linktext></link><link href="flash.net.xml#NetStream/preloadEmbeddedData()"><linktext>preloadEmbeddedData()</linktext></link><link href="flash.net.drm.xml#DRMManager"><linktext>flash.net.drm.DRMManager</linktext></link><link href="flash.net.drm.xml#DRMVoucher"><linktext>flash.net.drm.DRMVoucher</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onPlayStatus"><apiName>onPlayStatus</apiName><shortdesc>
 Establishes a listener to respond when a NetStream object has completely played a stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier></adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Establishes a listener to respond when a NetStream object has completely played a stream.
 The associated event object provides information in addition to 
 what's returned by the <codeph>netStatus</codeph> event.
 You can use this property to trigger actions in your code when a NetStream object
 has switched from one stream to another stream in a playlist (as indicated by the 
 information object <codeph>NetStream.Play.Switch</codeph>)
 or when a NetStream object has played to the end (as indicated by the information object
 <codeph>NetStream.Play.Complete</codeph>). 
 
 <p><codeph>onPlayStaus</codeph> is actually a property of the <codeph>NetStream.client</codeph>
 object. It isn't an event, but is listed in the Events section because it responds to a data
 event, either when streaming media using Flash Media Server or during FLV file playback. For more information, see the NetStream class 
 description. You cannot use the <codeph>addEventListener()</codeph> method, or any
 other EventDispatcher methods, to listen for, or process <codeph>onPlayStatus</codeph> as an event. Rather, you must define a single 
 callback function and attach it directly to one of the following objects:</p>
 
 <ul>
  <li>The object that the <codeph>client</codeph> property of a NetStream instance references.</li>    
  <li>An instance of a NetStream subclass. NetStream is a sealed class, which means that properties or methods cannot be added to a NetStream object at runtime. However, you can create a subclass of NetStream and define your event handler in the subclass or make the subclass dynamic and add the event handler function to an instance of the subclass.</li>
    
 </ul>
 
 <p>This event can return an information object with the following properties:</p>
 
 <adobetable class="innertable">
  
  
  
   
 <tgroup cols="3"><thead><row><entry>Code property</entry><entry>Level property</entry><entry>Meaning</entry></row></thead><tbody><row>
    <entry><codeph>NetStream.Play.Switch</codeph></entry>
    <entry><codeph>"status"</codeph></entry>
    <entry>The subscriber is switching from one stream to another in a playlist.</entry>
  </row><row>
    <entry><codeph>NetStream.Play.Complete</codeph></entry>
    <entry><codeph>"status"</codeph></entry>
    <entry>Playback has completed.</entry>
  </row><row>
    <entry><codeph>NetStream.Play.TransitionComplete</codeph></entry>
    <entry><codeph>"status"</codeph></entry>
    <entry>The subscriber is switching to a new stream as a result of stream bit-rate switching</entry>
  </row></tbody></tgroup></adobetable>
 
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#NetStream/client"><linktext>client</linktext></link><link href="flash.events.xml#NetStatusEvent/NET_STATUS"><linktext>flash.events.NetStatusEvent.NET_STATUS</linktext></link><link href="flash.net.xml#NetStream/event:asyncError"><linktext>asyncError</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData"><linktext>onMetaData</linktext></link><link href="flash.net.xml#NetStream/event:onCuePoint"><linktext>onCuePoint</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onCuePoint"><apiName>onCuePoint</apiName><shortdesc>
 Establishes a listener to respond when an embedded cue point is reached while playing a video file.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier></adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Establishes a listener to respond when an embedded cue point is reached while playing a video file. You can use the listener to trigger actions in your 
 code when the video reaches a specific cue point, which lets you synchronize other actions in your application with video
 playback events. For information about video file formats supported by Flash Media Server, see 
 the <xref href="http://www.adobe.com/go/learn_fms_fileformats_en" scope="external">www.adobe.com/go/learn_fms_fileformats_en</xref>.

 
 <p><codeph>onCuePoint</codeph> is actually a property of the <codeph>NetStream.client</codeph>
 object. It isn't an event, but is listed in the Events section because it responds to a data
 event, either when streaming media using Flash Media Server or during FLV file playback. For more information, see the NetStream class 
 description. You cannot use the <codeph>addEventListener()</codeph> method, or any
 other EventDispatcher methods, to listen for, or process <codeph>onCuePoint</codeph> as an event. Rather, you must define a single 
 callback function and attach it directly to one of the following objects:</p>
 
 <ul>
  <li>The object that the <codeph>client</codeph> property of a NetStream instance references.</li>    
  <li>An instance of a NetStream subclass. NetStream is a sealed class, which means that properties or methods cannot be added to a NetStream object at runtime. However, you can create a subclass of NetStream and define your event handler in the subclass or make the subclass dynamic and add the event handler function to an instance of the subclass.</li>
    
 </ul>
 
 <p>The associated event listener is triggered after a call to the <codeph>NetStream.play()</codeph> method, but before the
 video playhead has advanced.</p>
 
 <p>The following types of cue points can be embedded in a video file:</p>
 
 <ul>
 <li>A navigation cue point specifies a keyframe within the video file 
 and the cue point's <codeph>time</codeph> property corresponds to that exact keyframe. Navigation cue points are often used as bookmarks
 or entry points to let users navigate through the video file.</li>
 
 <li>An event cue point is specified by time, whether or not that time corresponds to a specific keyframe. 
 An event cue point usually represents a time in the video when something happens that could be used to trigger other application events.</li>
 </ul>
 
 <p>The <codeph>onCuePoint</codeph> event object has the following properties:</p>
 
 <adobetable class="innertable">
 
 
 
 
 
 <tgroup cols="2"><thead><row><entry>Property</entry><entry>Description</entry></row></thead><tbody><row>
   <entry><codeph>name</codeph></entry>
   <entry>The name given to the cue point when it was embedded in the video file.</entry></row><row>
   <entry><codeph>parameters</codeph></entry>
   <entry>An associative array of name/value pair strings specified for this cue point. Any valid string can be used for 
     the parameter name or value.</entry>
 </row><row>
   <entry><codeph>time</codeph></entry>
   <entry>The time in seconds at which the cue point occurred in the video file during playback.</entry>
 </row><row>
   <entry><codeph>type</codeph></entry>
   <entry>The type of cue point that was reached, either navigation or event.</entry>
 </row></tbody></tgroup></adobetable>
 
 <p>You can define cue points in a video file when you first encode the file, or when you import a video clip in 
 the Flash authoring tool by using the Video Import wizard.</p>
 
 <p>The <codeph>onMetaData</codeph> event also retrieves information about the cue points in a video file. 
 However the <codeph>onMetaData</codeph> event gets information about all of the cue points 
 before the video begins playing. The <codeph>onCuePoint</codeph> event receives information about a single cue point 
 at the time specified for that cue point during playback.</p>
 
 <p>Generally, to have your code respond to a specific cue point at the time it occurs, use 
 the <codeph>onCuePoint</codeph> event to trigger some action in your code.</p>
 
 <p>You can use the list of cue points provided to the <codeph>onMetaData</codeph> event to 
 let the user start playing the video at predefined points along the video stream. 
 Pass the value of the cue point's <codeph>time</codeph> property to the 
 <codeph>NetStream.seek()</codeph> method to play the video from that cue point.</p>
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#NetStream/client"><linktext>client</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData"><linktext>onMetaData</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onTextData"><apiName>onTextData</apiName><shortdesc>
  Establishes a listener to respond when Flash Player receives text data embedded in a media file that is playing.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9.0.115.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier></adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
  Establishes a listener to respond when Flash Player receives text data embedded in a media file that is playing. 
  The text data
  is in UTF-8 format and can contain information about formatting based on the 3GP timed text specification.
  <p><codeph>onTextData</codeph> is actually a property of the <codeph>NetStream.client</codeph>
 object. It isn't an event, but is listed in the Events section because it responds to a data
 event, either when streaming media using Flash Media Server or during FLV file playback. For more information, 
 see the NetStream class 
 description. You cannot use the <codeph>addEventListener()</codeph> method, or any
 other EventDispatcher methods, to listen for, or process <codeph>onTextData</codeph> as an event. 
 Rather, you must define a single 
 callback function and attach it directly to one of the following objects:</p>
 
 <ul>
  <li>The object that the <codeph>client</codeph> property of a NetStream instance references.</li>    
  <li>An instance of a NetStream subclass. NetStream is a sealed class, which means that properties or 
 methods cannot be added to a NetStream object at runtime. However, you can create a subclass of 
 NetStream and define your event handler in the subclass or make the subclass dynamic and add the 
 event handler function to an instance of the subclass.</li>
    
 </ul>
 
 <p>The associated event listener is triggered after a call to the <codeph>NetStream.play()</codeph> method, but before the
 video playhead has advanced.</p>
  
  <p>The onTextData event object contains one property for each piece of text data.</p>
  
  </apiDesc><example conref="examples\OnTextDataExample.as"> The code in this example uses the <codeph>Netstream.client</codeph> property to handle 
 the callback functions for <codeph>onTextData</codeph> and <codeph>onImageData</codeph>. 
 The <codeph>onImageDataHandler()</codeph> function uses the onImageData event object 
 <codeph>imageData</codeph> to store the byte array. And, the <codeph>onTextDataHandler()</codeph> 
 function uses the onTextData event object <codeph>textData</codeph> to store the pieces of 
 text data (each piece of data is a property of the <codeph>textData</codeph> object).
 <p>You need to substitute a real location to a media file with text or image 
 metadata for the location <codeph>"yourURL"</codeph> in the code.</p>
 <p> You can also handle image and text data using a custom class. See the article 
 <xref href="http://www.adobe.com/devnet/flash/quickstart" scope="external">Handling metadata and cue points in Flash video</xref> for more information and examples.</p>
 <codeblock>
package {
    import flash.display.*;
    import flash.net.*;
    import flash.media.*;
    import flash.system.*;
    import flash.events.*;

        public class OnTextDataExample extends Sprite {
                                              
            public function OnTextDataExample():void {

                var customClient:Object = new Object();
                customClient.onImageData = onImageDataHandler;           
                customClient.onTextData = onTextDataHandler;               

                var my_nc:NetConnection = new NetConnection();
                my_nc.connect(null);
                var my_ns:NetStream = new NetStream(my_nc);
                my_ns.play("yourURL");
                my_ns.client = customClient;

                var my_video:Video = new Video();
                my_video.attachNetStream(my_ns);
                addChild(my_video);

            }

            public function onImageDataHandler(imageData:Object):void {

                trace("imageData length: " + imageData.data.length);
                var imageloader:Loader = new Loader();           
                imageloader.loadBytes(imageData.data); // imageData.data is a ByteArray object.
                addChild(imageloader);
            }

    
            public function onTextDataHandler(textData:Object):void {

                trace("--- textData properties ----");
                var key:String;

                for (key in textData) {
                    trace(key + ": " + textData[key]);
                }
            }

        }

}

</codeblock></example></adobeApiEventDetail><related-links><link href="flash.net.xml#NetConnection"><linktext>NetConnection</linktext></link><link href="flash.net.xml#NetStream/client"><linktext>client</linktext></link><link href="flash.net.xml#NetStream/event:asyncError"><linktext>asyncError</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStream/event:onImageData"><linktext>onImageData</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onImageData"><apiName>onImageData</apiName><shortdesc>
 Establishes a listener to respond when Flash Player receives image data as a byte array embedded in a media file that is
 playing.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9.0.115.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier></adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Establishes a listener to respond when Flash Player receives image data as a byte array embedded in a media file that is
 playing. The image data can produce either JPEG, PNG, or GIF content. Use the 
 <codeph>flash.display.Loader.loadBytes()</codeph> method to load the byte array into a display object.
 <p><codeph>onImageData</codeph> is actually a property of the <codeph>NetStream.client</codeph>
 object. It isn't an event, but is listed in the Events section because it responds to a data
 event, either when streaming media using Flash Media Server or during FLV file playback. For more information, see the NetStream class 
 description. You cannot use the <codeph>addEventListener()</codeph> method, or any
 other EventDispatcher methods, to listen for, or process <codeph>onImageData</codeph> as an event. Rather, you must define a single 
 callback function and attach it directly to one of the following objects:</p>
 
 <ul>
  <li>The object that the <codeph>client</codeph> property of a NetStream instance references.</li>    
  <li>An instance of a NetStream subclass. NetStream is a sealed class, which means that properties or methods cannot be added to a NetStream object at runtime. However, you can create a subclass of NetStream and define your event handler in the subclass or make the subclass dynamic and add the event handler function to an instance of the subclass.</li>
    
 </ul>
 
 <p>The associated event listener is triggered after a call to the <codeph>NetStream.play()</codeph> method, but before the
 video playhead has advanced.</p>
 
 <p>The onImageData event object contains the image data as a byte array sent through an AMF0 data channel.</p>
 
 </apiDesc><example conref="examples\OnTextDataExample.as"> The code in this example uses the <codeph>Netstream.client</codeph> property to handle 
 the callback functions for <codeph>onTextData</codeph> and <codeph>onImageData</codeph>. 
 The <codeph>onImageDataHandler()</codeph> function uses the onImageData event object 
 <codeph>imageData</codeph> to store the byte array. And, the <codeph>onTextDataHandler()</codeph> 
 function uses the onTextData event object <codeph>textData</codeph> to store the pieces of 
 text data (each piece of data is a property of the <codeph>textData</codeph> object).
 <p>You need to substitute a real location to a media file with text or image 
 metadata for the location <codeph>"yourURL"</codeph> in the code.</p>
 <p> You can also handle image and text data using a custom class. See the article 
 <xref href="http://www.adobe.com/devnet/flash/quickstart" scope="external">Handling metadata and cue points in Flash video</xref> for more information and examples.</p>
 <codeblock>
package {
    import flash.display.*;
    import flash.net.*;
    import flash.media.*;
    import flash.system.*;
    import flash.events.*;

        public class OnTextDataExample extends Sprite {
                                              
            public function OnTextDataExample():void {

                var customClient:Object = new Object();
                customClient.onImageData = onImageDataHandler;           
                customClient.onTextData = onTextDataHandler;               

                var my_nc:NetConnection = new NetConnection();
                my_nc.connect(null);
                var my_ns:NetStream = new NetStream(my_nc);
                my_ns.play("yourURL");
                my_ns.client = customClient;

                var my_video:Video = new Video();
                my_video.attachNetStream(my_ns);
                addChild(my_video);

            }

            public function onImageDataHandler(imageData:Object):void {

                trace("imageData length: " + imageData.data.length);
                var imageloader:Loader = new Loader();           
                imageloader.loadBytes(imageData.data); // imageData.data is a ByteArray object.
                addChild(imageloader);
            }

    
            public function onTextDataHandler(textData:Object):void {

                trace("--- textData properties ----");
                var key:String;

                for (key in textData) {
                    trace(key + ": " + textData[key]);
                }
            }

        }

}

</codeblock></example></adobeApiEventDetail><related-links><link href="flash.net.xml#NetConnection"><linktext>NetConnection</linktext></link><link href="flash.display.xml#Loader/loadBytes()"><linktext>flash.display.Loader.loadBytes()</linktext></link><link href="flash.net.xml#NetStream/client"><linktext>client</linktext></link><link href="flash.net.xml#NetStream/event:asyncError"><linktext>asyncError</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStream/event:onTextData"><linktext>onTextData</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onMetaData"><apiName>onMetaData</apiName><shortdesc>
 Establishes a listener to respond when Flash Player receives descriptive information embedded in the video being played.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier></adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Establishes a listener to respond when Flash Player receives descriptive information embedded in the video being played.
 For information about video file formats supported by Flash Media Server, see 
 the <xref href="http://www.adobe.com/go/learn_fms_fileformats_en" scope="external">www.adobe.com/go/learn_fms_fileformats_en</xref>.
 
 <p><codeph>onMetaData</codeph> is actually a property of the <codeph>NetStream.client</codeph>
 object. It isn't an event, but is listed in the Events section because it responds to a data
 event, either when streaming media using Flash Media Server or during FLV file playback.
 For more information, see the NetStream class description and the 
 <codeph>NetStream.client</codeph> property. You cannot use the <codeph>addEventListener()</codeph> 
 method, or any other EventDispatcher methods, to listen for or process 
 <codeph>onMetaData</codeph> as an event. Rather, you must define a single 
 callback function and attach it directly to one of the following objects:</p>
 
 <ul>
 
  <li>The object that the <codeph>client</codeph> property of a NetStream instance references.</li>    
 
  <li>An instance of a NetStream subclass. NetStream is a sealed class, which means that properties or methods cannot be added to a NetStream object at runtime. However, you can create a subclass of NetStream and define your event handler in the subclass or make the subclass dynamic and add the event handler function to an instance of the subclass.</li>
    
 </ul>
 
 <p>The Flash Video Exporter utility (version 1.1 or later) embeds
 a video's duration, creation date, data rates, and other information into the video file itself. 
 Different video encoders embed different sets of meta data.</p>
 
 <p>The associated event listener is triggered after a call to the <codeph>NetStream.play()</codeph> method, 
 but before the video playhead has advanced.</p>
 
 <p>In many cases, the duration value embedded in stream metadata approximates the actual duration 
 but is not exact. In other words, it does not always match the value of the <codeph>NetStream.time</codeph> property 
 when the playhead is at the end of the video stream.</p>
 <p>The event object passed to the onMetaData event handler contains one property for each piece of data.</p>
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#NetConnection"><linktext>NetConnection</linktext></link><link href="flash.net.xml#NetStream/client"><linktext>client</linktext></link><link href="flash.net.xml#NetStream/event:asyncError"><linktext>asyncError</linktext></link><link href="flash.net.xml#NetStream/event:onCuePoint"><linktext>onCuePoint</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStream/time"><linktext>time</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onXMPData"><apiName>onXMPData</apiName><shortdesc>
 Establishes a listener to respond when Flash Player receives information specific to Adobe 
 Extensible Metadata Platform (XMP) embedded in the video being played.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier></adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Establishes a listener to respond when Flash Player receives information specific to Adobe 
 Extensible Metadata Platform (XMP) embedded in the video being played.
 For information about video file formats supported by Flash Media Server, see 
 the <xref href="http://www.adobe.com/go/learn_fms_fileformats_en" scope="external">www.adobe.com/go/learn_fms_fileformats_en</xref>.
 
 <p><codeph>onXMPData</codeph> is actually a property of the <codeph>NetStream.client</codeph>
 object. It isn't an event, but is listed in the Events section because it responds to a data
 event, either when streaming media using Flash Media Server or during FLV file playback.
 For more information, see the NetStream class description and the 
 <codeph>NetStream.client</codeph> property. You cannot use the <codeph>addEventListener()</codeph> 
 method, or any other EventDispatcher methods, to listen for or process 
 <codeph>onMetaData</codeph> as an event. Rather, you must define a single 
 callback function and attach it directly to one of the following objects:</p>
 
 <ul>
  <li>The object that the <codeph>client</codeph> property of a NetStream instance references.</li>    
  <li>An instance of a NetStream subclass. NetStream is a sealed class, which means that properties or methods cannot be added to a NetStream object at runtime. However, you can create a subclass of NetStream and define your event handler in the subclass or make the subclass dynamic and add the event handler function to an instance of the subclass.</li>
    
 </ul>
 
 <p>The associated event listener is triggered after a call to the <codeph>NetStream.play()</codeph> method, 
 but before the video playhead has advanced.</p>
 
 <p>The object passed to the <codeph>onXMPData()</codeph> event handling function has one <codeph>data</codeph>
 property, which is a string. The string is generated from 
 a top-level UUID box. (The 128-bit UUID of the top level box is <codeph>BE7ACFCB-97A9-42E8-9C71-999491E3AFAC</codeph>.) This 
 top-level UUID box contains exactly one XML document represented as a null-terminated UTF-8 string.</p>
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#NetConnection"><linktext>NetConnection</linktext></link><link href="flash.net.xml#NetStream/client"><linktext>client</linktext></link><link href="flash.net.xml#NetStream/event:asyncError"><linktext>asyncError</linktext></link><link href="flash.net.xml#NetStream/event:onCuePoint"><linktext>onCuePoint</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStream/time"><linktext>time</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.NetStatusEvent.NET_STATUS_netStatus"><apiName>netStatus</apiName><shortdesc>
 Dispatched when a NetStream object is reporting its status or error condition.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.NetStatusEvent.NET_STATUS</apiEventType><adobeApiEventClassifier>flash.events.NetStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when a NetStream object is reporting its status or error condition. 
 The <codeph>netStatus</codeph> event contains an <codeph>info</codeph> property,
 which is an information object that contains specific information about the event, 
 such as if a connection attempt succeeded or failed.
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.events.xml#NetStatusEvent/info"><linktext>flash.events.NetStatusEvent.info</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.IOErrorEvent.IO_ERROR_ioError"><apiName>ioError</apiName><shortdesc>
 Dispatched when an input or output error occurs that causes a network operation to fail.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier>flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when an input or output error occurs that causes a network operation to fail. 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.AsyncErrorEvent.ASYNC_ERROR_asyncError"><apiName>asyncError</apiName><shortdesc>
 Dispatched when an exception is thrown asynchronously &amp;#x2014; that is, 
 from native asynchronous code.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.AsyncErrorEvent.ASYNC_ERROR</apiEventType><adobeApiEventClassifier>flash.events.AsyncErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when an exception is thrown asynchronously — that is, 
 from native asynchronous code. 
 This event is dispatched when a server calls a method on the client that is not defined.
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#NetStream/event:onPlayStatus"><linktext>NetStream.onPlayStatus</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData"><linktext>NetStream.onMetaData</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.StatusEvent.STATUS_status"><apiName>status</apiName><shortdesc>
 Dispatched when the application attempts to play content encrypted with digital rights management (DRM),
 by invoking the NetStream.play() method.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.StatusEvent.STATUS</apiEventType><adobeApiEventClassifier>flash.events.StatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when the application attempts to play content encrypted with digital rights management (DRM),
 by invoking the <codeph>NetStream.play()</codeph> method. The value of the status code property will be 
 <codeph>"DRM.encryptedFLV"</codeph>. 
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#NetStream/play()"><linktext>NetStream.play()</linktext></link></related-links></adobeApiEvent><apiConstructor id="flash.net:NetStream:NetStream"><apiName>NetStream</apiName><shortdesc>
 	 Creates a stream that can be used for playing video files through the specified NetConnection 
	 object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream, constructor
 	 </keyword></asCustoms></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/><apiException><apiDesc>The NetConnection instance is not connected.
 	 
 	 </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiParam><apiItemName>connection</apiItemName><apiOperationClassifier>flash.net:NetConnection</apiOperationClassifier><apiDesc>A NetConnection object.
     </apiDesc></apiParam><apiParam><apiItemName>peerID</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>connectToFMS</apiData><apiDesc>This parameter is optional.
     It is available with Flash Player 10 and later.
     Set the value to <codeph>NetStream.CONNECT_TO_FMS</codeph> for a connection to FMS. 
     For publishing directly to peers, specify <codeph>NetStream.DIRECT_CONNECTIONS</codeph>.
     To play directly from a specific peer, specify that peer's identity (see <codeph>NetConnection.nearID</codeph> and 
     <codeph>NetConnection.farID</codeph>).
     The <codeph>NetConnection.protocol</codeph> property value must be <codeph>"rtmfp"</codeph> if the <codeph>peerID</codeph> parameter
     is set to a peer. The <codeph>peerID</codeph> parameter is ignored for non-RTMFP connections. ActionScript uses a default value 
     <codeph>"connectToFMS"</codeph> for the <codeph>peerID</codeph> parameter to catch when a null value is passed as the parameter to 
     the NetStream() method, programmatically.
     <p>However, since the <codeph>peerID</codeph> parameter is optional, the following continues to work for progressive playback
     over a client-server connection:</p>
     <codeblock>
     new NetStream(nc:NetConnection);
     </codeblock>
	 
	 </apiDesc></apiParam></apiConstructorDef><apiDesc>
 	 Creates a stream that can be used for playing video files through the specified NetConnection 
	 object. 
     
     <p>
     For information about supported codecs and file formats, see <xref href="http://www.adobe.com/go/hardware_scaling_en" scope="external">http://www.adobe.com/go/hardware_scaling_en</xref>
     and the <xref href="http://www.adobe.com/go/learn_fms_fileformats_en" scope="external">www.adobe.com/go/learn_fms_fileformats_en</xref>.
     </p>
	 
 	 </apiDesc><example conref="examples\NetStreamExample_constructor.as"> The following code shows a connection to download and display, progressively, a video assigned to the 
 variable <codeph>videoURL</codeph>:
<codeblock>
            var my_nc:NetConnection = new NetConnection();
            my_nc.connect(null);
            var my_ns:NetStream = new NetStream(my_nc);
            my_ns.play(videoURL);
            var my_video:Video = new Video();
            my_video.attachNetStream(my_ns);
            addChild(my_video);
</codeblock></example><example conref="examples\NetStreamExample_constructor2.as"> The following code shows a connection to stream and display a video (assigned to the 
 variable <codeph>videoURL</codeph>) on a remote Flash Media Server instance specified in the <codeph>connect()</codeph>
 command:
<codeblock>
            var my_nc:NetConnection = new NetConnection();
            my_nc.connect("rtmp://www.yourfmsserver.com/someappname");
            var my_ns:NetStream = new NetStream(my_nc, NetStream.CONNECT_TO_FMS);
            my_ns.play(videoURL);
            var my_video:Video = new Video();
            my_video.attachNetStream(my_ns);
            addChild(my_video);
</codeblock></example></apiConstructorDetail><related-links><link href="flash.net.xml#NetConnection"><linktext>flash.net.NetConnection</linktext></link><link href="flash.media.xml#Video/attachCamera()"><linktext>flash.media.Video.attachCamera()</linktext></link><link href="flash.net.xml#NetStream/CONNECT_TO_FMS"><linktext>CONNECT_TO_FMS</linktext></link><link href="flash.net.xml#NetStream/DIRECT_CONNECTIONS"><linktext>DIRECT_CONNECTIONS</linktext></link><link href="flash.net.xml#NetConnection/nearID"><linktext>flash.net.NetConnection.nearID</linktext></link><link href="flash.net.xml#NetConnection/farID"><linktext>flash.net.NetConnection.farID</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:NetStream:attachAudio"><apiName>attachAudio</apiName><shortdesc>
	 Specifies an audio stream sent over the NetStream object, from a Microphone
	 object passed as the source.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiDefaultValue>"null" 
	 </apiDefaultValue><apiParam><apiItemName>microphone</apiItemName><apiOperationClassifier>flash.media:Microphone</apiOperationClassifier><apiDesc>The source of the audio stream to be transmitted.
     
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Specifies an audio stream sent over the NetStream object, from a Microphone
	 object passed as the source. This method is available 
	 only to the publisher of the specified stream.
	 
	 <p>The <codeph>attachAudio</codeph> method is intended for use with Flash Media Server. 
     This method is often called by a user sending live audio 
	 (or live video with audio) from a client computer to the server.
	 </p>
	 
	 <p>You can call this method before or after you call the <codeph>publish()</codeph> method
	 and actually begin transmitting. Subscribers who want to hear the audio must call
     the <codeph>NetStream.play()</codeph> method. Set the microphone's <codeph>rate</codeph> to match
     that of the sound capture device, and set the silence level threshold via the <codeph>setSilenceLevel()</codeph>
     method. You can control the sound properties (volume and panning) of
     this audio stream through the microphone object's <codeph>soundTransform</codeph> property.</p>
     <codeblock>
     var conn:NetConnection = new NetConnection();
     conn.connect("rtmp://server.domain.com/path");
     var stream:NetStream = new NetStream(conn);
     var live_mic:Microphone = Microphone.get();
     live_mic.rate = 8;
     live_mic.setSilenceLevel(20,200);
     var soundTrans:SoundTransform = new SoundTransform();
     soundTrans.volume = 6;
     live_mic.soundTransform = soundTrans;
     stream.attachAudio(live_mic);
     stream.publish("mic_stream","live")
     </codeblock>
	 
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.media.xml#Microphone"><linktext>flash.media.Microphone</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:attachCamera"><apiName>attachCamera</apiName><shortdesc>
	 Starts capturing video from a camera, or stops capturing if 
	 theCamera is set to null.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>theCamera</apiItemName><apiOperationClassifier>flash.media:Camera</apiOperationClassifier><apiDesc>The source of the video transmission. Valid values are a Camera object
	 (which starts capturing video) and <codeph>null</codeph>. If you pass <codeph>null</codeph>, 
	 the application stops capturing video, and any additional parameters you send are ignored. 
	 
	 </apiDesc></apiParam><apiParam><apiItemName>snapshotMilliseconds</apiItemName><apiOperationClassifier>int</apiOperationClassifier><apiData>-1</apiData><apiDesc>Specifies whether the video stream is continuous, 
	 a single frame, or a series of single frames used to create time-lapse photography.
	 
	 <ul>
     <li>If you omit this parameter, the application captures all video until you pass
	 a value of <codeph>null</codeph> to <codeph>attachCamera</codeph>.</li>
	 <li>If you pass 0, the application captures only a single video frame. Use this value
	 to transmit "snapshots" within a preexisting stream. <ph platform="actionscript">Flash Player 
	 or </ph> AIR interprets invalid, negative, or nonnumeric arguments as 0.</li>
     <li>If you pass a positive number, the application captures a single video frame and then appends a pause 
     of the specified length as a trailer on the snapshot. Use this value to create time-lapse 
     photography effects.</li>
	 </ul>
	 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Starts capturing video from a camera, or stops capturing if 
	 <codeph>theCamera</codeph> is set to <codeph>null</codeph>.
	 This method is available only to the publisher of the specified stream. 
	 
     <p>This method is intended for use with Flash Media Server;
	 for more information, see the class description.</p>
	 
	 <p> After attaching the video source, you must call <codeph>NetStream.publish()</codeph> 
	 to begin transmitting. Subscribers who want to display the video
	 must call the <codeph>NetStream.play()</codeph> and <codeph>Video.attachCamera()</codeph> methods
     to display the video on the stage.</p>
	 
	 <p>You can use <codeph>snapshotMilliseconds</codeph> to send a single snapshot
	 (by providing a value of 0) or a series of snapshots — in effect,
	 time-lapse footage — by providing a positive number that adds a trailer
	 of the specified number of milliseconds to the video feed. The trailer
     extends the display time of the video message. By repeatedly
	 calling <codeph>attachCamera()</codeph> with a positive value for <codeph>snapshotMilliseconds</codeph>, 
     the sequence of alternating snapshots and trailers creates time-lapse footage.
	 For example, you could capture one frame per day and append it to a video file.
	 When a subscriber plays the file, each frame remains onscreen for the specified
	 number of milliseconds and then the next frame is displayed.</p>
	 
	 <p>The purpose of the <codeph>snapshotMilliseconds</codeph> parameter is different
	 from the <codeph>fps</codeph> parameter you can set with <codeph>Camera.setMode()</codeph>. When you specify
	 <codeph>snapshotMilliseconds</codeph>, you control how much time elapses between recorded frames. When 
     you specify <codeph>fps</codeph> using <codeph>Camera.setMode()</codeph>, you are 
	 controlling how much time elapses during recording and playback.</p>
	 
	 <p>For example, suppose you want to take a snapshot every 5 minutes for a total
	 of 100 snapshots. You can do this in two ways:</p>
     
	 <ul>
	 <li>You can issue a <codeph>NetStream.attachCamera(myCamera, 500)</codeph> command
	 100 times, once every 5 minutes. This takes 500 minutes to record, but the resulting file
	 will play back in 50 seconds (100 frames with 500 milliseconds between frames).</li> 
	 
	 <li>You can issue a <codeph>Camera.setMode()</codeph> command with an <codeph>fps</codeph> value
	 of 1/300 (one per 300 seconds, or one every 5 minutes), and then issue a 
	 <codeph>NetStream.attachCamera(source)</codeph> command, letting the camera capture continuously
	 for 500 minutes. The resulting file will play back in 500 minutes — the same length of time
	 that it took to record — with each frame being displayed for 5 minutes.</li>
	 </ul>
     
	 <p>Both techniques capture the same 500 frames, and both approaches are useful;
	 the approach to use depends primarily on your playback requirements. For example, 
	 in the second case, you could be recording audio the entire time. Also, both files 
	 would be approximately the same size.</p>
	 
	 </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetStream:close"><apiName>close</apiName><shortdesc>
	 Stops playing all data on the stream, sets the time property to 0,
	 and makes the stream available for another use.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.close, close
	 </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
	 Stops playing all data on the stream, sets the <codeph>time</codeph> property to 0,
	 and makes the stream available for another use. This method also deletes the local copy
	 of a video file that was downloaded through HTTP. Although the application deletes the
	 local copy of the file that it creates, a copy might persist in the 
	 cache directory. If you must completely prevent caching or local storage of the video file,
     use Flash Media Server.
     
     <p>
     When using Flash Media Server, this method is invoked implicitly when you call
     <codeph>NetStream.play()</codeph> from a publishing stream or
     <codeph>NetStream.publish()</codeph> from a subscribing stream.
     Please note that:
     </p>
     
     <ul>
     <li>
     If <codeph>close()</codeph> is called from a publishing stream, the stream
     stops publishing and the publisher can now use the stream for another purpose.
     Subscribers no longer receive anything that was being published on the stream,
     because the stream has stopped publishing. 
     </li>
     <li>
     If <codeph>close()</codeph> is called from a subscribing stream, the stream
     stops playing for the subscriber, and the subscriber can use the stream for 
     another purpose.  Other subscribers are not affected.
     </li>
     <li>
     You can stop a subscribing stream from playing, without closing the stream
     or changing the stream type by using <codeph>flash.net.NetStream.play(false)</codeph>.
     </li>
     </ul>
     
     
	 
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetStream/pause()"><linktext>pause()</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStream/publish()"><linktext>publish()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:onPeerConnect"><apiName>onPeerConnect</apiName><shortdesc>
	 
     Invoked when a peer-publishing stream matches a peer-subscribing stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiOperationClassifier>Boolean</apiOperationClassifier></apiReturn><apiParam><apiItemName>subscriber</apiItemName><apiOperationClassifier>flash.net:NetStream</apiOperationClassifier></apiParam></apiOperationDef><apiDesc>
	 
     Invoked when a peer-publishing stream matches a peer-subscribing stream. Before the subscriber is
     connected to the publisher, call this method to allow the ActionScript code fine access control for
     peer-to-peer publishing. The following code shows an example of how to create a callback function for this method:
     <codeblock>
	 var c:Object = new Object;
	 c.onPeerConnect = function(subscriber:NetStream):Boolean {
	 if (accept)
	 	return true;
	  else
	      return false;
	  };
	  m_netStream.client = c;
     </codeblock>
     
     <p>If a peer-publisher does not implement this method, all peers are allowed to play any published content.</p>
	 
	 
	 </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetStream:pause"><apiName>pause</apiName><shortdesc>
	 Pauses playback of a video stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.pause, pause
	 
	 </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
	 Pauses playback of a video stream. Calling this method does nothing if the video 
	 is already paused. To resume play after pausing a video, call <codeph>resume()</codeph>. 
	 To toggle between pause and play (first pausing the video, then resuming), call 
	 <codeph>togglePause()</codeph>.
	 
	 <p>Starting with Flash Player 9.0.115.0, Flash Player no longer clears the buffer
	 when <codeph>NetStream.pause()</codeph> is called. Before Flash Player 9.0.115.0, Flash Player 
	 waited for the buffer to fill up before resuming playback, which often caused a delay.</p>
	 
	 <p>For a single pause, the <codeph>NetStream.bufferLength</codeph> property has a limit of either 60 seconds
	 or twice the value of <codeph>NetStream.bufferTime</codeph>, whichever value is higher. For example, if
	 <codeph>bufferTime</codeph> is 20 seconds, Flash Player buffers until <codeph>NetStream.bufferLength</codeph>
	 is the higher value of either 20~~2 (40), or 60, so in this case it buffers until <codeph>bufferLength</codeph> is 60. 
	 If <codeph>bufferTime</codeph> is 40 seconds, Flash Player buffers until <codeph>bufferLength</codeph> is the higher value 
	 of 40~~2 (80), or 60, so in this case it buffers until <codeph>bufferLength</codeph> is 80 seconds.</p>
	 
	 <p>The <codeph>bufferLength</codeph> property also has an absolute limit. 
	 If any call to <codeph>pause()</codeph> causes <codeph>bufferLength</codeph>
	 to increase more than 600 seconds or the value of <codeph>bufferTime</codeph> ~~ 2, whichever is higher, Flash Player
	 flushes the buffer and resets <codeph>bufferLength</codeph> to 0. For example, if 
	 <codeph>bufferTime</codeph> is 120 seconds, Flash Player flushes the buffer
	 if <codeph>bufferLength</codeph> reaches 600 seconds; if <codeph>bufferTime</codeph> is 360 seconds, 
	 Flash Player flushes the buffer if <codeph>bufferLength</codeph> reaches 720 seconds.</p>
	 
	 <p><b>Tip</b>: You can use <codeph>NetStream.pause()</codeph> in code to buffer data while viewers are watching 
	 a commercial, for example, and then unpause when the main video starts.</p>
	 
	 
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetStream/close()"><linktext>close()</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStream/resume()"><linktext>resume()</linktext></link><link href="flash.net.xml#NetStream/togglePause()"><linktext>togglePause()</linktext></link><link href="flash.net.xml#NetStream/bufferLength"><linktext>bufferLength</linktext></link><link href="flash.net.xml#NetStream/bufferTime"><linktext>bufferTime</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:play"><apiName>play</apiName><shortdesc>
     Plays media files.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>"at"see flash.media.Video#attachVideo()  This method no longer exists.  Replace with new method.
	 </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Local untrusted SWF files cannot communicate with
	 the Internet. You can work around this restriction by reclassifying this SWF file
	 as local-with-networking or trusted.
	 
	 </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>At least one parameter must be specified.
	 
	 </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiException><apiDesc>The NetStream Object is invalid.  This may be due to a failed NetConnection.
	 
	 </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>arguments</apiItemName><apiType value="restParam"/><apiDesc>The location of the media file to play as a string, a <codeph>URLRequest.url</codeph> 
     property, or a variable referencing either. In <ph platform="actionscript">Flash Player and in</ph> AIR content outside of the application 
	 security sandbox, you can play local video files that are stored in the same directory as the SWF file or in a 
	 subdirectory; however, you can't navigate to a higher-level directory.
	 
	 <p>
	 With Flash Media Server, <codeph>play()</codeph> takes the following arguments:
	 </p>
	 <adobetable class="innertable">
	 
	 
	 
	 
	 
	 <tgroup cols="3"><thead><row><entry>Name</entry><entry>Required</entry><entry>Description</entry></row></thead><tbody><row>
	   <entry><codeph>name:Object</codeph></entry>
	   <entry>Required </entry>
       <entry> The name of a recorded file, 
	        an identifier for live data published by <codeph>NetStream.publish()</codeph>,
            or <codeph>false</codeph>. 
	        If <codeph>false</codeph>, the stream stops playing and any additional parameters
            are ignored. For more information on the filename syntax, see the file format table following this table.</entry>
	 </row><row>
	   <entry><codeph>start:Number</codeph></entry>
	   <entry>Optional</entry>
	   <entry> The start time, in seconds. Allowed values are -2, -1, 0,
	        or a positive number. The default value is -2, which looks
	        for a live stream, then a recorded stream, and if it finds
	        neither, opens a live stream. If -1, plays only a live stream.
	        If 0 or a positive number, plays a recorded stream, beginning
	        <codeph>start</codeph> seconds in.
	   </entry>
	 </row><row>
	   <entry> <codeph>len:Number</codeph> </entry>
	   <entry> Optional if <codeph>start</codeph> is specified. </entry>
	   <entry> The duration of the playback, in seconds. 
	        Allowed values are -1, 0, or a positive number.
	        The default value is -1, 
	        which plays a live or recorded stream until it ends.
	        If 0, plays a single frame that is 
	        <codeph>start</codeph>
	        seconds from the beginning of a recorded stream.
	        If a positive number, plays a live or recorded stream for
	        <codeph>len</codeph> seconds.
	   </entry>
	 </row><row>
	   <entry> <codeph>reset:Object</codeph> </entry>
	   <entry> Optional if <codeph>len</codeph> is specified. </entry>
	   <entry> Whether to clear a playlist.
	        The default value is 1 or <codeph>true</codeph>, which clears any previous
	        <codeph>play</codeph> calls and plays <codeph>name</codeph> immediately.
	        If 0 or <codeph>false</codeph>, adds the stream to a playlist.
	        If 2, maintains the playlist and returns all stream 
	        messages at once, rather than at intervals.
	        If 3, clears the playlist and returns all stream messages
	        at once.  </entry>
	 </row></tbody></tgroup></adobetable>
	 
     <p>
     You can play back the file formats described in the following table. The syntax differs depending on the file format.</p>
     <p>
     <adobetable class="innertable">
     
     
     
     
     <tgroup cols="3"><thead><row><entry>File format</entry><entry>Syntax</entry><entry>Example</entry></row></thead><tbody><row>
     <entry>FLV</entry>
     <entry>Specify the stream name as a string without a filename extension.</entry>
     <entry><codeph>ns.play("myflvstream");</codeph></entry>
     </row><row>
     <entry>MP3 or ID3</entry>
     <entry>Specify the stream name as a string with the prefix <codeph>mp3:</codeph> or <codeph>id3:</codeph> and without a filename extension.</entry>
     <entry><codeph>ns.play("mp3:mymp3stream");</codeph>
     	<codeph>ns.play("id3:myid3data");</codeph></entry>
     </row><row>
     <entry>MPEG-4-based files (such as F4V and MP4)</entry>
      <entry>Specify the stream name as a string with the prefix <codeph>mp4:</codeph> with or without the filename extension. 
     The prefix indicates to the server that the file contains H.264-encoded video and AAC-encoded audio within
     the MPEG-4 Part 14 container format. If the file on the server has a filename extension, specify a filename extension. If 
      a filename extension was specified in the <codeph>publish()</codeph> method, specify a filename extension.</entry>
     <entry><codeph>ns.play("mp4:myvideo.f4v")</codeph>
     	<codeph>ns.play("mp4:myvideo.mp4")</codeph>
          <codeph>ns.play("mp4:myvideo")</codeph></entry>
     </row></tbody></tgroup></adobetable>
     </p>
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
     Plays media files. 
     
     <p>
     For information about supported codecs and file formats, see <xref href="http://www.adobe.com/go/hardware_scaling_en" scope="external">http://www.adobe.com/go/hardware_scaling_en</xref>
     and the <xref href="http://www.adobe.com/go/learn_fms_fileformats_en" scope="external">www.adobe.com/go/learn_fms_fileformats_en</xref>.</p>
     
	 <p>To view video data, create a
     Video object and call the <codeph>Video.attachNetStream()</codeph> method. 
     To stream audio from a microphone, use the <codeph>NetStream.attachAudio()</codeph> method.
     You can use the Microphone object to control some aspects of the audio.</p>
	 
	 <p>Call the
	 <codeph>DisplayObjectContainer.addChild()</codeph> method to route audio
     to an object on the display list. Then you can create a  
	 Sound object to control some aspects of the audio. For more information, see the 
	 <codeph>DisplayObjectContainer.addChild()</codeph> method.</p>
	 
	 <p>If the video file cannot be found, the <codeph>NetStatusEvent</codeph> object is 
	 dispatched.</p>
	 
     <p>When you use this method without Flash Media Server, there are security considerations. A file in the local-trusted or 
     local-with-networking sandbox can load and play a video file from the remote sandbox, but cannot access  
     the remote file's data without explicit permission in the form of a URL policy file.
	 <ph platform="actionscript">Also, you can prevent a SWF file running in Flash Player from using this method 
	 by setting the <codeph>allowNetworking</codeph> parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> 
	 tags in the HTML page that contains the SWF content.</ph></p>
	 
      <p>You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     <ph product="flex">
     <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     </ph>
     <ph product="flash">
     <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     </ph>
      of the <i>Programming ActionScript 3.0</i> book.</p>
     
      <p>You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     <ph product="flex">
     <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     </ph>
     <ph product="flash">
     <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     </ph>
      of the <i>Programming ActionScript 3.0</i> book.</p>
     
	 <p>For more information related to security, see the following:</p>
	 
     <ul>
     
     <li product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     <li product="flash">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
     <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     <li>The <codeph>NetStream.checkPolicyFile</codeph> property.</li>
     </ul>
     
	 
     </apiDesc><example><b>Flash Media Server</b>
     This example plays a recorded F4V file, starting at
	 the beginning, for up to 100 seconds. For MPEG-4 files, if the file on the server has a
     filename extension, specify one in the <codeph>play()</codeph> method. 
	 <codeblock>
     ns.play("mp4:record1.f4v", 0, 100, true);
	 </codeblock>
	 
	 </example></apiOperationDetail><related-links><link href="flash.display.xml#DisplayObjectContainer/addChild()"><linktext>DisplayObjectContainer.addChild()</linktext></link><link href="flash.net.xml#NetStream/checkPolicyFile"><linktext>checkPolicyFile</linktext></link></related-links><adobeApiEvent id="flash.net:NetStream:play_status"><apiName>status</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:StatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when attempting to play content encrypted with
	 digital rights management (DRM). The value of the <codeph>code</codeph> property is 
	 <codeph>"DRM.encryptedFLV"</codeph>.
	 
     </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when attempting to play content encrypted with
	 digital rights management (DRM).</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:NetStream:play2"><apiName>play2</apiName><shortdesc>
     Begins playback of media files, with several options for playback.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>param</apiItemName><apiOperationClassifier>flash.net:NetStreamPlayOptions</apiOperationClassifier></apiParam></apiOperationDef><apiDesc>
     Begins playback of media files, with several options for playback.
     
     <p>This method is an enhanced version of <codeph>NetStream.play()</codeph>. Like the <codeph>play()</codeph> method, the <codeph>play2()</codeph> method begins 
     playback of a media file or queues up media files to create a playlist. When used with Flash Media Server, it can also
     request that the server switch to a different media file. The transition occurs seamlessly in the client application.</p> 
     
     <p>Use the <codeph>play2()</codeph> method to switch to a stream with the same content encoded at a different bit rate
     or to swap out streams from a playlist. Use the <codeph>NetStreamInfo</codeph> class to monitor network conditions and
     switch streams based on the data. You can also switch streams for clients with different capabilities.
     Using ActionScript to switch streams is called <i>dynamic streaming</i>. For more information, search for "dynamic streaming" in the 
     "Adobe Flash Media Server Developer Guide" at <xref href="http://www.adobe.com/go/learn_fms_devguide_en">www.adobe.com/go/learn_fms_devguide_en</xref>.
     Adobe built a custom ActionScript class called DynamicStream that extends the NetStream class. You can use the DynamicStream class
     to implement dynamic streaming in an application instead of writing your own code to detect network conditions. Even if you choose to write your own
     dynamic streaming code, refer to the DynamicStream class to see a working implementation. Download the class and the class documentation at 
     <xref href="http://www.adobe.com/go/fms_tools">www.adobe.com/go/fms_tools</xref>.</p>
	 
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStreamPlayOptions"><linktext>NetStreamPlayOptions</linktext></link><link href="flash.net.xml#NetStreamPlayTransitions"><linktext>NetStreamPlayTransitions</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:preloadEmbeddedData"><apiName>preloadEmbeddedData</apiName><shortdesc>
	 Extracts any DRM metadata from a locally stored media file.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>param</apiItemName><apiOperationClassifier>flash.net:NetStreamPlayOptions</apiOperationClassifier><apiDesc>A NetStreamPlayOptions describing the options to use while processing the content file.
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Extracts any DRM metadata from a locally stored media file.
	 
	 <p>Use <codeph>preloadEmbeddedMetaData()</codeph> as the first step in downloading and caching the DRM vouchers
	 needed for offline playback. When embedded DRM metadata is detected in a media file, a DRMContentData object is passed 
	 to the NetStream client <codeph>onDRMContentData</codeph> function. This DRMContentData object contains the information 
	 needed to obtain the voucher required to play the content. Pass the DRMContentDataObject to the DRMManager 
	 <codeph>loadVoucher()</codeph> method to download the voucher.</p>
	 
	 <p>The steps for preloading a DRM voucher include:</p>
	 <ul>
	 <li>
	 <p>Create a new NetStream object for preloading the metadata.</p>
	 </li>
	 <li>Assign a callback function to the <codeph>onDRMContentData</codeph> property of the NetStream <codeph>client</codeph>.</li>
	 <li>Create a new NetStreamPlayOptions object and set its <codeph>streamName</codeph> property to the the URL string of the local video file.</li>
	 <li>Call <codeph>preloadEmbeddedMetadata()</codeph>, passing in the NetStreamPlayOptions object.</li>
	 <li>In response to the <codeph>onDRMContentData</codeph> callback, call the DRMManager <codeph>loadVoucher()</codeph> method, passing
	 in the DRMContentData object. If the <codeph>authenticationMethod</codeph> property of the DRMContentData object has the value,
	 <codeph>userNameAndPassWord</codeph>, then you must authenticate the user on the media rights server before loading the voucher.</li>
	 <li>Close the NetStream used for preloading.</li> 
	 </ul>
	 
	 <p><b>Note:</b> If you use the same NetStream object to both preload metadata and play content, you must
	 wait for the <codeph>onPlayStatus</codeph> call generated by the preload operation before starting playback.</p>
	 
	 <p>Downloaded vouchers are stored in a local cache. Playing content online also downloads and
	 caches vouchers. When a DRM-protected content file is viewed, a cached
	 voucher is retrieved from the local store automatically. Use the DRMManager to manage the 
	 voucher cache.</p>
	   
	 <p><b>Notes:</b> Preloading DRM metadata through HTTP, HTTPS, or RTMP connections is not supported. You can only
	 preload metadata from files stored on the file system.</p>
	 
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetStream/event:onDRMContentData"><linktext>onDRMContentData</linktext></link><link href="flash.net.drm.xml#DRMContentData"><linktext>flash.net.drm.DRMContentData</linktext></link><link href="flash.net.drm.xml#DRMManager/loadVoucher()"><linktext>flash.net.drm.DRMManager.loadVoucher()</linktext></link><link href="flash.net.drm.xml#DRMVoucher"><linktext>flash.net.drm.DRMVoucher</linktext></link><link href="flash.net.xml#NetStream/client"><linktext>client</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:publish"><apiName>publish</apiName><shortdesc>
	 Sends streaming audio, video, and text messages from a client to Flash Media Server, 
     optionally recording the stream during transmission.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>name</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>A string that identifies the stream. Clients that subscribe to this stream must pass 
	 this same name
     when they call <codeph>NetStream.play()</codeph>. Don't follow the stream name with a "/". For example, don't use
     the stream name <codeph>"bolero/"</codeph>. 
     
     <p>
     You can publish files in the formats described in the following table. The syntax differs depending on the file format.</p>
     <p>
     <adobetable class="innertable">
     
     
     
     
     <tgroup cols="3"><thead><row><entry>File format</entry><entry>Syntax</entry><entry>Example</entry></row></thead><tbody><row>
     <entry>FLV</entry>
     <entry>Specify the stream name as a string, without a filename extension.</entry>
     <entry><codeph>ns.publish("myflvstream");</codeph></entry>
     </row><row>
     <entry>MP3 or ID3</entry>
     <entry>Specify the stream name as a string with prefix <codeph>mp3:</codeph> or <codeph>id3:</codeph>and without a filename extension.</entry>
     <entry><codeph>ns.publish("mp3:mymp3stream");</codeph>
         <codeph>ns.publish("id3:myid3data");</codeph></entry>
     </row><row>
     <entry>MPEG-4-based files (such as F4V and MP4)</entry>
     <entry>Specify the stream name as a string with the prefix <codeph>mp4:</codeph> with or without the filename extension. 
     The prefix indicates to the server that the file contains H.264-encoded video and AAC-encoded audio within
     the MPEG-4 Part 14 container format.</entry>
     <entry><codeph>ns.publish("mp4:myvideo.f4v")</codeph>
         <codeph>ns.publish("mp4:myvideo.mp4");</codeph>
         <codeph>ns.publish("mp4:myvideo");</codeph></entry>
     </row></tbody></tgroup></adobetable>
     </p>     
	 
	 </apiDesc></apiParam><apiParam><apiItemName>type</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>A string that specifies how to publish the stream. 
	 Valid values are "<codeph>record</codeph>", "<codeph>append</codeph>", and "<codeph>live</codeph>".
	 The default value is "<codeph>live</codeph>".
	 <ul>
	 <li>If you pass "<codeph>record</codeph>", Flash Media Server publishes and records live data,
	 saving the recorded data to a new file with a name matching the value passed
	 to the <codeph>name</codeph> parameter. If the file exists, it is overwritten.</li>
	 <li>If you pass "<codeph>append</codeph>", Flash Media Server publishes and records live data, 
	 appending the recorded data to a file with a name that matches the value passed
	 to the <codeph>name</codeph> parameter. If no file matching the <codeph>name</codeph> parameter is found, it is created. </li>
	 <li>If you omit this parameter or pass "<codeph>live</codeph>", Flash Media Server publishes live data without
	 recording it. If a file with a name that matches the value passed
	 to the <codeph>name</codeph> parameter exists, it is deleted.</li>
	 </ul>
	 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Sends streaming audio, video, and text messages from a client to Flash Media Server, 
     optionally recording the stream during transmission. 
	 This method is available only to the publisher of the specified stream.
	 
	 <p>You can record files in FLV or MPEG-4 format. If you record a file in MPEG-4 format, 
     you must use a flattener tool to edit or play the file in another application.
     To download the tool, see 
     <xref href="http://www.adobe.com/go/fms_tools" scope="external">www.adobe.com/go/fms_tools</xref>.</p>
     
     <p>Do not use this method to play a stream
     that has already been published and recorded. 
     To play a stream, call the <codeph>NetStream.play()</codeph> method.</p>
	 
	 <codeblock platform="actionscript">
	 var subscribeNS:NetStream = new NetStream(myNetConnection);
	 subscribeNS.play("streamToPlay");
	 </codeblock>
	 
	 <codeblock platform="javascript">
	 var subscribeNS = new air.NetStream(myNetConnection);
	 subscribeNS.play("streamToPlay");
	 </codeblock>
	 
     <p>When Flash Media Server records a stream it creates a file
     and stores it in a subdirectory in the application's directory
     on the server. Each stream is stored in a directory whose name matches the
     application instance name passed to <codeph>NetConnection.connect()</codeph>.
     The server creates these directories automatically. For example, the following code
     connects to the "lectureseries" application and records a stream called "lecture". 
     The file "lecture.flv" is recorded in the applications/lectureseries/streams/_definst_ directory:
     </p>
     
     <codeblock platform="actionscript">
     var myNC:NetConnection = new NetConnection();
     myNC.connect("rtmp://fms.example.com/lectureseries");
     var myNS:NetStream = new NetStream(myNC);
     myNS.publish("lecture", "record");
     </codeblock>
     
     <codeblock platform="javascript">
     var myNC = new air.NetConnection();
     myNC.connect("rtmp://fms.example.com/lectureseries");
     var myNS = new air.NetStream(myNC);
     myNS.publish("lecture", "record");
     </codeblock>
     
     <p>The following example shows how to connect to a different instance of the same application. 
     The file "lecture.flv" is recorded in the directory
     /applications/lectureseries/streams/monday:</p>
     
     <codeblock>
     var myNC:NetConnection = new NetConnection();
     myNC.connect("rtmp://fms.example.com/lectureseries/monday");
     var myNS:NetStream = new NetStream(myNC);
     myNS.publish("lecture", "record");
     </codeblock>
     
     <codeblock platform="javascript">
     var myNC = new air.NetConnection();
     myNC.connect("rtmp://fms.example.com/lectureseries/monday");
     var myNS = new air.NetStream(myNC);
     myNS.publish("lecture", "record");
     </codeblock>
   	 
	 <p>This method dispatchs a <codeph>NetStatusEvent</codeph> object.
	 For example, if someone is already publishing a stream with the specified name 
	 the <codeph>NetStatusEvent</codeph> object is dispatched with a <codeph>code</codeph> property of 
	 <codeph>"NetStream.Publish.BadName"</codeph>. 
	 For more information, see the <codeph>NetStatusEvent</codeph> object.</p>
	 
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetConnection/connect()"><linktext>NetConnection.connect()</linktext></link><link href="" invalidHref="flash.net.xml#NetStatusEvent/info"><linktext>NetStatusEvent.info</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:receiveAudio"><apiName>receiveAudio</apiName><shortdesc>
	 Specifies whether incoming audio plays on the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>flag</apiItemName><apiOperationClassifier>Boolean</apiOperationClassifier><apiDesc>Specifies whether incoming audio plays on the stream
	 (<codeph>true</codeph>) or not (<codeph>false</codeph>). The default value is <codeph>true</codeph>. 
	 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Specifies whether incoming audio plays on the stream.
	 This method is available only to clients subscribed to the specified stream,
	 not to the stream's publisher.
	 
     <p>This method is intended primarily for use with Flash Media Server;
	 for more information, see the class description.</p> 
	 
	 <p>You can call this method before or after you call the <codeph>NetStream.play()</codeph> method
	 and actually begin receiving the stream. For example, you can attach these methods
     to a button the user clicks to mute or unmute the incoming audio stream.</p>
	 
	 <p>If the specified stream contains only audio data, passing a value of <codeph>false</codeph>
	 to this method stops <codeph>NetStream.time</codeph> from further incrementing.</p>
	 
	 </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetStream:receiveVideo"><apiName>receiveVideo</apiName><shortdesc>
	 Specifies whether incoming video will play on the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>flag</apiItemName><apiOperationClassifier>Boolean</apiOperationClassifier><apiDesc>Specifies whether incoming video plays on this stream 
 	 (<codeph>true</codeph>) or not (<codeph>false</codeph>). The default value is <codeph>true</codeph>.
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Specifies whether incoming video will play on the stream. This method is available 
     only to clients subscribed to the specified stream, not to the stream's publisher.
	 
     <p>This method is intended primarily for use with Flash Media Server;
	 for more information, see the class description.</p>
	 
	 <p>You can call this method before or after you call the <codeph>NetStream.play()</codeph>
	 method and actually begin receiving the stream. For example, you can attach
	 these methods to a button the user presses to show or hide the incoming video stream.</p>
	 
	 <p>If the specified stream contains only video data, passing a value of <codeph>false</codeph>
	 to this method stops <codeph>NetStream.time</codeph> from further incrementing.</p>
	 
	 </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetStream:receiveVideoFPS"><apiName>receiveVideoFPS</apiName><shortdesc>
	 Specifies the frame rate for incoming video.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>FPS</apiItemName><apiOperationClassifier>Number</apiOperationClassifier><apiDesc>Specifies the frame rate per second at which the incoming video will play.
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Specifies the frame rate for incoming video. This method is available 
     only to clients subscribed to the specified stream, not to the stream's publisher.
	 
     <p>This method is intended primarily for use with Flash Media Server;
	 for more information, see the class description.</p>
	 
	 <p>You can call this method before or after you call the <codeph>NetStream.play()</codeph>
	 method and actually begin receiving the stream. For example, you can attach
	 these methods to a text field where the user can set the incoming video frame rate.</p>
     
     <p>To stop receiving video, pass 0 for FPS. To determine the current frame rate, 
     use <codeph>NetStream.currentFPS</codeph>.</p>
     
     <p>If you pass a value to the <codeph>FPS</codeph> parameter to limit the frame rate of the video, 
     Flash Media Server attempts to reduce the frame rate while preserving 
     the integrity of the video. The server sends the minimum number of frames
     needed to satisfy the desired rate between every two keyframes. Keep in mind, 
     however, that I-frames (or intermediate frames) must be sent contiguously; 
     otherwise, the video will be corrupted. Therefore, the desired number of frames
     is sent immediately and contiguously following a keyframe. Since the frames are not 
     evenly distributed, the motion appears smooth in segments punctuated by stalls.</p>
	 
	 </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetStream:resetDRMVouchers"><apiName>resetDRMVouchers</apiName><shortdesc>
     Deletes all locally cached digital rights management (DRM) voucher data.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>NetStream, resetDRMVouchers
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiStatic/><apiException><apiDesc>The voucher data cannot be deleted.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
     Deletes all locally cached digital rights management (DRM) voucher data.
     <p>
     The application must re-download any required vouchers from the media rights server for the user 
     to be able to access protected content. Calling this function is equivalent to calling the 
     <codeph>resetDRMVouchers()</codeph> function of the DRMManager object.</p>
     
     </apiDesc><example conref="examples\NetStream.resetDRMVouchers.1.as"> The following example resets all DRM vouchers:
<codeblock>

NetStream.resetDRMVouchers();
</codeblock></example></apiOperationDetail><related-links><link href="flash.net.drm.xml#DRMManager/resetDRMVouchers()"><linktext>flash.net.drm.DRMManager.resetDRMVouchers()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:resume"><apiName>resume</apiName><shortdesc>
	 Resumes playback of a video stream that is paused.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.resume, resume
	 
	 </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
	 Resumes playback of a video stream that is paused. If the video is already playing, calling this method
	 does nothing.
	 
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetStream/close()"><linktext>close()</linktext></link><link href="flash.net.xml#NetStream/pause()"><linktext>pause()</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStream/togglePause()"><linktext>togglePause()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:seek"><apiName>seek</apiName><shortdesc>
	 
	 Seeks the keyframe (also called an I-frame in the video industry) closest to 
	 the specified location.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.seek, seek
	 
	 
	 </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>offset</apiItemName><apiOperationClassifier>Number</apiOperationClassifier><apiDesc>The approximate time value, in seconds, to move to in a video file. 
	 With Flash Media Server, if <codeph>&lt;EnhancedSeek&gt;</codeph> is set to <codeph>true</codeph> in the Application.xml
     configuration file (which it is by default), the server 
	 generates a keyframe at <codeph>offset</codeph>. 
	 
	 <ul>
	   <li>To return to the beginning of the stream, pass 0 for <codeph>offset</codeph>.</li>
	   <li>To seek forward from the beginning of the stream, pass the number of seconds to advance. 
	 	     For example, to position the playhead at 15 seconds from the beginning (or the keyframe
	       before 15 seconds), use <codeph>myStream.seek(15)</codeph>.</li>
	   <li>To seek relative to the current position, pass <codeph>NetStream.time + n</codeph> 
	       or <codeph>NetStream.time - n</codeph>
	 	     to seek <codeph>n</codeph> seconds forward or backward, respectively, from the current position. 
	 	     For example, to rewind 20 seconds from the current position, use 
	       <codeph>NetStream.seek(NetStream.time - 20).</codeph></li>
	 </ul>
	 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 
	 Seeks the keyframe (also called an I-frame in the video industry) closest to 
	 the specified location. The keyframe is placed at an offset, in seconds, from 
	 the beginning of the stream. 
	 
     <p>
     Video streams are usually encoded with two types of frames, keyframes (or I-frames)
     and P-frames. A keyframe contains an entire image, while a P-frame is an 
     interim frame that provides additional video information between keyframes. 
     A video stream typically has a keyframe every 10 to 50 frames. 
     </p>
     
     <p>
     On Flash Media Server, the behavior of <codeph>seek()</codeph> is controlled by the value 
     of the <codeph>EnhancedSeek</codeph> element in the <codeph>Application.xml</codeph> configuration file.
     </p>
     
     <p>
     If <codeph>EnhancedSeek</codeph> is <codeph>false</codeph>, the server uses
     normal seek mode. In normal seek mode, the server starts streaming 
     from the nearest keyframe. For example, if a video has keyframes at 0 seconds  
     and 10 seconds, a seek to 4 seconds causes playback to start at 4 seconds 
     using the keyframe at 0 seconds. The video stays frozen until it reaches the
     next keyframe at 10 seconds. To get a better seeking experience, you need to 
     reduce the keyframe interval. In normal seek mode, you cannot start the video 
     at a point between the keyframes.
     </p>
     
     <p>
     If <codeph>EnhancedSeek</codeph> is <codeph>true</codeph>, the default value, the server generates
     a new keyframe at <codeph>offset</codeph> based on the previous keyframe and any
     intervening P-frames. However, this creates a high processing load on the server, 
     and distortion might occur in the generated keyframe.
     If the video codec is On2, the keyframe before the seek point and any
     P-frames between the keyframe and the seek point are sent to the client.
     </p>
     
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStream/time"><linktext>time</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:send"><apiName>send</apiName><shortdesc>
	 Sends a message on a published stream to all subscribing clients.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>handlerName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The message to be sent; also the name of the ActionScript
	 handler to receive the message. The handler name can be only one level deep
	 (that is, it can't be of the form parent/child) and is relative to the stream object.
	 Do not use a reserved term for a handler name. 
	 For example, using "<codeph>close</codeph>" as a handler name will cause 
	 the method to fail.
	 With Flash Media Server, use <codeph>@setDataFrame</codeph> to add a 
	 keyframe of metadata to a live stream
	 or <codeph>@clearDataFrame</codeph> to remove a keyframe.
	 
	 </apiDesc></apiParam><apiParam><apiItemName>arguments</apiItemName><apiType value="restParam"/><apiDesc>Optional arguments that can be of any type. They are
	 serialized and sent over the connection, and the receiving handler receives
	 them in the same order. If a parameter is a circular object (for example, 
	 a linked list that is circular), the serializer handles the references correctly.
	 With Flash Media Server,
	 if <codeph>@setDataFrame</codeph> is the first argument,
	 use <codeph>onMetaData</codeph> as the second argument; for the third
	 argument, pass an instance of <codeph>Object</codeph>
	 or <codeph>Array</codeph> that has the metadata set as properties.
	 See the 
     <xref href="http://www.adobe.com/go/learn_fms_devguide_en" scope="external">Flash Media Server Developer Guide</xref> 
	 for a list of suggested
	 property names.
	 With <codeph>@clearDataFrame</codeph> as the first argument,
	 use <codeph>onMetaData</codeph> as the second argument and no third argument.
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Sends a message on a published stream to all subscribing clients. 
	 This method is available only to the publisher of the specified stream,
	 and is intended for use with Flash Media Server. 
     To process and respond to this message, create a handler on the
     <codeph>NetStream</codeph> object, for example, <codeph>ns.HandlerName</codeph>.
     
     <p>
     <ph platform="actionscript">Flash Player or </ph> AIR does not serialize methods 
	 or their data, object prototype variables, or non-enumerable variables. For display objects,  
	 <ph platform="actionscript">Flash Player or </ph> AIR serializes the path but none of the data.
	 </p>
	 
	 <p>
	 You can call the <codeph>send()</codeph> method to add data keyframes to a live stream
	 sent to Flash Media Server. A data keyframe is a message a publisher adds
	 to a live stream. Data keyframes are typically used to add metadata to a live stream
	 before data is captured for the stream from camera and microphone. 
	 A publisher can add a data keyframe at any time while the live stream is being published.
	 The data keyframe is saved in the server's memory as long
	 as the publisher is connected to the server. 
	 </p>
	 <p>
	 Clients who are subscribed to the live stream before a data keyframe is
	 added receive the keyframe as soon as it is added. Clients who subscribe
	 to the live stream after the data keyframe is added receive the keyframe
	 when they subscribe.
	 </p>
	 <p>
	 To add a keyframe of metadata to a live stream sent to Flash Media Server, use  
	 <codeph>@setDataFrame</codeph> as the handler name, 
	 followed by two additional arguments, for example:
	 </p>
	 
	 <codeblock platform="actionscript">
	 var ns:NetStream = new NetStream(nc);
	 ns.send("@setDataFrame", "onMetaData", metaData);
	 </codeblock>
	 
	 <codeblock platform="javascript">
	 var ns = new air.NetStream(nc);
	 ns.send("@setDataFrame", "onMetaData", metaData);
	 </codeblock>
	 
	 <p>
	 The <codeph>@setDataFrame</codeph> argument
	 refers to a special handler built in to Flash Media Server. 
	 The <codeph>onMetaData</codeph> argument is the
	 name of a callback function in your client application that
	 listens for the <codeph>onMetaData</codeph> event and retrieves the metadata.
	 The third item, <codeph>metaData</codeph>, is an instance
	 of <codeph>Object</codeph> or <codeph>Array</codeph>
	 with properties that define the metadata values.
	 Publishers should set property names that subscribers can
	 easily understand; see the 
     <xref href="http://www.adobe.com/go/learn_fms_devguide_en" scope="external">Flash Media Server Developer Guide</xref> 
	 for a list of suggested property names.
	 </p>
	 
	 <p>Use <codeph>@clearDataFrame</codeph> to clear a keyframe
	 of metadata that has already been set in the stream:
	 </p>
	 <codeblock>
	 ns.send("@clearDataFrame", "onMetaData");
	 </codeblock>
	 
	 
	 </apiDesc><example conref="examples\NetStream.send.1.as"> The following example creates two <codeph>NetStream</codeph> objects.
 One is used to publish a live stream to the server, while the other 
 subscribes to the stream.
<codeblock>
package {
   import flash.display.Sprite;
   import flash.net.NetConnection;
   import flash.net.NetStream;
   import flash.events.NetStatusEvent;
   import flash.media.Video;
   import flash.utils.setTimeout;

 
   public class TestExample extends Sprite
   {
     var nc:NetConnection = new NetConnection();
     var ns1:NetStream;
     var ns2:NetStream;
     var vid:Video = new Video(300,300);
     var obj:Object = new Object();
 
     public function TestExample() {
        nc.objectEncoding = 0;
        nc.addEventListener("netStatus", onNCStatus);
        nc.connect("rtmp://localhost/FlashVideoApp");
        addChild(vid); 
     }
  
     function onNCStatus(event:NetStatusEvent):void {
       switch (event.info.code) {
           case "NetConnection.Connect.Success":
               trace("You've connected successfully");
               ns1 = new NetStream(nc);
               ns2 = new NetStream(nc);
               
               ns1.client = new CustomClient();
               ns1.publish("dummy", "live");
    
               ns2.play("dummy");
               ns2.client = new CustomClient();
               vid.attachNetStream(ns2);
               setTimeout(sendHello, 3000);
               break;
              
           case "NetStream.Publish.BadName":
               trace("Please check the name of the publishing stream" );
               break;
        }   
     }

     function sendHello():void {
         ns1.send("myFunction", "hello");
     }       
   }
 }
 
 class CustomClient {
    public function myFunction(event:String):void {
       trace(event);
    }
 }
</codeblock></example><example conref="examples\NetStream.send.2.as"> The following example creates metadata and adds it
 to a live stream:
<codeblock>
private function netStatusHandler(event:NetStatusEvent):void {
     switch (event.info.code) {  
        case "NetStream.Publish.Start":
            var metaData:Object = new Object();
            metaData.title = "myStream";
            metaData.width = 400;
            metaData.height = 200;
            ns.send("&amp;#64;setDataFrame", "onMetaData", metaData);
            ns.attachCamera( Camera.getCamera() );
            ns.attachAudio( Microphone.getMicrophone() );        
    }
}
</codeblock></example><example conref="examples\NetStream.send.3.as"> To respond to a data keyframe added to a video, the client needs to define
 an <codeph>onMetaData</codeph> event handler. 
 The <codeph>onMetaData</codeph> event handler is not registered
 with <codeph>addEventListener()</codeph>, but instead is a callback function
 with the name <codeph>onMetaData</codeph>, for example:
<codeblock>
 public function onMetaData(info:Object):void {
    trace("width: " + info.width);
    trace("height: " + info.height);
 }
</codeblock></example><example conref="examples\NetStream.send.4.as"> This example shows how to create a playlist on the server:
<codeblock>
 // Create a NetStream for playing
 var my_ns:NetStream = new NetStream(my_nc);
 my_video.attachNetStream(my_ns);
 
 // Play the stream record1
 my_ns.play("record1", 0, -1, true);
 
 // Switch to the stream live1 and play for 5 seconds.  
 // Since reset is false, live1 will start to play after record1 is done.
 my_ns.play("live1", -1 , 5, false);
</codeblock></example><example conref="examples\NetStream.send.5.as"> If the recorded video file contains only data messages, you can either
 play the video file at the speed at which it was originally recorded, or
 you can get the data messages all at once.
<codeblock>
 //To play at normal speed
 var my_ns:NetStream = new NetStream(my_nc);
 my_ns.play("log", 0, -1);
 
 //To get the data messages all at once
 my_ns.play("log", 0, -1, 3);
</codeblock></example></apiOperationDetail><related-links><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStream/client"><linktext>client</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:setDRMAuthenticationCredentials"><apiName>setDRMAuthenticationCredentials</apiName><shortdesc>
     Sets the DRM authentication credentials needed for viewing the underlying encrypted content.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata><asCustoms><keyword>NetStream, setDRMAuthenticationCredentials
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>userName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>A valid user name credential.
     </apiDesc></apiParam><apiParam><apiItemName>password</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The password credential corresponding to the user name provided.
     </apiDesc></apiParam><apiParam><apiItemName>type</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>A string that specifies what type of authentication credentials are provided. 
     Valid values are <codeph>"drm"</codeph> and <codeph>"proxy"</codeph>. The default value is <codeph>"drm"</codeph>.
     <ul>
     <li>With <codeph>"drm"</codeph> authentication type, the credentials provided are authenticated against 
     Flash Media Rights Management Server (FMRMS).</li>
     <li>With <codeph>"proxy"</codeph> authentication type, the credentials provided are authenticated against 
     the proxy server and must match those required by the proxy server. For example, the <codeph>"proxy"</codeph>  
     option allows the application to authenticate against a proxy server if an enterprise requires such a step 
     before the user can access the Internet. Unless anonymous authentication is used, after the proxy authentication, 
     the user still needs to authenticate against FMRMS in order to obtain the voucher and play the content. 
     You can use <codeph>setDRMAuthenticationcredentials()</codeph> a second time, with <codeph>"drm"</codeph> option, 
     to authenticate against FMRMS.</li>
     </ul>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Sets the DRM authentication credentials needed for viewing the underlying encrypted content.
     <p>
     The <codeph>setDRMAuthenticationCredentials()</codeph> method must provide credentials that
     match those known and accepted by the content provider or the proxy server. These are the same credentials used 
     by the user when obtaining the permission to view the content.
     </p>
      
     </apiDesc></apiOperationDetail><related-links><link href="flash.events.xml#DRMAuthenticateEvent"><linktext>flash.events.DRMAuthenticateEvent</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:togglePause"><apiName>togglePause</apiName><shortdesc>
	 Pauses or resumes playback of a stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.resume, resume
	 
	 </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
	 Pauses or resumes playback of a stream.
	 The first time you call this method, it pauses play; the next time, it resumes play.
	 You could use this method to let users pause or resume playback by pressing 
	 a single button.
	 
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetStream/close()"><linktext>close()</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link><link href="flash.net.xml#NetStream/pause()"><linktext>pause()</linktext></link><link href="flash.net.xml#NetStream/resume()"><linktext>resume()</linktext></link></related-links></apiOperation><apiValue id="flash.net:NetStream:CONNECT_TO_FMS"><apiName>CONNECT_TO_FMS</apiName><shortdesc>
     A static object used as a parameter to
     the constructor for a NetStream instance.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>connectToFMS</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     A static object used as a parameter to
     the constructor for a NetStream instance. It is the default value of the second parameter
     in the NetStream constructor; it is
     not used by the application for progressive media playback. When used, this parameter causes the constructor to
     make a connection to a Flash Media Server instance.
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:DIRECT_CONNECTIONS"><apiName>DIRECT_CONNECTIONS</apiName><shortdesc>
     Creates a peer-to-peer publisher connection.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>directConnections</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     Creates a peer-to-peer publisher connection. Pass this string for the second (optional) parameter to
     the constructor for a NetStream instance. With this string, an application can create
     a NetStream connection for the purposes of publishing audio and video to clients.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:bufferLength:get"><apiName>bufferLength</apiName><shortdesc>
	 The number of seconds of data currently in the buffer.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.bufferLength, bufferLength
	 
	 </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 The number of seconds of data currently in the buffer. You can use this property with 
	 the <codeph>bufferTime</codeph> property to estimate how close the buffer is to being full — for example,
	 to display feedback to a user who is waiting for data to be loaded into the buffer.
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStream/bufferTime"><linktext>bufferTime</linktext></link><link href="flash.net.xml#NetStream/bytesLoaded"><linktext>bytesLoaded</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:bufferTime:set"><apiName>bufferTime</apiName><shortdesc>
	 Specifies how long to buffer messages before starting to display the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.setBufferTime, setBufferTime
	 
	 </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies how long to buffer messages before starting to display the stream. For example, 
	 to make sure that the first 15 seconds of the stream play without interruption, set 
	 <codeph>bufferTime</codeph> to 15; the application begins playing the stream only after 15 seconds of
	 data are buffered.
	 
	 <p>The default value is 0.1 (one-tenth of a second). To determine the number of seconds
	 currently in the buffer, use the <codeph>bufferLength</codeph> property.</p>
	 
     <p><b>Note:</b> To avoid distortion when streaming pre-recorded (not live) content,
     do not set the value of <codeph>Netstream.bufferTime</codeph> to 0. By default, the application 
     uses an input buffer for pre-recorded content that queues the media data and plays the media properly.
     For pre-recorded content use the default setting or increase the buffer time.</p>
     
     <p>Starting with Flash Player 9.0.115.0, Flash Player no longer clears the buffer
     	 when <codeph>NetStream.pause()</codeph> is called. Before Flash Player 9.0.115.0, Flash Player 
     	 waited for the buffer to fill up before resuming playback, which often caused a delay.</p>
     	 
     	 <p>For a single pause, the <codeph>NetStream.bufferLength</codeph> property has a limit of either 60 seconds
     	 or twice the value of <codeph>NetStream.bufferTime</codeph>, whichever value is higher. For example, if
     	 <codeph>bufferTime</codeph> is 20 seconds, Flash Player buffers until <codeph>NetStream.bufferLength</codeph>
     	 is the higher value of either 20~~2 (40), or 60, so in this case it buffers until <codeph>bufferLength</codeph> is 60. 
     	 If <codeph>bufferTime</codeph> is 40 seconds, Flash Player buffers until <codeph>bufferLength</codeph> is the higher value 
     	 of 40~~2 (80), or 60, so in this case it buffers until <codeph>bufferLength</codeph> is 80 seconds.</p>
     	 
     	 <p>The <codeph>bufferLength</codeph> property also has an absolute limit. 
     	 If any call to <codeph>pause()</codeph> causes <codeph>bufferLength</codeph>
     	 to increase more than 600 seconds or the value of <codeph>bufferTime</codeph> ~~ 2, whichever is higher, Flash Player
     	 flushes the buffer and resets <codeph>bufferLength</codeph> to 0. For example, if 
     	 <codeph>bufferTime</codeph> is 120 seconds, Flash Player flushes the buffer
     	 if <codeph>bufferLength</codeph> reaches 600 seconds; if <codeph>bufferTime</codeph> is 360 seconds, 
     	 Flash Player flushes the buffer if <codeph>bufferLength</codeph> reaches 720 seconds.</p>
     	 
     	 <p><b>Tip</b>: You can use <codeph>NetStream.pause()</codeph> in code to buffer data while viewers are watching 
     	 a commercial, for example, and then unpause when the main video starts.</p>
     	 
     	 <p>For more information about the new pause behavior, 
     	 see <xref href="http://www.adobe.com/go/learn_fms_smartpause_en" scope="external">http://www.adobe.com/go/learn_fms_smartpause_en</xref>.</p>
     <p>
     <b>Flash Media Server</b>. The buffer behavior depends on whether the buffer time is
     set on a publishing stream or a subscribing stream.
     For a publishing stream, <codeph>bufferTime</codeph> specifies how long the outgoing buffer can
     grow before the application starts dropping frames.
     On a high-speed connection, buffer time should not be a concern; data will be sent 
     almost as quickly as the application can buffer it. On a slow connection, however, there might 
     be a significant difference between how fast the application buffers the data and how fast it 
     can be sent to the client. 
     </p>
     
     <p>
     For a subscribing stream, <codeph>bufferTime</codeph> specifies how long to buffer incoming 
     data before starting to display the stream. For example, if you want to make sure that the 
     first 15 seconds of the stream play without interruption, 
     set <codeph>bufferTime</codeph> to 15; Flash will begin playing the stream only after 15 seconds 
     of data have been buffered.
     </p>
     
     <p>
     When a recorded stream is played, if <codeph>bufferTime</codeph> is zero, Flash sets it to a small 
     value (approximately 10 milliseconds). If live streams are later played 
     (for example, from a playlist), this buffer time persists. That is, <codeph>bufferTime</codeph> 
     remains nonzero for the stream. 
     </p>
	 
	 </apiDesc></apiValueDetail><related-links><link href="" invalidHref="flash.net.xml#bufferTime/bufferLength"><linktext>bufferLength</linktext></link><link href="" invalidHref="flash.net.xml#bufferTime/time"><linktext>time</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:bytesLoaded:get"><apiName>bytesLoaded</apiName><shortdesc>
	 The number of bytes of data that have been loaded into the application.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.bytesLoaded, bytesLoaded
	 
	 </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
	 The number of bytes of data that have been loaded into the application. You can use this property 
	 with the <codeph>bytesTotal</codeph> property to estimate how close the buffer is to being full — for example, 
     to display feedback to a user who is waiting for data to be loaded into the buffer.
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStream/bytesTotal"><linktext>bytesTotal</linktext></link><link href="flash.net.xml#NetStream/bufferLength"><linktext>bufferLength</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:bytesTotal:get"><apiName>bytesTotal</apiName><shortdesc>
	 The total size in bytes of the file being loaded into the application.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.bytesTotal, bytesTotal
	 </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
	 The total size in bytes of the file being loaded into the application.
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStream/bytesLoaded"><linktext>bytesLoaded</linktext></link><link href="flash.net.xml#NetStream/bufferTime"><linktext>bufferTime</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:checkPolicyFile:get"><apiName>checkPolicyFile</apiName><shortdesc>
	 Specifies whether the application should try to download a cross-domain policy file from the
	 loaded video file's server before beginning to load the video file.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>: please review at same time: checkPolicyFile property in LoaderContext
	 </internal></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies whether the application should try to download a cross-domain policy file from the
	 loaded video file's server before beginning to load the video file. This property applies
	 when you are using a NetStream object for progressive video download (standalone
	 files), or when you are loading files that are outside the calling file's own domain.
	 This property is ignored when you are using a NetStream object to get an RTMP asset.
	 
     <p>Set this property to <codeph>true</codeph> when you are loading a video file from outside the calling SWF 
     file's domain and you need to use the <codeph>BitmapData.draw()</codeph> method for pixel-level access to the video.
	 If you call <codeph>BitmapData.draw()</codeph> without setting the <codeph>checkPolicyFile</codeph> property
	 to <codeph>true</codeph> at loading time, you may get a <codeph>SecurityError</codeph> exception 
	 because the required policy file was not downloaded.</p>
	 
	 <p>If you don't need pixel-level access to the video you are loading,
	 avoid setting <codeph>checkPolicyFile</codeph> to <codeph>true</codeph>. Checking for a policy file 
	 consumes network bandwidth and may delay the start of your download.</p>
	 
	 <p>When you call the <codeph>NetStream.play()</codeph> method with <codeph>checkPolicyFile</codeph> set to <codeph>true</codeph>,
     <ph platform="actionscript">Flash Player or</ph> the AIR runtime 
	 must either successfully download a relevant cross-domain policy file or determine
	 that no such policy file exists before it begins downloading the object specified in 
	 your call to <codeph>NetStream.play()</codeph>. To verify the existence of a policy file,
     <ph platform="actionscript">Flash Player or</ph> the AIR runtime 
	 performs the following actions, in this order:</p>
	 
	 <ol>
	 
     <li>The application considers policy files that have already been downloaded.</li>
	 
	 <li>The application tries to download any pending policy files specified in calls to the
	 <codeph>Security.loadPolicyFile()</codeph> method.</li>
	 
	 <li>The application tries to download a policy file from the default
	 location that corresponds to the URL you passed to <codeph>NetStream.play()</codeph>, which is
	 <codeph>/crossdomain.xml</codeph> on the same server as that URL.</li>
	 
	 </ol>
	 
	 <p>In all cases, <ph platform="actionscript">Flash Player or</ph> the AIR runtime
	 requires that an appropriate policy file exist on the video's server, 
     that it provide access to the object at the URL you passed to <codeph>play()</codeph> based on the 
     policy file's location, and that it allow the domain of the calling code's file to access the video, 
	 through one or more <codeph>&lt;allow-access-from&gt;</codeph> tags.</p>
	 
	 <p>If you set <codeph>checkPolicyFile</codeph> to <codeph>true</codeph>, the application waits until the policy file 
	 is verified before downloading the video. Wait to perform any pixel-level
	 operations on the video data, such as calling <codeph>BitmapData.draw()</codeph>, until
	 you receive <codeph>onMetaData</codeph> or <codeph>NetStatus</codeph> events from your 
	 NetStream object.</p>
	 
	 <p>If you set <codeph>checkPolicyFile</codeph> to <codeph>true</codeph> but no relevant policy file is found,
	 you won't receive an error until you perform an operation that requires a policy file, and then
	 the application throws a SecurityError exception.</p>
	 
	 <p>Be careful with <codeph>checkPolicyFile</codeph> if you are downloading a file from a URL that
	 uses server-side HTTP redirects. The applicatoins tries to retrieve policy files
	 that correspond to the initial URL that you specify in <codeph>NetStream.play()</codeph>. If the
	 final file comes from a different URL because of HTTP redirects, the initially
	 downloaded policy files might not be applicable to the file's final URL, which is the URL
	 that matters in security decisions.</p>
	 
	 <p>For more information on policy files, see the "Flash Player Security" chapter of
	 <i>Programming ActionScript 3.0</i>.</p>
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.display.xml#BitmapData/draw()"><linktext>flash.display.BitmapData.draw()</linktext></link><link href="flash.system.xml#Security/loadPolicyFile()"><linktext>flash.system.Security.loadPolicyFile()</linktext></link><link href="flash.net.xml#NetStream/event:netStatus"><linktext>netStatus</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData"><linktext>onMetaData</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>play()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:client:get"><apiName>client</apiName><shortdesc>
     Specifies the object on which callback methods are invoked to handle streaming or FLV 
     file data.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Object</apiValueClassifier><apiException><apiDesc>The <codeph>client</codeph> property must be set to a non-null object.
	 
	 </apiDesc><apiItemName>TypeError</apiItemName><apiOperationClassifier>TypeError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
     Specifies the object on which callback methods are invoked to handle streaming or FLV 
     file data. The default object is <codeph>this</codeph>, the 
     NetStream object being created. If you set the <codeph>client</codeph> property to another
     object, callback methods are invoked on that other object. The <codeph>NetStream.client
     </codeph> object can call the following functions and receive an associated data object:
     <codeph>onCuePoint()</codeph>, 
     <codeph>onImageData()</codeph>,
     <codeph>onMetaData()</codeph>, <codeph>onPlayStatus()</codeph>, 
     <codeph>onTextData()</codeph>, and <codeph>onXMPData()</codeph>.
     <p><b>To associate the <codeph>client</codeph> property with an event handler:</b></p>
     <p><ol><li>Create an object and assign it to the <codeph>client</codeph> property of the 
     NetStream object:
     <codeblock>
     var customClient:Object = new Object();
     my_netstream.client = customClient;
     </codeblock>
     </li>
     <li>Assign a handler function for the desired data event as a property of the client
     object:
     <codeblock>
     customClient.onImageData = onImageDataHandler;           
     </codeblock>
     </li>
     <li>Write the handler function to receive the data event object, such as:
     <codeblock>
      public function onImageDataHandler(imageData:Object):void {
              trace("imageData length: " + imageData.data.length);
      }
     </codeblock></li>
     </ol></p>
     <p>When data is passed through the stream or during playback, the data event object (in
     this case the <codeph>imageData</codeph> object) is populated with the data. See the <codeph>onImageData</codeph>
     description, which includes a full example of an object assigned to the <codeph>client</codeph> property.</p>
     <p><b>To associate the <codeph>client</codeph> property with a subclass:</b></p>
     <p><ol><li>Create a subclass with a handler function to receive the data event object:
     <codeblock>
     class CustomClient {
        public function onMetaData(info:Object):void {
            trace("metadata: duration=" + info.duration + " framerate=" + info.framerate);
     }
     </codeblock>
     </li>
     <li>Assign an instance of the subclass to the <codeph>client</codeph> property  of the 
     NetStream object:
     <codeblock>
     my_netstream.client = new CustomClient();
     </codeblock>
     </li>
     </ol></p>     
     <p>When data is passed through the stream or during playback, the data event object (in
     this case the <codeph>info</codeph> object) is populated with the data. See the class example at
     the end of the NetStream class, which shows the assignment of a subclass instance
     to the <codeph>client</codeph> property.</p>
     
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStream/event:onCuePoint"><linktext>onCuePoint</linktext></link><link href="flash.net.xml#NetStream/event:onImageData"><linktext>onImageData</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData"><linktext>onMetaData</linktext></link><link href="flash.net.xml#NetStream/event:onPlayStatus"><linktext>onPlayStatus</linktext></link><link href="flash.net.xml#NetStream/event:onTextData"><linktext>onTextData</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:currentFPS:get"><apiName>currentFPS</apiName><shortdesc>
	 The number of frames per second being displayed.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.currentFPS, currentFPS
	 </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 The number of frames per second being displayed. If you are exporting video files to be played back on a number
	 of systems, you can check this value during testing to help you determine how much compression to apply when
	 exporting the file.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:farID:get"><apiName>farID</apiName><shortdesc>
     The identifier of the far end that is connected to this NetStream instance.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     The identifier of the far end that is connected to this <codeph>NetStream</codeph> instance. This property is defined only for RTMFP connections.
     
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:farNonce:get"><apiName>farNonce</apiName><shortdesc>
     A value chosen substantially by the other end of this stream, unique to this connection.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     A value chosen substantially by the other end of this stream, unique to this connection. This value appears to the other end of the stream
     as its <codeph>nearNonce</codeph> value. This property is defined only for RTMFP connections.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:info:get"><apiName>info</apiName><shortdesc>
     Returns a NetStreamInfo object whose properties contain statistics about the quality of service.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>flash.net:NetStreamInfo</apiValueClassifier></apiValueDef><apiDesc>
     Returns a NetStreamInfo object whose properties contain statistics about the quality of service. The object is a snapshot of the current state. 
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStreamInfo"><linktext>NetStreamInfo</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:liveDelay:get"><apiName>liveDelay</apiName><shortdesc>
	 The number of seconds of data in the subscribing stream's 
	 buffer in live (unbuffered) mode.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><category>Property
	 
	 </category></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 The number of seconds of data in the subscribing stream's 
	 buffer in live (unbuffered) mode. This property specifies the current
	 network transmission delay (lag time).
	 
	 <p>This property is intended primarily for use with a server such as Flash Media Server;
	 for more information, see the class description.</p>
	 
	 <p>You can get the value of this property to roughly gauge the transmission
	 quality of the stream and communicate it to the user. </p>
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:maxPauseBufferTime:set"><apiName>maxPauseBufferTime</apiName><shortdesc>
     Specifies how long to buffer messages during pause mode, in seconds.</shortdesc><prolog/><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
     Specifies how long to buffer messages during pause mode, in seconds. This property can be used to limit how much buffering is done
     during pause mode. As soon as the value of <codeph>NetStream.bufferLength</codeph> reaches
     this limit, it stops buffering.
     If this value is not set, it defaults the limit to 60 seconds or twice the value of  <codeph>NetStream.bufferTime</codeph> on each pause,
     whichever is higher.
     </apiDesc></apiValueDetail><related-links><link href="" invalidHref="flash.net.xml#maxPauseBufferTime/bufferTime"><linktext>bufferTime</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:nearNonce:get"><apiName>nearNonce</apiName><shortdesc>
     A value chosen substantially by this end of the stream, unique to this connection.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     A value chosen substantially by this end of the stream, unique to this connection. This value appears to the other end of the stream
     as its <codeph>farNonce</codeph> value. This property is defined only for RTMFP connections.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:objectEncoding:get"><apiName>objectEncoding</apiName><shortdesc>
	 The object encoding (AMF version) for this NetStream object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
	 The object encoding (AMF version) for this NetStream object. The NetStream object
	 inherits its <codeph>objectEncoding</codeph> value from the associated NetConnection object.
	 It's important to understand this property if your ActionScript 3.0 SWF file needs to 
	 communicate with servers released prior to Flash Player 9.
	 For more information, see the <codeph>objectEncoding</codeph> property description
	 in the NetConnection class.
	 
	 <p>The value of this property depends on whether the stream is local or  
	 remote. Local streams, where <codeph>null</codeph> was passed to the 
	 <codeph>NetConnection.connect()</codeph> method, return the value of 
	 <codeph>NetConnection.defaultObjectEncoding</codeph>. Remote streams, where you
	 are connecting to a server, return the object encoding of the connection to the server.</p>
	 
	 <p>If you try to read this property when not connected, or if you try to change this property, 
	 the application throws an exception.</p>
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetConnection/objectEncoding"><linktext>NetConnection.objectEncoding</linktext></link><link href="flash.net.xml#ObjectEncoding"><linktext>ObjectEncoding</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:peerStreams:get"><apiName>peerStreams</apiName><shortdesc>
	 
     An object that holds all of the subscribing NetStream instances that are listening to this publishing NetStream instance.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Array</apiValueClassifier></apiValueDef><apiDesc>
	 
     An object that holds all of the subscribing NetStream instances that are listening to this publishing NetStream instance.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:soundTransform:get"><apiName>soundTransform</apiName><shortdesc>
	 Controls sound in this NetStream object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>flash.media:SoundTransform</apiValueClassifier></apiValueDef><apiDesc>
	 Controls sound in this NetStream object. For more information, see the SoundTransform class.
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.media.xml#SoundTransform"><linktext>flash.media.SoundTransform</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:time:get"><apiName>time</apiName><shortdesc>
	 The position of the playhead, in seconds.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetStream.time, time
	 
	 </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 The position of the playhead, in seconds.
	 <p>
	 <b>Flash Media Server</b> For a subscribing stream, the number of seconds
	 the stream has been playing. For a publishing stream, the number of
	 seconds the stream has been publishing. 
	 This number is accurate to the thousandths decimal place; multiply 
	 by 1000 to get the number of milliseconds the stream has been playing.
	 </p>
	 <p>
	 For a subscribing stream, if the server stops sending data but the stream remains open, 
     the value of the <codeph>time</codeph> property stops advancing. When the server begins sending data again, 
     the value continues to advance from the where it stopped (when the server stopped sending data). 
	 </p>
	 <p>
     The value of <codeph>time</codeph> continues to advance when the stream 
	 switches from one playlist element to another. This property is set to 0 when 
	 <codeph>NetStream.play()</codeph> is called with <codeph>reset</codeph> set to <codeph>1</codeph> or 
	 <codeph>true</codeph>, or when <codeph>NetStream.close()</codeph> is called. 
	 </p>
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStream/bufferLength"><linktext>bufferLength</linktext></link><link href="flash.net.xml#NetStream/bytesLoaded"><linktext>bytesLoaded</linktext></link></related-links></apiValue></apiClassifier><apiClassifier id="flash.net:LocalConnection"><apiName>LocalConnection</apiName><shortdesc>
 The LocalConnection class lets you create a LocalConnection object that can invoke a method in another
 LocalConnection object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>LocalConnection
 </keyword></asCustoms></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
 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 <codeph>fscommand()</codeph> 
 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 — for example, a file running in a browser 
 and a SWF file running in Adobe AIR. </p>
 
 <p platform="actionscript">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 <codeph>send()</codeph> 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 <codeph>connect()</codeph> method.</p>
 
 <p>Your use of <codeph>send()</codeph> and <codeph>connect()</codeph> 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 <codeph>connectionName</codeph> parameter to both the <codeph>connect()</codeph>
 and <codeph>send()</codeph> methods:</p>
 
 <p><adobeimage alt="Loading from the same domain" href="../../images/localconnection_samedomains.gif"/></p>
 
<codeblock>
// 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');
</codeblock>
 <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 <codeph>allowDomain()</codeph>
 method. You also need to qualify the connection name in the <codeph>send()</codeph> method 
 with the receiving LocalConnection object's domain name:</p>
 
 <p><adobeimage alt="Loading from separate domains" href="../../images/localconnection_differentdomains.gif"/></p>
 
<codeblock>
// 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');
</codeblock>
 
 <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 <codeph>send()</codeph> 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 <codeph>connect()</codeph> and <codeph>send()</codeph> calls.
 To allow communication between the two domains, call the <codeph>allowDomain()</codeph> 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><adobeimage alt="Loading from unknown domain names" href="../../images/localconnection_unknowndomains.gif"/></p>
<codeblock>
// 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');
</codeblock>
 
 <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 <codeph>send()</codeph> and <codeph>connect()</codeph> methods, see the discussion of the 
 <codeph>connectionName</codeph> parameter in the <codeph>LocalConnection.send()</codeph> and 
 <codeph>LocalConnection.connect()</codeph>entries. Also, see the <codeph>allowDomain()</codeph> and <codeph>domain</codeph> entries.</p>
 
 </apiDesc><example conref="examples\LocalConnectionSenderExample.as"> 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 <codeph>call()</codeph> method is used to 
 call the method named <codeph>lcHandler</codeph> 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 <codeph>connect()</codeph> 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 <codeph>lcHandler()</codeph>; 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>
<codeblock>

// 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);
        }
    }
}
</codeblock></example><example conref="examples\LocalConnectionReceiverExample.as"><codeblock>
// 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);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#LocalConnection/send()"><linktext>flash.net.LocalConnection.send()</linktext></link><link href="flash.net.xml#LocalConnection/allowDomain()"><linktext>flash.net.LocalConnection.allowDomain()</linktext></link><link href="flash.net.xml#LocalConnection/domain"><linktext>flash.net.LocalConnection.domain</linktext></link></related-links><adobeApiEvent id="flash.net:LocalConnection_flash.events.StatusEvent.STATUS_status"><apiName>status</apiName><shortdesc>
 Dispatched when a LocalConnection object reports its status.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.StatusEvent.STATUS</apiEventType><adobeApiEventClassifier>flash.events.StatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when a LocalConnection object reports its status. 
 If <codeph>LocalConnection.send()</codeph> is successful, the value of the <codeph>status</codeph> event
 object's <codeph>level</codeph> property is <codeph>"status"</codeph>; if the call fails, the <codeph>level</codeph> property
 is <codeph>"error"</codeph>. If the receiving file refuses the connection, the call can fail
 without notification to the sending file. 
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#LocalConnection/send()"><linktext>LocalConnection.send()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:LocalConnection_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError"><apiName>securityError</apiName><shortdesc>
 Dispatched if a call to LocalConnection.send() 
 attempts to send data to a different security sandbox.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier>flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to <codeph>LocalConnection.send()</codeph> 
 attempts to send data to a different security sandbox.
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#LocalConnection/send()"><linktext>send()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:LocalConnection_flash.events.AsyncErrorEvent.ASYNC_ERROR_asyncError"><apiName>asyncError</apiName><shortdesc>
 Dispatched when an exception is thrown asynchronously &amp;#x2014; that is, 
 from native asynchronous code.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.AsyncErrorEvent.ASYNC_ERROR</apiEventType><adobeApiEventClassifier>flash.events.AsyncErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when an exception is thrown asynchronously — that is, 
 from native asynchronous code. 
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:LocalConnection:LocalConnection"><apiName>LocalConnection</apiName><shortdesc>
	 Creates a LocalConnection object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><oldexample>The following example shows how receiving and sending files create LocalConnnection objects. 
	 The two files can use the same name or different names for their respective LocalConnection objects. 
	 In this example they use different names.
	 
	 <listing>
	 // Code in the receiving file
	 this.createTextField("result_txt", 1, 10, 10, 100, 22);
	 result_txt.border = true;
	 var receiving_lc:LocalConnection = new LocalConnection();
	 receiving_lc.methodToExecute = function(param1:Number, param2:Number) {
	   result_txt.text = param1+param2;
	 };
	 receiving_lc.connect("lc_name");
	 </listing>
	 
	 <p>The following file sends the request to the first file.</p>
	 
	 <listing>
	 // Code in the sending file
	 var sending_lc:LocalConnection = new LocalConnection();
	 sending_lc.send("lc_name", "methodToExecute", 5, 7);
	 </listing>
	 
	 </oldexample></asCustoms></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/></apiConstructorDef><apiDesc>
	 Creates a LocalConnection object. You can use LocalConnection objects to enable 
	 communication between different files that are running on the same client computer.
	 
	 </apiDesc></apiConstructorDetail><related-links><link href="flash.net.xml#LocalConnection/connect()"><linktext>flash.net.LocalConnection.connect()</linktext></link><link href="flash.net.xml#LocalConnection/send()"><linktext>flash.net.LocalConnection.send()</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:LocalConnection:allowDomain"><apiName>allowDomain</apiName><shortdesc>
	 Specifies one or more domains that can send LocalConnection calls to this LocalConnection instance.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>Change the first example in the listing.
	 </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>All parameters specified must be non-null strings.
	 
	 </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>domains</apiItemName><apiType value="restParam"/><apiDesc>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 "<codeph>localhost</codeph>" to allow calls to this file from files that
	 	are installed locally. <ph platform="actionscript">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 "<codeph>localhost</codeph>", any local SWF file can access this 
	  SWF file.</ph> </li>
	 
	 </ul>
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 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 <codeph>allowInsecureDomain()</codeph> 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 <codeph>url</codeph> property of the LoaderInfo object used with the load, to get the domain to use with 
	 the <codeph>allowDomain()</codeph> method. For example, if you use a Loader object to load a child file, once the file 
	 is loaded, you can check the <codeph>contentLoaderInfo.url</codeph> 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 
	 <codeph>contentLoaderInfo.url</codeph> 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 <codeph>loaderInfo.url</codeph> property in the 
	 loaded file. Again, you must parse the domain out of the full URL from <codeph>loaderInfo.url</codeph>. 
	 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 platform="actionscript">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 <codeph>LocalConnection.allowDomain()</codeph> method in the 
	 receiving file. However, in Adobe AIR, content in the <codeph>application</codeph> security sandbox 
	 (content installed with the AIR application) are not restricted by these security limitations.</p>
	 
	 <p platform="actionscript">For more information, see the following:</p>
	 
     <ul platform="actionscript">
     
     <li class="flexonly">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     <li class="flashonly">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
     <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     </ul>
     
	 <p platform="actionscript"><b>Note</b>: The <codeph>allowDomain()</codeph> method has changed 
	 from the form it had in ActionScript 1.0 and 2.0.  In those earlier versions, 
	 <codeph>allowDomain</codeph> was a callback method that you
	 implemented.  In ActionScript 3.0, <codeph>allowDomain()</codeph> is a built-in 
	 method of LocalConnection that you call.  With this change, <codeph>allowDomain()</codeph>
	 works in much the same way as <codeph>flash.system.Security.allowDomain()</codeph>.</p>
	 
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#LocalConnection/allowInsecureDomain()"><linktext>flash.net.LocalConnection.allowInsecureDomain()</linktext></link><link href="flash.display.xml#LoaderInfo/url"><linktext>flash.display.LoaderInfo.url</linktext></link><link href="flash.system.xml#Security/allowDomain()"><linktext>flash.system.Security.allowDomain()</linktext></link><link href="flash.system.xml#Security/allowDomain()"><linktext>flash.system.Security.allowDomain()</linktext></link><link href="flash.display.xml#LoaderInfo/url"><linktext>flash.display.LoaderInfo.url</linktext></link></related-links></apiOperation><apiOperation id="flash.net:LocalConnection:allowInsecureDomain"><apiName>allowInsecureDomain</apiName><shortdesc>
	 Specifies one or more domains that can send LocalConnection calls to this LocalConnection object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>Seems like a security note is in order here.
	 </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>All parameters specified must be non-null strings.
	 </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>domains</apiItemName><apiType value="restParam"/><apiDesc>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 "<codeph>localhost</codeph>" 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 "<codeph>localhost</codeph>", 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>
	 
 	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Specifies one or more domains that can send LocalConnection calls to this LocalConnection object.  
	 
	 <p>The <codeph>allowInsecureDomain()</codeph> method works just like the <codeph>allowDomain()</codeph> method, 
	 except that the <codeph>allowInsecureDomain()</codeph> 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 <codeph>allowInsecureDomain()</codeph> method from a
	 file that was loaded using HTTPS.  You must call the <codeph>allowInsecureDomain()</codeph> 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 <codeph>allowInsecureDomain()</codeph> 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 class="flexonly">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     <li class="flashonly">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
     <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     </ul>
     
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#LocalConnection/allowDomain()"><linktext>flash.net.LocalConnection.allowDomain()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:LocalConnection:close"><apiName>close</apiName><shortdesc>
	 Closes (disconnects) a LocalConnection object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>LocalConnection, LocalConnection.close, close
	 </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The LocalConnection instance is not connected, so it cannot be closed.
	 
 	 </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
	 Closes (disconnects) a LocalConnection object. Issue this command when you no longer want the object 
	 to accept commands — for example, when you want to issue a <codeph>connect()</codeph>
	 command using the same <codeph>connectionName</codeph> parameter in another SWF file.
	 
	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#LocalConnection/connect()"><linktext>flash.net.LocalConnection.connect()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:LocalConnection:connect"><apiName>connect</apiName><shortdesc>
	 Prepares a LocalConnection object to receive commands from a send() command 
	 (called the sending LocalConnection object).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>LocalConnection, LocalConnection.connect, connect
	 </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The value passed to the <codeph>connectionName</codeph> parameter must be non-null.
	 
	 </apiDesc><apiItemName>TypeError</apiItemName><apiOperationClassifier>TypeError</apiOperationClassifier></apiException><apiException><apiDesc>This error can occur for three reasons: 1) The string value passed to the <codeph>connectionName</codeph> parameter
	 was null. Pass a non-null value. 2) The value passed to the <codeph>connectionName</codeph> parameter
	 contained a colon (:). Colons are used as special characters to separate the superdomain 
	 from the <codeph>connectionName</codeph> string in the <codeph>send()</codeph> method, not the
	 <codeph>connect()</codeph>method. 3) The LocalConnection instance is already connected.
	 
	 </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>connectionName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>A string that corresponds to the connection name specified in the 
	 <codeph>send()</codeph> command that wants to communicate with the receiving LocalConnection object. 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Prepares a LocalConnection object to receive commands from a <codeph>send()</codeph> 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 <codeph>connectionName</codeph> argument is resolved into a value of 
	 <codeph>"<i>superdomain</i>:connectionName"</codeph>, 
	 where <codeph><i>superdomain</i></codeph> is the superdomain of the file that contains the 
	 <codeph>connect()</codeph> command. For example, if the file that contains the 
	 receiving LocalConnection object is located at www.someDomain.com, <codeph>connectionName</codeph> 
	 resolves to <codeph>"someDomain.com:connectionName"</codeph>. (If a file running in Flash Player
	 is located on the client computer, the value assigned to <codeph>superdomain</codeph> is 
	 <codeph>"localhost"</codeph>.)</p>
	 
	 <p>In content running in the <codeph>application</codeph> security sandbox in Adobe AIR (content
	 installed with the AIR application), the runtime uses the string <codeph>app#</codeph> followed by the application
	 ID for the AIR application (defined in the application descriptor file) in place of the superdomain. 
	 For example a <codeph>connectionName</codeph> for an application with the application ID <codeph>com.example.air.MyApp</codeph>
	 <codeph>connectionName</codeph> resolves to <codeph>"app#com.example.air.MyApp:connectionName"</codeph>.</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 
	 <codeph>"</codeph><codeph><i>superdomain</i></codeph><codeph>:connectionName"</codeph>. 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 <codeph>connectionName</codeph> that does not begin with an underscore (_) and that does not specify 
	 a domain name (for example, <codeph>"myDomain:connectionName"</codeph>). Use the same string in the 
	 <codeph>connect(connectionName)</codeph> method.</p>
	 
	 <p>If you are implementing communication between files in different domains, specifying a string 
	 for <codeph>connectionName</codeph> 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 <codeph>connectionName</codeph>does not begin with an underscore (_), 
	 	a prefix is added with the superdomain and a colon (for example, 
	 	<codeph>"myDomain:connectionName"</codeph>). 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, <codeph>"myDomain:connectionName"</codeph>). 
	 	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, <codeph>"anotherDomain:connectionName"</codeph>). 
	 	All sending LocalConnection objects would have to be manually edited to point to the new superdomain.</li>
	 
	   <li>If the string for <codeph>connectionName</codeph>begins with an underscore (for example, 
	 	<codeph>"_connectionName"</codeph>), a prefix is not added to the string. This means that 
	 	the receiving and sending LocalConnection objects use identical strings for 
	 	<codeph>connectionName</codeph>. If the receiving object uses <codeph>allowDomain()</codeph> 
	 	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 <codeph>connectionName</codeph> in <codeph>send()</codeph>, and also
	 the <codeph>allowDomain()</codeph> and <codeph>domain</codeph> entries.</p>
	 
	 <p><b>Note: </b>Colons are used as special characters to separate the superdomain from the 
	 <codeph>connectionName</codeph> string. A string for <codeph>connectionName</codeph> that contains a colon is
	 not valid.</p>
	 
	 <p>When you use this method <ph platform="javascript">in content in security sandboxes other
	 than then application security sandbox</ph>, consider the <ph platform="actionscript">Flash Player</ph>
	 <ph platform="javascript">AIR</ph> 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 <codeph>LocalConnection.allowDomain()</codeph> method in the 
	 receiving file. <ph platform="actionscript">You can prevent a file from using this method by setting the 
	 <codeph>allowNetworking</codeph> parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> 
	 tags in the HTML page that contains the SWF content.</ph> However, in Adobe AIR, 
	 content in the <codeph>application</codeph> 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 class="flexonly">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     <li class="flashonly">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
     <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     </ul>
     
 	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#LocalConnection/send()"><linktext>flash.net.LocalConnection.send()</linktext></link><link href="flash.net.xml#LocalConnection/allowDomain()"><linktext>flash.net.LocalConnection.allowDomain()</linktext></link><link href="flash.net.xml#LocalConnection/domain"><linktext>flash.net.LocalConnection.domain</linktext></link></related-links></apiOperation><apiOperation id="flash.net:LocalConnection:send"><apiName>send</apiName><shortdesc>
	 Invokes the method named methodName on a connection opened with the 
	 connect(connectionName) method (the receiving LocalConnection 
	 object).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>LocalConnection, LocalConnection.send, send
	 
	 </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The value of either <codeph>connectionName</codeph> or <codeph>methodName</codeph>
	 is null. Pass non-null values for these parameters.
	 
	 </apiDesc><apiItemName>TypeError</apiItemName><apiOperationClassifier>TypeError</apiOperationClassifier></apiException><apiException><apiDesc>This error can occur for one of the following reasons:
	 1) The value of either <codeph>connectionName</codeph> or <codeph>methodName</codeph>
	 is an empty string. Pass valid strings for these parameters.
	 2) The method specified in <codeph>methodName</codeph> is restricted. 
	 3) The serialized message that is being sent is too large (larger than 40K).
	 
	 </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>connectionName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>Corresponds to the connection name specified in the <codeph>connect()</codeph> command 
	 that wants to communicate with the sending LocalConnection object. 	 
	 
	 </apiDesc></apiParam><apiParam><apiItemName>methodName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The name of the method to be invoked in the receiving LocalConnection object. The 
	 following method names cause the command to fail: <codeph>send</codeph>, <codeph>connect</codeph>, 
	 <codeph>close</codeph>, <codeph>allowDomain</codeph>, <codeph>allowInsecureDomain</codeph>,
	 <codeph>client</codeph>, and <codeph>domain</codeph>.
	 
	 </apiDesc></apiParam><apiParam><apiItemName>arguments</apiItemName><apiType value="restParam"/><apiDesc>Additional optional parameters to be passed to the specified method. 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
	 Invokes the method named <codeph>methodName</codeph> on a connection opened with the 
	 <codeph>connect(</codeph><codeph>connectionName</codeph><codeph>)</codeph> 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 <codeph>send()</codeph> throws an <codeph>ArgumentError</codeph> but your syntax is correct, try dividing the
	 <codeph>send()</codeph> requests into multiple commands, each with less than 40K of data.</p>
	 
	 <p>As discussed in the <codeph>connect()</codeph> entry, the current superdomain in added to 
	 <codeph>connectionName</codeph> by default. If you are implementing communication between different domains,
	 you need to define <codeph>connectionName</codeph> in both the sending and receiving LocalConnection 
	 objects in such a way that the current superdomain is not added to <codeph>connectionName</codeph>. 
	 You can do this in one of the following two ways:</p>
	 
	 <ul>
	   <li>Use an underscore (_) at the beginning of <codeph>connectionName</codeph> in both the sending and 
	 	receiving LocalConnection objects. In the file that contains the receiving object, use 
	 	<codeph>LocalConnection.allowDomain()</codeph> 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 <codeph>connectionName</codeph> in the sending LocalConnection 
	 	object — for example, <codeph>myDomain.com:myConnectionName</codeph>. In the receiving object, use 
	 	<codeph>LocalConnection.allowDomain()</codeph> 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 <codeph>connectionName</codeph> in the receiving 
	 LocalConnection object — you can do this in only the sending LocalConnection object.</p>
	 
	 <p>When you use this method <ph platform="javascript">in content in security sandboxes other
	 than then application security sandbox</ph>, consider the <ph platform="actionscript">Flash Player</ph>
	 <ph platform="javascript">AIR</ph> 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 <codeph>LocalConnection.allowDomain()</codeph> method in the 
	 receiving file.  For SWF content running in the browser, ou can prevent a file from using this method by setting the 
	 <codeph>allowNetworking</codeph> parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> 
	 tags in the HTML page that contains the SWF content. However, in Adobe AIR, content in the 
	 <codeph>application</codeph> 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 class="flexonly">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     <li class="flashonly">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
     <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     </ul>
	 
 	 </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#LocalConnection/allowDomain()"><linktext>flash.net.LocalConnection.allowDomain()</linktext></link><link href="flash.net.xml#LocalConnection/connect()"><linktext>flash.net.LocalConnection.connect()</linktext></link><link href="flash.net.xml#LocalConnection/domain"><linktext>flash.net.LocalConnection.domain</linktext></link></related-links><adobeApiEvent id="flash.net:LocalConnection:send_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc><codeph>LocalConnection.send()</codeph> 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 <codeph>LocalConnection.allowDomain()</codeph>.
	 
	 </apiDesc></adobeApiEventDetail><shortdesc>LocalConnection.send() attempted
	 to communicate with a SWF file from a security sandbox to which the calling
	 code does not have access.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:LocalConnection:send_status"><apiName>status</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:StatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>If the value of the <codeph>level</codeph> property is <codeph>"status"</codeph>,
	 the call was successful; if the value is <codeph>"error"</codeph>, the call failed. The call can fail
	 if the receiving SWF file refuses the connection.
	 
	 </apiDesc></adobeApiEventDetail><shortdesc>If the value of the level property is "status",
	 the call was successful; if the value is "error", the call failed.</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.net:LocalConnection:client:get"><apiName>client</apiName><shortdesc>
	 Indicates the object on which callback methods are invoked.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Object</apiValueClassifier><apiException><apiDesc>The <codeph>client</codeph> property must be set to a non-null object. 
	 </apiDesc><apiItemName>TypeError</apiItemName><apiOperationClassifier>TypeError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
	 Indicates the object on which callback methods are invoked. The default object 
	 is <codeph>this</codeph>, the local connection being created. You can set the
	 <codeph>client</codeph> property to another object, and callback methods are 
	 invoked on that other object.
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:LocalConnection:domain:get"><apiName>domain</apiName><shortdesc>
	 A string representing the domain of the location of the current file.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>LocalConnection, LocalConnection.domain, domain
	 </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 A string representing the domain of the location of the current file. 
	 
	 <p>In content running in the <codeph>application</codeph> security sandbox in Adobe AIR (content
	 installed with the AIR application), the runtime uses the string <codeph>app#</codeph> followed by the application
	 ID for the AIR application (defined in the application descriptor file) in place of the superdomain. 
	 For example a <codeph>connectionName</codeph> for an application with the application ID <codeph>com.example.air.MyApp</codeph>
	 <codeph>connectionName</codeph> resolves to <codeph>"app#com.example.air.MyApp:connectionName"</codeph>.</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 <codeph>"www.adobe.com"</codeph>. </p>
	 
	 <p>If the current file is a local file residing on the client computer running in Flash Player, 
	 this command returns <codeph>"localhost"</codeph>.</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 <codeph>LocalConnection.allowDomain()</codeph> 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>
	 
 	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#LocalConnection/allowDomain()"><linktext>flash.net.LocalConnection.allowDomain()</linktext></link><link href="flash.net.xml#LocalConnection/connect()"><linktext>flash.net.LocalConnection.connect()</linktext></link></related-links></apiValue><apiValue id="flash.net:LocalConnection:isPerUser:get"><apiName>isPerUser</apiName><shortdesc>  
     Indicates whether the LocalConnection object is scoped to the current user (true) or is globally accessible
     to all users on the computer (false).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10.0.32"/><apiPlatform description="" name="AIR" version="1.5.2"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Boolean</apiValueClassifier><apiDefaultValue>false
     
     </apiDefaultValue></apiValueDef><apiDesc>  
     Indicates whether the LocalConnection object is scoped to the current user (<codeph>true</codeph>) or is globally accessible
     to all users on the computer (<codeph>false</codeph>). This property only affects content running on Mac OS X; other platforms ignore this parameter.
     Connections on Windows and Linux operating systems are always per-user.
     In Flash Player 10.0.22 and earlier, and in AIR 1.5.1 and earlier, all LocalConnection objects on Mac OS X have a global scope. 
     Always set this property to <codeph>true</codeph>, unless you need to preserve compatibility with previous versions. 
     In future releases, the default value of this property might change to <codeph>true</codeph>.
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="flash.net:NetStreamInfo"><apiName>NetStreamInfo</apiName><shortdesc>
 
 The NetStreamInfo class specifies the various Quality of Service (QOS) statistics related to a NetStream object
 and the underlying streaming buffer for audio, video, and data.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiFinal/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 
 The NetStreamInfo class specifies the various Quality of Service (QOS) statistics related to a NetStream object
 and the underlying streaming buffer for audio, video, and data. A NetStreamInfo object is returned in response
 to the <codeph>NetStream.info</codeph> call, which takes a snapshot of the current QOS state 
 and provides the QOS statistics through the NetStreamInfo properties.
 
 </apiDesc></apiClassifierDetail><apiConstructor id="flash.net:NetStreamInfo:NetStreamInfo"><apiName>NetStreamInfo</apiName><shortdesc>
    For internal use only; not recommended for use.</shortdesc><prolog/><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/><apiParam><apiItemName>curBPS</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>byteCount</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>maxBPS</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>audioBPS</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>audioByteCount</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>videoBPS</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>videoByteCount</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>dataBPS</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>dataByteCount</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>playbackBPS</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>droppedFrames</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>audioBufferByteLength</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>videoBufferByteLength</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>dataBufferByteLength</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>audioBufferLength</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>videoBufferLength</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>dataBufferLength</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>srtt</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam><apiParam><apiItemName>audioLossRate</apiItemName><apiOperationClassifier>Number</apiOperationClassifier></apiParam></apiConstructorDef><apiDesc>
    For internal use only; not recommended for use. Only the runtime can create NetStreamInfo objects.
    </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.net:NetStreamInfo:toString"><apiName>toString</apiName><shortdesc>
     Returns a text value listing the properties of the NetStreamInfo object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiDesc>A string containing the values of the properties of the NetStreamInfo object
     
     </apiDesc><apiOperationClassifier>String</apiOperationClassifier></apiReturn><apiTipTexts><apiTipText>Returns a text value listing the properties of this NetStreamInfo object.
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc>
     Returns a text value listing the properties of the NetStreamInfo object.
     
     </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:NetStreamInfo:SRTT:get"><apiName>SRTT</apiName><shortdesc>
	 Specifies the Smooth Round Trip Time for the NetStream session.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the Smooth Round Trip Time for the NetStream session. 
	 This value returns a valid value only for RTMFP streams and returns 0 for RTMP streams.
	 For more information, see the Flash Media Server documentation.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:audioBufferByteLength:get"><apiName>audioBufferByteLength</apiName><shortdesc>
	 Provides the NetStream audio buffer size in bytes.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Provides the NetStream audio buffer size in bytes. 
	 It specifies the buffer size for audio data in streaming media, both live and recorded.
	 This property is like <codeph>Netstream.bytesLoaded</codeph>,
	 which is used in progressive downloads. 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:audioBufferLength:get"><apiName>audioBufferLength</apiName><shortdesc>
	 Provides NetStream audio buffer size in seconds.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Provides NetStream audio buffer size in seconds. This property extends the <codeph>NetStream.bufferLength</codeph> property
	 and provides the buffer length in time specifically for audio data. 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:audioByteCount:get"><apiName>audioByteCount</apiName><shortdesc>
	 Specifies the total number of audio bytes that have arrived in the queue, regardless of how many have been played or flushed.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the total number of audio bytes that have arrived in the queue, regardless of how many have been played or flushed. 
	 You can use this value to calculate the incoming audio data rate, using the metric of your choice, by creating a timer and calculating the difference in values
	 in successive timer calls. Alternatively, use <codeph>audioBytesPerSecond</codeph>.
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStreamInfo/audioBytesPerSecond"><linktext>audioBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:audioBytesPerSecond:get"><apiName>audioBytesPerSecond</apiName><shortdesc>
	 Specifies the rate at which the NetStream audio buffer is filled in bytes per second.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the rate at which the NetStream audio buffer is filled in bytes per second. The value is calculated as a smooth 
	 average for the audio data received in the last second.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:audioLossRate:get"><apiName>audioLossRate</apiName><shortdesc>
	 Specifies the audio loss for the NetStream session.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the audio loss for the NetStream session. This value returns a valid value only for RTMFP streams and would return 0 for RTMP streams.
	 Loss rate is defined as the ratio of lost messages to total messages.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:byteCount:get"><apiName>byteCount</apiName><shortdesc>
	 Specifies the total number of bytes that have arrived into the queue, regardless of how many have been played or flushed.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the total number of bytes that have arrived into the queue, regardless of how many have been played or flushed. 
	 You can use this value to calculate the incoming data rate, using the metric of your choice, by creating a timer and calculating the difference in values
	 in successive timer calls. Alternatively, use <codeph>currentBytesPerSecond</codeph>.
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStreamInfo/currentBytesPerSecond"><linktext>currentBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:currentBytesPerSecond:get"><apiName>currentBytesPerSecond</apiName><shortdesc>
	 Specifies the rate at which the NetStream buffer is filled in bytes per second.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the rate at which the NetStream buffer is filled in bytes per second. The value is calculated as a smooth 
	 average for the total data received in the last second.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:dataBufferByteLength:get"><apiName>dataBufferByteLength</apiName><shortdesc>
	 Provides the NetStream data buffer size in bytes.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Provides the NetStream data buffer size in bytes. 
	 It specifies the buffer size for data messages in streaming media, both live and recorded.
	 This property is like <codeph>Netstream.bytesLoaded</codeph>,
	 which is used in progressive downloads. 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:dataBufferLength:get"><apiName>dataBufferLength</apiName><shortdesc>
	 Provides NetStream data buffer size in seconds.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Provides NetStream data buffer size in seconds. This property extends the <codeph>NetStream.bufferLength</codeph> property
	 and provides the buffer length in time specifically for data messages.  
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:dataByteCount:get"><apiName>dataByteCount</apiName><shortdesc>
	 Specifies the total number of bytes of data messages that have arrived in the queue, regardless of how many have been played or flushed.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the total number of bytes of data messages that have arrived in the queue, regardless of how many have been played or flushed. 
	 You can use this value to calculate the incoming data-messages rate, using the metric of your choice,
	 by creating a timer and calculating the difference in values in successive timer calls. 
	 Alternatively, use <codeph>dataBytesPerSecond</codeph>. 
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStreamInfo/dataBytesPerSecond"><linktext>dataBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:dataBytesPerSecond:get"><apiName>dataBytesPerSecond</apiName><shortdesc>
	 Specifies the rate at which the NetStream data buffer is filled in bytes per second.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the rate at which the NetStream data buffer is filled in bytes per second. The value is calculated as a smooth 
	 average for the data messages received in the last second.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:droppedFrames:get"><apiName>droppedFrames</apiName><shortdesc>
	 Returns the number of video frames dropped in the current NetStream playback session.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Returns the number of video frames dropped in the current NetStream playback session. 
	 <p>In recorded streaming or progressive download, if the video is a high-quality or high-resolution, high-bitrate video, 
	 the decoder can lag behind in decoding the required number of frames per second if it does not have adequate 
	 system CPU resources. In live streaming, the buffer drops video frames if the latency is too high. This property specifies
	 the number of frames that were dropped and not presented normally.</p>
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:maxBytesPerSecond:get"><apiName>maxBytesPerSecond</apiName><shortdesc>
	 Specifies the maximum rate at which the NetStream buffer is filled in bytes per second.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the maximum rate at which the NetStream buffer is filled in bytes per second. This value provides information about the capacity of the
	 client network based on the last messages received by the <codeph>NetStream</codeph> object. Depending on the size of the buffer specified in 
	 <codeph>NetStream.bufferTime</codeph> and the bandwidth available on the client, Flash Media Server fills the buffer in bursts.
	 This property provides the maximum rate at which the client buffer is filled.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:playbackBytesPerSecond:get"><apiName>playbackBytesPerSecond</apiName><shortdesc>
	 Returns the stream playback rate in bytes per second.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Returns the stream playback rate in bytes per second. The playback buffer can contain content of various playlists. 
	 This property provides the playback rate that closely matches the bit rate of the currently playing stream.
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:videoBufferByteLength:get"><apiName>videoBufferByteLength</apiName><shortdesc>
	 Provides the NetStream video buffer size in bytes.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Provides the NetStream video buffer size in bytes.  
	 It specifies the buffer size for video data in streaming media, both live and recorded.
	 This property is like <codeph>Netstream.bytesLoaded</codeph>,
	 which is used in progressive downloads. 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:videoBufferLength:get"><apiName>videoBufferLength</apiName><shortdesc>
	 Provides NetStream video buffer size in seconds.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Provides NetStream video buffer size in seconds. This property extends the <codeph>NetStream.bufferLength</codeph> property
	 and provides the buffer length in time specifically for video data. 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:videoByteCount:get"><apiName>videoByteCount</apiName><shortdesc>
	 Specifies the total number of video bytes that have arrived in the queue, regardless of how many have been played or flushed.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the total number of video bytes that have arrived in the queue, regardless of how many have been played or flushed. 
	 You can use this value to calculate the incoming video data rate, using the metric of your choice,
	 by creating a timer and calculating the difference in values in successive timer calls.
	 Alternatively, use <codeph>videoBytesPerSecond</codeph>, 
	 
	 </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStreamInfo/videoBytesPerSecond"><linktext>videoBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:videoBytesPerSecond:get"><apiName>videoBytesPerSecond</apiName><shortdesc>
	 Specifies the rate at which the NetStream video buffer is filled in bytes per second.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies the rate at which the NetStream video buffer is filled in bytes per second. The value is calculated as a smooth 
	 average for the video data received in the last second.
	 
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="flash.net:URLStream"><apiName>URLStream</apiName><shortdesc>
 The URLStream class provides low-level access to
 downloading URLs.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseInterface>flash.utils:IDataInput</apiBaseInterface><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
 The URLStream class provides low-level access to
 downloading URLs. Data is made available to application code
 immediately as it is downloaded, instead of waiting until
 the entire file is complete as with URLLoader.
 The URLStream class also lets you close a stream
 before it finishes downloading. 
 The contents of the downloaded file are made available as raw binary data.
 
 <p>The read operations in URLStream are nonblocking.
 This means that you must use the <codeph>bytesAvailable</codeph> property to determine
 whether sufficient data is available before reading it.  An
 <codeph>EOFError</codeph> exception is thrown if insufficient
 data is available.</p>
 
 <p>All binary data is encoded by default in big-endian format, with the
 most significant byte first.</p>
 
 <p>The security rules that apply to URL downloading with the URLStream class are identical
 to the rules applied to URLLoader objects.
 Policy files may be downloaded as needed. Local file security rules are enforced,
 and security warnings are raised as needed.</p>

 
 </apiDesc><example conref="examples\URLStreamExample.as"> The following example loads a SWF file and parses the beginning of its header to indicate 
 compression and version number information. 
 <p>To run the example, place a file named URLStreamExample.swf in the same directory as your SWF file.</p>
<codeblock>

package {
    import flash.display.Sprite;
    import flash.errors.*;
    import flash.events.*;
    import flash.net.URLRequest;
    import flash.net.URLStream;

    public class URLStreamExample extends Sprite {
        private static const ZLIB_CODE:String = "CWS";
        private var stream:URLStream;

        public function URLStreamExample() {
            stream = new URLStream();
            var request:URLRequest = new URLRequest("URLStreamExample.swf");
            configureListeners(stream);
            try {
                stream.load(request);
            } catch (error:Error) {
                trace("Unable to load requested URL.");
            }
        }

        private function configureListeners(dispatcher:EventDispatcher):void {
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
        }

        private function parseHeader():void {
            trace("parseHeader");
            trace("isCompressed: " + isCompressed());
            trace("version: " + stream.readByte());
        }

        private function isCompressed():Boolean {
            return (stream.readUTFBytes(3) == ZLIB_CODE);
        }

        private function completeHandler(event:Event):void {
            trace("completeHandler: " + event);
            parseHeader();
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:Event):void {
            trace("progressHandler: " + event);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function httpStatusHandler(event:HTTPStatusEvent):void {
            trace("httpStatusHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#URLLoader"><linktext>URLLoader</linktext></link><link href="flash.net.xml#URLRequest"><linktext>URLRequest</linktext></link></related-links><adobeApiEvent id="flash.net:URLStream_flash.events.ProgressEvent.PROGRESS_progress"><apiName>progress</apiName><shortdesc>
 Dispatched when data is received as the download operation progresses.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.ProgressEvent.PROGRESS</apiEventType><adobeApiEventClassifier>flash.events.ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when data is received as the download operation progresses.
 Data that has been received can be read immediately using the methods of the URLStream class.
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLStream/load()"><linktext>URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.Event.OPEN_open"><apiName>open</apiName><shortdesc>
 Dispatched when a load operation starts.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.OPEN</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when a load operation starts.
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLStream/load()"><linktext>URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.IOErrorEvent.IO_ERROR_ioError"><apiName>ioError</apiName><shortdesc>
 Dispatched when an input/output error occurs that causes a load operation to fail.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier>flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when an input/output error occurs that causes a load operation to fail. 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLStream/load()"><linktext>URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS_httpResponseStatus"><apiName>httpResponseStatus</apiName><shortdesc>
 Dispatched if a call to the URLStream.load() method attempts to access data over HTTP 
 and Adobe AIR is able to detect and return the status code for the request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="AIR" version="1.0"/><apiPlatform description="" name="AIR" version="1.0"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS</apiEventType><adobeApiEventClassifier>flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to the <codeph>URLStream.load()</codeph> method attempts to access data over HTTP 
 and Adobe AIR is able to detect and return the status code for the request. 
 
 <p>If a URLStream object registers for an <codeph>httpStatusEvent</codeph> event, error responses  
 are delivered as though they are content. So instead of dispatching an <codeph>ioError</codeph> 
 event, the URLStream dispatches <codeph>progress</codeph> and <codeph>complete</codeph> events as 
 the error data is loaded into the URLStream.</p>
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLStream/load()"><linktext>URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.HTTPStatusEvent.HTTP_STATUS_httpStatus"><apiName>httpStatus</apiName><shortdesc>
 Dispatched if a call to URLStream.load() 
 attempts to access data over HTTP, and Flash Player or  Adobe AIR
 is able to detect and return the status code for the request.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.HTTPStatusEvent.HTTP_STATUS</apiEventType><adobeApiEventClassifier>flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to <codeph>URLStream.load()</codeph> 
 attempts to access data over HTTP, and <ph platform="actionscript">Flash Player or </ph> Adobe AIR
 is able to detect and return the status code for the request. (Some browser environments
 may not be able to provide this information.) Note that the <codeph>httpStatus</codeph> 
 (if any) will be sent before (and in addition to) any <codeph>complete</codeph>
 or <codeph>error</codeph> event.
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLStream/load()"><linktext>URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError"><apiName>securityError</apiName><shortdesc>
 Dispatched if a call to URLStream.load() 
 attempts to load data from a server outside the security sandbox.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier>flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to <codeph>URLStream.load()</codeph> 
 attempts to load data from a server outside the security sandbox.
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#URLStream/load()"><linktext>URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.Event.COMPLETE_complete"><apiName>complete</apiName><shortdesc>
 Dispatched when data has loaded successfully.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.Event.COMPLETE</apiEventType><adobeApiEventClassifier>flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when data has loaded successfully. 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.net:URLStream:close"><apiName>close</apiName><shortdesc>
     Immediately closes the stream and
     cancels the download operation.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The stream could not be closed, or the stream was not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
     Immediately closes the stream and
     cancels the download operation.
     No data can be read from the stream after the <codeph>close()</codeph> method is called.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:load"><apiName>load</apiName><shortdesc>
     Begins downloading the URL specified in the request parameter.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><codeph>URLRequest.requestHeader</codeph> objects may not contain
     certain prohibited HTTP request headers. For more information, see the URLRequestHeader class
     description.
     
     </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiException><apiDesc>This error can occur for the following reasons:
     
     <ol>
     
     <li>Flash Player or Adobe AIR cannot convert the <codeph>URLRequest.data</codeph> parameter from UTF8 to MBCS. This error is
     applicable if the URLRequest object passed to <codeph>load()</codeph> is set to perform a <codeph>GET</codeph> operation
     and if <codeph>System.useCodePage</codeph> is set to <codeph>true</codeph>.</li>
     
     <li>Flash Player or Adobe AIR cannot allocate memory for
     the <codeph>POST</codeph> data. This error is applicable if the URLRequest object passed to load is set
     to perform a <codeph>POST</codeph> operation.</li></ol>
     
     </apiDesc><apiItemName>MemoryError</apiItemName><apiOperationClassifier>flash.errors:MemoryError</apiOperationClassifier></apiException><apiException><apiDesc>Local untrusted SWF files may not communicate with
     the Internet. This may be worked around by reclassifying this SWF file
     as local-with-networking or trusted.
     
      </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>If you are trying to connect to a commonly reserved port. 
      For a complete list of blocked ports, see "Restricting Networking APIs" in the 
      security chapter of the <i>Programming ActionScript 3.0</i> book.
     
     </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>request</apiItemName><apiOperationClassifier>flash.net:URLRequest</apiOperationClassifier><apiDesc>A URLRequest object specifying the URL to download. If the value of
     this parameter or the <codeph>URLRequest.url</codeph> property of the URLRequest object
	 passed are <codeph>null</codeph>, the application throws a null pointer error.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Begins downloading the URL specified in the <codeph>request</codeph> parameter.
     
     <p><b>Note</b>: If a file being loaded contains non-ASCII characters
     (as found in many non-English languages), it is recommended that you save the file
     with UTF-8 or UTF-16 encoding, as opposed to a non-Unicode format like ASCII.</p>
     
     <p>If the loading operation fails immediately, an IOError or SecurityError
     (including the local file security error) exception is thrown describing the failure.
     Otherwise, an <codeph>open</codeph> event is dispatched if the URL download
     starts downloading successfully, or an error event is dispatched if an error occurs.</p>
     
     <p>By default, the calling SWF file and the URL you load must be in exactly the same domain.
     For example, a SWF file at www.adobe.com can load data only from sources that are also at www.adobe.com. 
     To load data from a different domain, place a URL policy file on the server hosting the data.</p>
     
      <p platform="actionscript">In Flash Player, you cannot connect to commonly reserved ports. 
      For a complete list of blocked ports, see "Restricting Networking APIs" in the 
      <ph product="flex">
      <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
      </ph>
      <ph product="flash">
      <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
      </ph>
      of the <i>Programming ActionScript 3.0</i> book.</p>
     
     <p platform="actionscript">In Flash Player, you can prevent a SWF file from using this method by setting the 
     <codeph>allowNetworking</codeph> parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> 
     tags in the HTML page that contains the SWF content.</p>
     
     <p platform="actionscript"> In Flash Player 10 and later, and in AIR 1.5 and later, if you use a multipart 
     Content-Type (for example "multipart/form-data") 
     that contains an upload (indicated by a "filename" parameter in a "content-disposition" header within the POST body),
	 the POST operation is subject to the security rules applied to uploads:</p>
	 <ul platform="actionscript">
	 <li>The POST operation must be performed in response to a user-initiated action, such as a mouse click or key press.</li>
	 <li>If the POST operation is cross-domain (the POST target is not on the same server as the SWF file 
	 that is sending the POST request),
	 the target server must provide a URL policy file that permits cross-domain access.</li>
	 </ul>
     <p platform="actionscript">Also, for any multipart Content-Type, the syntax must be valid (according to the RFC2046 standards).
     If the syntax appears to be invalid, the POST operation is subject to the security rules applied to uploads.</p>
     
     <p platform="actionscript">These rules also apply to AIR content in non-application sandboxes. 
     However, in Adobe AIR, content in the application sandbox (content installed with the AIR application) 
     are not restricted by these security limitations.</p>
     
     <p platform="actionscript">For more information related to security, see the following:</p>
     <ul platform="actionscript">
     
     <li product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
     <li product="flash">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
     <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     
     <li>The "Understanding AIR Security" section of the "Getting started with Adobe AIR" chapter
     in the <i>Developing AIR Applications</i> book.</li>
     
     </ul>
     
     <p>In AIR, a URLRequest object can register for the <codeph>httpResponse</codeph> status event.
     Unlike the <codeph>httpStatus</codeph> event, the <codeph>httpResponseStatus</codeph> event is 
     delivered before any response data. Also, the <codeph>httpResponseStatus</codeph> event includes 
     values for the <codeph>responseHeaders</codeph> and <codeph>responseURL</codeph> properties (which are 
     undefined for an <codeph>httpStatus</codeph> event. Note that the <codeph>httpResponseStatus</codeph> event
     (if any) will be sent before (and in addition to) any <codeph>complete</codeph> or <codeph>error</codeph> 
     event. 
     </p>
     
     
     <p>If there <i>is</i> an <codeph>httpResponseStatus</codeph> event listener, the body of the response 
     message is <i>always</i> sent; and HTTP status code responses always results in a <codeph>complete</codeph> event. 
     This is true in spite of whether the HTTP response status code indicates a success or an error.</p> 
     
     <p><ph platform="actionscript">In AIR, if</ph><ph platform="javascript">If</ph> there is 
     <i>no</i> <codeph>httpResponseStatus</codeph> event listener, the behavior differs
     based on the <ph platform="actionscript">SWF</ph><ph platform="javascript">AIR</ph> version:</p>
     
     <ul>
     
         <li><ph platform="actionscript">For SWF 9 content</ph><ph platform="javascript">In an AIR file
     in which the application descriptor specifies AIR 1.0 or 1.1 as the runtime version</ph>, the body of 
     the HTTP response message is sent <i>only if</i> the HTTP response status code indicates success. 
     Otherwise (if there is an error), no body is sent and the URLRequest object dispatches an IOError event.</li>
     
         <li><ph platform="actionscript">For SWF 10 content</ph><ph platform="javascript">In an AIR file
     in which the application descriptor specifies AIR 1.5 as the runtime version</ph>, the body of 
     the HTTP response message is <i>always</i> sent. If there is an error, the URLRequest object dispatches
     an IOError event.</li>
     
     </ul>
     
     
     </apiDesc></apiOperationDetail><adobeApiEvent id="flash.net:URLStream:load_complete"><apiName>complete</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched after data has loaded successfully. If there is a <codeph>httpResponseStatus</codeph>
     event listener, the URLRequest object also dispatches a <codeph>complete</codeph> event whether the HTTP response status code 
     indicates a success <i>or</i> an error.
     
	 </apiDesc></adobeApiEventDetail><shortdesc>Dispatched after data has loaded successfully.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLStream:load_httpStatus"><apiName>httpStatus</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>If access is by HTTP <ph platform="actionscript">and 
	 the current environment supports obtaining status codes</ph>, you may
     receive these events in addition to any <codeph>complete</codeph>
     or <codeph>error</codeph> event.
     
	 </apiDesc></adobeApiEventDetail><shortdesc>If access is by HTTP and 
	 the current environment supports obtaining status codes, you may
     receive these events in addition to any complete
     or error event.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLStream:load_httpResponseStatus"><apiName>httpResponseStatus</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched if a call to the <codeph>load()</codeph> method attempts
	 to access data over HTTP and Adobe AIR is able to detect and return the status code for the request. 
	 
     </apiDesc></adobeApiEventDetail><shortdesc>Dispatched if a call to the load() method attempts
	 to access data over HTTP and Adobe AIR is able to detect and return the status code for the request.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLStream:load_ioError"><apiName>ioError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>The load operation could not be
     completed.
     
     </apiDesc></adobeApiEventDetail><shortdesc>The load operation could not be
     completed.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLStream:load_open"><apiName>open</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>Dispatched when a load operation starts.
     
     </apiDesc></adobeApiEventDetail><shortdesc>Dispatched when a load operation starts.</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLStream:load_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>A load operation attempted
     to retrieve data from a server outside the caller's security sandbox.
     This may be worked around using a policy file on the server.
     </apiDesc></adobeApiEventDetail><shortdesc>A load operation attempted
     to retrieve data from a server outside the caller's security sandbox.</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:URLStream:readBoolean"><apiName>readBoolean</apiName><shortdesc>
     Reads a Boolean value from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc><codeph>True</codeph> is returned if the byte is nonzero, <codeph>false</codeph> otherwise.
     
	 </apiDesc><apiOperationClassifier>Boolean</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads a Boolean value from the stream. A single byte is read,
     and <codeph>true</codeph> is returned if the byte is nonzero,
     <codeph>false</codeph> otherwise.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readByte"><apiName>readByte</apiName><shortdesc>
     Reads a signed byte from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>Value in the range -128...127.
     
	 </apiDesc><apiOperationClassifier>int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads a signed byte from the stream.
     <p>The returned value is in the range -128...127.</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readBytes"><apiName>readBytes</apiName><shortdesc>
     Reads length bytes of data from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
	 </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream, or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>bytes</apiItemName><apiOperationClassifier>flash.utils:ByteArray</apiOperationClassifier><apiDesc>The ByteArray object to read
                  data into.
     </apiDesc></apiParam><apiParam><apiItemName>offset</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiData>0</apiData><apiDesc>The offset into <codeph>bytes</codeph> at which data
                   read should begin.  Defaults to 0.
     </apiDesc></apiParam><apiParam><apiItemName>length</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiData>0</apiData><apiDesc>The number of bytes to read.  The default value
                   of 0 will cause all available data to be read.
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
     Reads <codeph>length</codeph> bytes of data from the stream.
     The bytes are read into the ByteArray object specified
     by <codeph>bytes</codeph>, starting <codeph>offset</codeph> bytes into
     the ByteArray object.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readDouble"><apiName>readDouble</apiName><shortdesc>
     Reads an IEEE 754 double-precision floating-point number from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>An IEEE 754 double-precision floating-point number from the stream.
     
	 </apiDesc><apiOperationClassifier>Number</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads an IEEE 754 double-precision floating-point number from the stream.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readFloat"><apiName>readFloat</apiName><shortdesc>
     Reads an IEEE 754 single-precision floating-point number from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>An IEEE 754 single-precision floating-point number from the stream.
     
	 </apiDesc><apiOperationClassifier>Number</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads an IEEE 754 single-precision floating-point number from the stream.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readInt"><apiName>readInt</apiName><shortdesc>
     Reads a signed 32-bit integer from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>Value in the range -2147483648...2147483647.
     
	 </apiDesc><apiOperationClassifier>int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads a signed 32-bit integer from the stream.
     <p>The returned value is in the range -2147483648...2147483647.</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readMultiByte"><apiName>readMultiByte</apiName><shortdesc>
     Reads a multibyte string of specified length from the byte stream using the
     specified character set.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>URLStream, URLStream.readMultiByte, readMultiByte
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
	 Flash Player prevents the URLStream data from being available to ActionScript.
	 When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiReturn><apiDesc>UTF-8 encoded string.
     </apiDesc><apiOperationClassifier>String</apiOperationClassifier></apiReturn><apiParam><apiItemName>length</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiDesc>The number of bytes from the byte stream to read.
     </apiDesc></apiParam><apiParam><apiItemName>charSet</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The string denoting the character set to use to interpret the bytes. 
     Possible character set strings include <codeph>"shift_jis"</codeph>, <codeph>"CN-GB"</codeph>,
     <codeph>"iso-8859-1"</codeph>, and others.
     For a complete list, see <xref href="../../charset-codes.html">Supported Character Sets</xref>.    
	 
     <p><b>Note:</b> If the value for the <codeph>charSet</codeph> parameter is not recognized 
	 by the current system, the application uses the system's default code page as the character set. 
	 For example, a value for the <codeph>charSet</codeph> parameter, as in 
	 <codeph>myTest.readMultiByte(22, "iso-8859-01")</codeph> that uses <codeph>01</codeph> instead of <codeph>1</codeph> 
	 might work on your development machine, but not on another machine. On the other machine, 
	 the application will use the system's default code page.</p>
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc>
     Reads a multibyte string of specified length from the byte stream using the
     specified character set.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readObject"><apiName>readObject</apiName><shortdesc>
     Reads an object from the socket, encoded in Action Message Format (AMF).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>There is insufficient data available
     to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
     received, and any of the read methods throws an EOFError exception.
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>The deserialized object.
     </apiDesc><apiType value="any"/></apiReturn></apiOperationDef><apiDesc>
     Reads an object from the socket, encoded in Action Message Format (AMF).
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#ObjectEncoding"><linktext>ObjectEncoding</linktext></link></related-links></apiOperation><apiOperation id="flash.net:URLStream:readShort"><apiName>readShort</apiName><shortdesc>
     Reads a signed 16-bit integer from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>Value in the range -32768...32767.
     
	 </apiDesc><apiOperationClassifier>int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads a signed 16-bit integer from the stream.
     <p>The returned value is in the range -32768...32767.</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readUTF"><apiName>readUTF</apiName><shortdesc>
     Reads a UTF-8 string from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A UTF-8 string.
     
	 </apiDesc><apiOperationClassifier>String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads a UTF-8 string from the stream.  The string
     is assumed to be prefixed with an unsigned short indicating
     the length in bytes.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readUTFBytes"><apiName>readUTFBytes</apiName><shortdesc>
     Reads a sequence of length UTF-8
     bytes from the stream, and returns a string.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>A UTF-8 string produced by the byte representation of characters of specified length.
     
	 </apiDesc><apiOperationClassifier>String</apiOperationClassifier></apiReturn><apiParam><apiItemName>length</apiItemName><apiOperationClassifier>uint</apiOperationClassifier><apiDesc>A sequence of UTF-8 bytes.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Reads a sequence of <codeph>length</codeph> UTF-8
     bytes from the stream, and returns a string.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readUnsignedByte"><apiName>readUnsignedByte</apiName><shortdesc>
     Reads an unsigned byte from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>

     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>Value in the range 0...255.
     
	 </apiDesc><apiOperationClassifier>uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads an unsigned byte from the stream.
     <p>The returned value is in the range 0...255. </p>     
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readUnsignedInt"><apiName>readUnsignedInt</apiName><shortdesc>
     Reads an unsigned 32-bit integer from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>Value in the range 0...4294967295.
     
	 </apiDesc><apiOperationClassifier>uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads an unsigned 32-bit integer from the stream.
     <p>The returned value is in the range 0...4294967295. </p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readUnsignedShort"><apiName>readUnsignedShort</apiName><shortdesc>
     Reads an unsigned 16-bit integer from the stream.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc><ph platform="actionscript">There is insufficient 
	 data available to read. If a local SWF file triggers a security warning,
     Flash Player prevents the URLStream data from being available to ActionScript.
     When this happens, the <codeph>bytesAvailable</codeph> property returns 0 even if data has been
	 received, and any of the read methods throws an EOFError exception.</ph>
	 <ph platform="javascript">This error applies to SWF content; it does not occur
	 in JavaScript code running in AIR.</ph>
	 
     </apiDesc><apiItemName>EOFError</apiItemName><apiOperationClassifier>flash.errors:EOFError</apiOperationClassifier></apiException><apiException><apiDesc>An I/O error occurred on the stream,
     or the stream is not open.
     </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiReturn><apiDesc>Value in the range 0...65535.
     
	 </apiDesc><apiOperationClassifier>uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc>
     Reads an unsigned 16-bit integer from the stream.
     <p>The returned value is in the range 0...65535. </p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:URLStream:bytesAvailable:get"><apiName>bytesAvailable</apiName><shortdesc>
     Returns the number of bytes of data available for reading
     in the input buffer.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
     Returns the number of bytes of data available for reading
     in the input buffer.
     Your code must call the <codeph>bytesAvailable</codeph> property to ensure
     that sufficient data is available before you try to read
     it with one of the <codeph>read</codeph> methods.
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLStream:connected:get"><apiName>connected</apiName><shortdesc>
     Indicates whether this URLStream object is
     currently connected.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Boolean</apiValueClassifier></apiValueDef><apiDesc>
     Indicates whether this URLStream object is
     currently connected. A call to this property returns a value of <codeph>true</codeph>
     if the URLStream object is connected, or <codeph>false</codeph> otherwise.     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLStream:endian:get"><apiName>endian</apiName><shortdesc>
     Indicates the byte order for the data.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier><apiDefaultValue>Endian.BIG_ENDIAN
     </apiDefaultValue></apiValueDef><apiDesc>
     Indicates the byte order for the data. Possible values are 
     <codeph>Endian.BIG_ENDIAN</codeph> or <codeph>Endian.LITTLE_ENDIAN</codeph>.
     </apiDesc></apiValueDetail><related-links><link href="flash.utils.xml#Endian"><linktext>flash.utils.Endian</linktext></link></related-links></apiValue><apiValue id="flash.net:URLStream:objectEncoding:get"><apiName>objectEncoding</apiName><shortdesc>
     Controls the version of Action Message Format (AMF) used when writing or reading an object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>Property documented; needs review
     </internal></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
     Controls the version of Action Message Format (AMF) used when writing or reading an object.
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#URLStream/readObject()"><linktext>readObject()</linktext></link><link href="flash.net.xml#ObjectEncoding"><linktext>ObjectEncoding class</linktext></link></related-links></apiValue></apiClassifier><apiClassifier id="flash.net:SharedObject"><apiName>SharedObject</apiName><shortdesc>
 The SharedObject class is used to read and store limited amounts of data on a user's computer
 or on a server.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>SharedObject, shared object, constructor
 
 </keyword></asCustoms></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
 The SharedObject class is used to read and store limited amounts of data on a user's computer
 or on a server.
 Shared objects offer real-time data sharing between multiple client SWF files and objects
 that are persistent on the local computer or remote server. Local shared objects are similar 
 to browser cookies and remote shared objects are similar to real-time data transfer devices. 
 To use remote shared objects, you need Adobe Flash Media Server.
 
 <p>Use shared objects to do the following:</p>
 
 <ul>
 
 <li><b>Maintain local persistence</b>.
 This is the simplest way to use a shared object, and does not require Flash Media Server.
 For example, you can call <codeph>SharedObject.getLocal()</codeph> to create a shared object in an
 application, such as a calculator with memory. When the user closes the calculator,
 Flash Player saves the last value in a shared object on the user's computer.
 The next time the calculator is run, it contains the values it had previously.
 Alternatively, if you set the shared object's properties to <codeph>null</codeph> before the
 calculator application is closed,  the next time the 
 application runs, it opens without any values.
 
 Another example of maintaining local persistence is tracking user preferences or 
 other data for a complex website, such as a record of which
 articles a user read on a news site. Tracking this information allows you to display
 articles that have already been read differently from new, unread articles. 
 Storing this information on the user's computer reduces server load.</li>
 
 <li><b>Store and share data on Flash Media Server</b>. 
 A shared object can store data on the server for other clients to retrieve.
 For example, call <codeph>SharedObject.getRemote()</codeph> to create a remote shared object, 
 such as a phone list, that is persistent on the server. Whenever a client makes changes
 to the shared object, the revised data is available to all clients currently 
 connected to the object or who later connect to it. If the object is also persistent locally, 
 and a client changes data while not connected to the server, the data is copied to the remote shared 
 object the next time the client connects to the object.</li>
 
 <li><b>Share data in real time</b>.
 A shared object can share data among multiple clients in real time. 
 For example, you can open a remote shared object that stores
 a list of users connected to a chat room that is visible to all clients
 connected to the object. When a user enters or leaves the chat room, the object 
 is updated and all clients that are connected to the object see the revised list
 of chat room users.</li>
 
 </ul>
 
 <p> To create a local shared object, call <codeph>SharedObject.getLocal()</codeph>. To create
 a remote shared object, call <codeph>SharedObject.getRemote()</codeph>.</p> 
 
 <p> When an application closes, shared objects are <i>flushed</i>, or written to a disk.
 You can also call the <codeph>flush()</codeph> method to explicitly write data to a disk.</p>
 
 <p><b>Local disk space considerations.</b> Local shared objects have some limitations 
 that are important to consider as you design your application.
 Sometimes SWF files may not be allowed to write local shared objects, and sometimes the data
 stored in local shared objects can be deleted without your knowledge. Flash Player users 
 can manage the disk space that is available to individual domains or
 to all domains. When users decrease the amount of disk space available, some local shared
 objects may be deleted. Flash Player users also have privacy controls that can prevent
 third-party domains (domains other than the domain in the current browser address bar) from
 reading or writing local shared objects.</p>
 
 <p><b>Note</b>: SWF files that are stored and run on a local computer, not from a remote server,
 can always write third-party shared objects to disk.
 For more information about third-party shared objects, see the
 <xref href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html" scope="external">Global Storage Settings panel</xref> in Flash Player Help.</p>
 
 <p>It's a good idea to check for failures related to the amount of disk space and to
 user privacy controls. Perform these checks when you call <codeph>getLocal()</codeph> and
 <codeph>flush()</codeph>:
 
 <ul>
 <li><codeph>SharedObject.getLocal()</codeph> — Flash Player throws an exception when 
 a call to this method fails, such as when the user has disabled
 third-party shared objects and the domain of your SWF file does not match the domain in the browser
 address bar.</li>
 
 <li><codeph>SharedObject.flush()</codeph> — Flash Player throws an exception
 when a call to this method fails. It returns <codeph>SharedObjectFlushStatus.FLUSHED</codeph> when it succeeds.
 It returns <codeph>SharedObjectFlushStatus.PENDING</codeph>
 when additional storage space is needed. Flash Player prompts the user to allow an increase
 in storage space for locally saved information. Thereafter, the <codeph>netStatus</codeph> event
 is dispatched with an information object indicating whether the flush failed or succeeded.</li>
 </ul></p>
 
 <p>If your SWF file attempts to create or modify local shared objects, make sure
 that your SWF file is at least 215 pixels wide and at least 138 pixels high (the 
 minimum dimensions for displaying the dialog box that prompts users to increase their 
 local shared object storage limit). If your SWF file is smaller than these dimensions and an
 increase in the storage limit is required, <codeph>SharedObject.flush()</codeph> fails,
 returning <codeph>SharedObjectFlushedStatus.PENDING</codeph> and dispatching the <codeph>netStatus</codeph> event.</p>
 
 <p>
 <b>Remote shared objects.</b> 
 With Flash Media Server, you can create and use remote shared objects, 
 that are shared in real-time by all clients connected to your application.
 When one client changes a property of a remote shared object, the property 
 is changed for all connected clients.
 You can use remote shared objects to synchronize clients, for example, users
 in a multi-player game.
 </p>
 
 <p>
 Each remote shared object has a <codeph>data</codeph> property which is an Object with properties
 that store data. Call <codeph>setProperty()</codeph> 
 to change an property of the data object.
 The server updates the properties, dispatches a <codeph>sync</codeph> event, and
 sends the properties back to the connected clients. 
 </p>
 
 <p>
 You can choose to make remote shared objects persistent on the client, the server,
 or both. By default, Flash Player saves locally persistent remote shared objects up to 100K in size. 
 When you try to save a larger object, Flash Player displays the Local Storage dialog box, 
 which lets the user allow or deny local storage for the shared object. 
 Make sure your Stage size is at least 215 by 138 pixels; this is the minimum size Flash 
 requires to display the dialog box.
 </p>
 <p>
 If the user selects Allow, the server saves the shared object and 
 dispatches a <codeph>netStatus</codeph> event with a <codeph>code</codeph> property of 
 <codeph>SharedObject.Flush.Success</codeph>.
 If the user select Deny, the server does not save the shared object and dispatches
 a <codeph>netStatus</codeph> event
 with a <codeph>code</codeph> property of <codeph>SharedObject.Flush.Failed</codeph>.
 </p>
 
 </apiDesc><example conref="examples\SharedObjectExample.as"> The following code creates (and on subsequent executions, retrieves) a shared object
 object using the ID <codeph>"application-name"</codeph>. When the Save button is clicked, the
 <codeph>saveValue()</codeph> method attempts to save a property named <codeph>savedValue</codeph>
 to the <codeph>data</codeph> property of the SharedObject object. If Flash Player must ask for permission to save
 the data, when the user grants or denies permission the <codeph>onFlushStatus()</codeph> method is
 called. When the Clear button is clicked, the <codeph>clearValue()</codeph> method deletes the value
 saved in <codeph>savedValue</codeph>; the next time the SWF file is loaded, the value that is retrieved
 is <codeph>undefined</codeph>.
 
<codeblock>
package {
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import flash.events.NetStatusEvent;
    import flash.net.SharedObject;
    import flash.net.SharedObjectFlushStatus;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFieldType;
    
    public class SharedObjectExample extends Sprite {
        
        private var mySo:SharedObject;
        
        public function SharedObjectExample() {
            buildUI();
            saveBtn.addEventListener(MouseEvent.CLICK, saveValue);
            clearBtn.addEventListener(MouseEvent.CLICK, clearValue);
            
            mySo = SharedObject.getLocal("application-name");
            output.appendText("SharedObject loaded...\n");
            output.appendText("loaded value: " + mySo.data.savedValue + "\n\n");
        }

         private function saveValue(event:MouseEvent):void {
            output.appendText("saving value...\n");
            mySo.data.savedValue = input.text;
            
            var flushStatus:String = null;
            try {
                flushStatus = mySo.flush(10000);
            } catch (error:Error) {
                output.appendText("Error...Could not write SharedObject to disk\n");
            }
            if (flushStatus != null) {
                switch (flushStatus) {
                    case SharedObjectFlushStatus.PENDING:
                        output.appendText("Requesting permission to save object...\n");
                        mySo.addEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
                        break;
                    case SharedObjectFlushStatus.FLUSHED:
                        output.appendText("Value flushed to disk.\n");
                        break;
                }
            }
            output.appendText("\n");
        }
        
        private function clearValue(event:MouseEvent):void {
            output.appendText("Cleared saved value...Reload SWF and the value should be \"undefined\".\n\n");
            delete mySo.data.savedValue;
        }
        
        private function onFlushStatus(event:NetStatusEvent):void {
            output.appendText("User closed permission dialog...\n");
            switch (event.info.code) {
                case "SharedObject.Flush.Success":
                    output.appendText("User granted permission -- value saved.\n");
                    break;
                case "SharedObject.Flush.Failed":
                    output.appendText("User denied permission -- value not saved.\n");
                    break;
            }
            output.appendText("\n");

            mySo.removeEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
        }
        
        // UI elements
        private var inputLbl:TextField;
        private var input:TextField;
        private var output:TextField;
        private var saveBtn:Sprite;
        private var clearBtn:Sprite;
    
        private function buildUI():void {
            // input label
            inputLbl = new TextField();
            addChild(inputLbl);
            inputLbl.x = 10;
            inputLbl.y = 10;
            inputLbl.text = "Value to save:";
            
            // input TextField
            input = new TextField();
            addChild(input);
            input.x = 80;
            input.y = 10;
            input.width = 100;
            input.height = 20;
            input.border = true;
            input.background = true;
            input.type = TextFieldType.INPUT;
            
            // output TextField
            output = new TextField();
            addChild(output);
            output.x = 10;
            output.y = 35;
            output.width = 250;
            output.height = 250;
            output.multiline = true;
            output.wordWrap = true;
            output.border = true;
            output.background = true;
            
            // Save button
            saveBtn = new Sprite();
            addChild(saveBtn);
            saveBtn.x = 190;
            saveBtn.y = 10;
            saveBtn.useHandCursor = true;
            saveBtn.graphics.lineStyle(1);
            saveBtn.graphics.beginFill(0xcccccc);
            saveBtn.graphics.drawRoundRect(0, 0, 30, 20, 5, 5);
            var saveLbl:TextField = new TextField();
            saveBtn.addChild(saveLbl);
            saveLbl.text = "Save";
            saveLbl.selectable = false;
            
            // Clear button
            clearBtn = new Sprite();
            addChild(clearBtn);
            clearBtn.x = 230;
            clearBtn.y = 10;
            clearBtn.useHandCursor = true;
            clearBtn.graphics.lineStyle(1);
            clearBtn.graphics.beginFill(0xcccccc);
            clearBtn.graphics.drawRoundRect(0, 0, 30, 20, 5, 5);
            var clearLbl:TextField = new TextField();
            clearBtn.addChild(clearLbl);
            clearLbl.text = "Clear";
            clearLbl.selectable = false;
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#SharedObject/flush()"><linktext>flush()</linktext></link><link href="flash.net.xml#SharedObject/getLocal()"><linktext>getLocal()</linktext></link><link href="flash.net.xml#SharedObject/event:netStatus"><linktext>netStatus</linktext></link></related-links><adobeApiEvent id="flash.net:SharedObject_flash.events.SyncEvent.SYNC_sync"><apiName>sync</apiName><shortdesc>
 Dispatched when a remote shared object has been updated by the server.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.SyncEvent.SYNC</apiEventType><adobeApiEventClassifier>flash.events.SyncEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when a remote shared object has been updated by the server.
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#SharedObject/getRemote()"><linktext>getRemote()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:SharedObject_flash.events.NetStatusEvent.NET_STATUS_netStatus"><apiName>netStatus</apiName><shortdesc>
 Dispatched when a SharedObject instance is reporting its status or error condition.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.NetStatusEvent.NET_STATUS</apiEventType><adobeApiEventClassifier>flash.events.NetStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when a SharedObject instance is reporting its status or error condition. 
 The <codeph>netStatus</codeph> event contains an <codeph>info</codeph> property,
 which is an information object 
 that contains specific information about the event, such as whether a connection
 attempt succeeded or whether the shared object was successfully written to the local disk. 
 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.events.xml#NetStatusEvent/info"><linktext>flash.events.NetStatusEvent.info</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:SharedObject_flash.events.AsyncErrorEvent.ASYNC_ERROR_asyncError"><apiName>asyncError</apiName><shortdesc>
 Dispatched when an exception is thrown asynchronously &amp;#x2014; that is, 
 from native asynchronous code.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.AsyncErrorEvent.ASYNC_ERROR</apiEventType><adobeApiEventClassifier>flash.events.AsyncErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when an exception is thrown asynchronously — that is, 
 from native asynchronous code. 
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.net:SharedObject:clear"><apiName>clear</apiName><shortdesc>
     For local shared objects, purges all of the data and deletes the shared object from the disk.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>SharedObject, SharedObject.clear, clear
     
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
     For local shared objects, purges all of the data and deletes the shared object from the disk.
     The reference to the shared object is still active, but its data properties are deleted.
     
     <p>
     For remote shared objects used with Flash Media Server,
     <codeph>clear()</codeph> disconnects the object and purges 
     all of the data. If the shared object is locally persistent, this method also deletes the shared object
     from the disk. The reference to the shared object is still active, but its data properties
     are deleted.
     </p>
      
     
     </apiDesc><example conref="examples\SharedObject_clear.as"> The following code creates (and on subsequent executions, retrieves) a SharedObject
 object using an id with the value of <codeph>hostName</codeph>. A property named <codeph>username</codeph>
 is added to the data property of the SharedObject object.
 The <codeph>clear()</codeph> method is finally called, which wipes out all information that was added
 to the data object (in this case was a single property named <codeph>username</codeph>).
<codeblock>

package {
    import flash.net.SharedObject;

    public class SharedObject_clear {
        private var hostName:String = "yourDomain";
        private var username:String = "yourUsername";

        public function SharedObject_clear() {
            var mySo:SharedObject = SharedObject.getLocal(hostName);
            if(mySo.data.username == null) {
                mySo.data.username = username;
                trace("set: " + mySo.data.username); // yourUsername
            }
            else {
                mySo.clear();
                trace("cleared: " + mySo.data.username); // undefined
            }
        }
    }
}
</codeblock></example></apiOperationDetail></apiOperation><apiOperation id="flash.net:SharedObject:close"><apiName>close</apiName><shortdesc>
     Closes the connection between a remote shared object and the server.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>server-specific: This info is relevant for Flash Media Server, but not Flex Data Services.
     
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
     Closes the connection between a remote shared object and the server.
     If a remote shared object is locally persistent, the user can make changes
     to the local copy of the object after this method is called. Any changes made
     to the local object are sent to the server the next time the user connects
     to the remote shared object.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:SharedObject:connect"><apiName>connect</apiName><shortdesc>
     Connects to a remote shared object on a server through a specified NetConnection object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>server-specific: On FMS, can connect to a shared object, but cannot pass a message as a second param.
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Flash Player could not connect to the specified remote shared object.
     Verify that the NetConnection instance is valid and connected and that the 
     remote shared object was successfully created on the server.
     
     </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>myConnection</apiItemName><apiOperationClassifier>flash.net:NetConnection</apiOperationClassifier><apiDesc>A NetConnection object that uses the Real-Time Messaging Protocol (RTMP), 
     such as a NetConnection object used to communicate with Flash Media Server.
     
     </apiDesc></apiParam><apiParam><apiItemName>params</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>A string defining a message to pass to the remote shared object on the server.
     Cannot be used with Flash Media Server.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Connects to a remote shared object on a server through a specified NetConnection object.
     Use this method after calling <codeph>getRemote()</codeph>.
     When a connection is successful, the <codeph>sync</codeph> event is dispatched.
     
     <p>Before attempting to work with a remote shared object, 
     first check for any errors using a <codeph>try..catch..finally</codeph> statement.
     Then, listen for and handle the <codeph>sync</codeph> event before 
     you make changes to the shared object. Any changes made
     locally — before the <codeph>sync</codeph> event is dispatched — might be lost.
     </p>
     
     <p>
     Call the <codeph>connect()</codeph> method 
     to connect to a remote shared object, for example:
     </p>
     
	 <codeblock platform="actionscript">
     var myRemoteSO:SharedObject = SharedObject.getRemote("mo", myNC.uri, false);
     myRemoteSO.connect(myNC);
     </codeblock>
     
	 <codeblock platform="javascript">
	 var myRemoteSO = air.SharedObject.getRemote("mo", myNC.uri, false);
	 myRemoteSO.connect(myNC);
	 </codeblock>
	 
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#SharedObject/getRemote()"><linktext>getRemote()</linktext></link><link href="flash.net.xml#SharedObject/event:sync"><linktext>sync</linktext></link><link href="../../statements.html#try..catch..finally"><linktext>try..catch..finally</linktext></link><link href="flash.net.xml#NetConnection"><linktext>NetConnection</linktext></link></related-links></apiOperation><apiOperation id="flash.net:SharedObject:flush"><apiName>flush</apiName><shortdesc>
     Immediately writes a locally persistent shared object to a local file.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>SharedObject, SharedObject.flush, flush
     
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>Flash Player cannot write the shared object to disk. This error might 
     occur if the user has permanently disallowed local information storage for 
     objects from this domain.
      
     
     <p><b>Note:</b> Local content can always write shared objects
     from third-party domains (domains other than the domain in the current browser address bar)
     to disk, even if writing of third-party shared objects to disk is disallowed.</p>
     
     </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiReturn><apiDesc>Either of the following values:
     <ul>
     <li><codeph>SharedObjectFlushStatus.PENDING</codeph>: The user has permitted local information 
     storage for objects from this domain, but the 
     amount of space allotted is not sufficient to store the object. Flash Player prompts
     the user to allow more space. 
     To allow space for the shared object to grow when it is saved, thus avoiding
     a <codeph>SharedObjectFlushStatus.PENDING</codeph> return value, pass a value
     for <codeph>minDiskSpace</codeph>.
     </li>
     
     <li><codeph>SharedObjectFlushStatus.FLUSHED</codeph>: The shared object has been
     successfully written to a file on the local disk.</li>
     </ul>
     
     </apiDesc><apiOperationClassifier>String</apiOperationClassifier></apiReturn><apiParam><apiItemName>minDiskSpace</apiItemName><apiOperationClassifier>int</apiOperationClassifier><apiData>0</apiData><apiDesc>The minimum disk space, in bytes, 
     that must be allotted for this object.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Immediately writes a locally persistent shared object to a local file. If you don't use this 
     method, Flash Player writes the shared object to a file when the shared object session ends — 
     that is, when the SWF file is closed, when the shared object is garbage-collected 
     because it no longer has any references to it, or when you call <codeph>SharedObject.clear()</codeph>
     or <codeph>SharedObject.close()</codeph>. 
     
     <p>If this method returns <codeph>SharedObjectFlushStatus.PENDING</codeph>,
     Flash Player displays a dialog box asking 
     the user to increase the amount of disk space available to objects from this domain. To allow 
     space for the shared object to  grow when it is saved in the future, which avoids return values 
     of <codeph>PENDING</codeph>, pass a value for <codeph>minDiskSpace</codeph>. When Flash Player
     tries to write the file, it looks for the number of bytes passed to 
     <codeph>minDiskSpace</codeph>, instead of looking for enough space to save the shared 
     object at its current size. </p>
     
     <p>For example, if you expect a shared object to grow to a maximum size of 500 bytes, even 
     though it might start out much smaller, pass 500 for <codeph>minDiskSpace</codeph>. If 
     Flash asks the user to allot disk space for the shared object, it asks for 500 bytes. After 
     the user allots the requested amount of space, Flash won't have to ask for more space on future 
     attempts to flush the object (as long as its size doesn't exceed 500 bytes). </p>
     
     <p>After the user responds to the dialog box, this method is called again. A
     <codeph>netStatus</codeph> event is dispatched with a <codeph>code</codeph> property of
     <codeph>SharedObject.Flush.Success</codeph> or <codeph>SharedObject.Flush.Failed</codeph>.
     </p>
     
     </apiDesc><example conref="examples\SharedObject_flush.as"> The following code creates (and on subsequent executions, retrieves) a SharedObject
 object using an id with the value of <codeph>hostName</codeph>. A property named <codeph>username</codeph>
 is added to the data property of the SharedObject object. The <codeph>flush()</codeph> method is
 then called, followed by a check to see if the string <codeph>pending</codeph>, or a boolean value
 of <codeph>true</codeph> or <codeph>false</codeph> was returned.
 One should be aware that all open SharedObject instances will automatically be flushed whenever the
 current instance of the Flash Player is closed.
<codeblock>
package {
    import flash.net.SharedObject;

    public class SharedObject_flush {
        private var hostName:String = "yourDomain";
        private var username:String = "yourUsername";

        public function SharedObject_flush() {
            var mySo:SharedObject = SharedObject.getLocal(hostName);
            mySo.data.username = username;
            var flushResult:Object = mySo.flush();
            trace("flushResult: " + flushResult);
            trace(mySo.data.username); // yourUsername
        }
    }
}
</codeblock></example></apiOperationDetail><related-links><link href="flash.net.xml#SharedObject/clear()"><linktext>clear()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:SharedObject:getLocal"><apiName>getLocal</apiName><shortdesc>
  Returns a reference to a locally persistent shared object that is only available to the current client.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>SharedObject, constructor, SharedObject.getLocal, getLocal, get
  
  </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiStatic/><apiException><apiDesc>Flash Player cannot create the shared object for whatever reason.
  This error might occur is if persistent shared object creation
  and storage by third-party Flash content is prohibited (does not apply to local content).
  Users can prohibit third-party persistent shared objects on the Global Storage Settings panel of the 
  Settings Manager, located at
  <xref href="http://www.adobe.com/support/documentation/en/flashplayer/help/settings_manager03.html" scope="external">http://www.adobe.com/support/documentation/en/flashplayer/help/settings_manager03.html</xref>.
  
  </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiReturn><apiDesc>A reference to a shared object that is persistent locally and is available only to the
  current client. If Flash Player can't create or find the shared object (for example, if
  <codeph>localPath</codeph> was
  specified but no such directory exists), this method throws an exception.
  
  </apiDesc><apiOperationClassifier>flash.net:SharedObject</apiOperationClassifier></apiReturn><apiParam><apiItemName>name</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The name of the object. The name can include forward slashes (<codeph>/</codeph>); for example,
  <codeph>work/addresses</codeph> is a legal name. Spaces are not allowed in a shared 
  object name, nor are the following characters:   
  <pre>
  ~ % &amp; \ ; : " ' , &lt; &gt; ? # 
  </pre>
  
  </apiDesc></apiParam><apiParam><apiItemName>localPath</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>The full or partial path to the SWF file that created the shared object, and that 
  determines where the shared object will be stored locally. If you do not specify this parameter, the 
  full path is used. 
   
  </apiDesc></apiParam><apiParam><apiItemName>secure</apiItemName><apiOperationClassifier>Boolean</apiOperationClassifier><apiData>false</apiData><apiDesc>Determines whether access to this shared object 
  is restricted to SWF files that are delivered over an HTTPS connection.  
  If your SWF file is delivered over HTTPS, this parameter's value has the following effects:
  <ul>
  <li>If this parameter is set to <codeph>true</codeph>, Flash Player creates a new secure shared object or
  gets a reference to an existing secure shared object. This secure shared object
  can be read from or written to only by SWF files delivered over HTTPS that call 
  <codeph>SharedObject.getLocal()</codeph> with the <codeph>secure</codeph> parameter set to
  <codeph>true</codeph>.</li>
  <li>If this parameter is set to <codeph>false</codeph>, Flash Player creates a new shared object or
  gets a reference to an existing shared object that can be read from 
  or written to by SWF files delivered over non-HTTPS connections.</li>
  </ul>
  <p>If your SWF file is delivered over a non-HTTPS connection and you try to set this parameter
  to <codeph>true</codeph>, the creation of a new shared object (or the access of a previously 
  created secure shared object) fails and <codeph>null</codeph> is returned. Regardless of the 
  value of this parameter, the created shared objects count toward the total amount
  of disk space allowed for a domain.</p>
  
  <p>The following diagram shows the use of the <codeph>secure</codeph> parameter:</p>
  <p><adobeimage alt="secure shared object diagram" href="../../images/secureParam.jpg"/></p>
  
  </apiDesc></apiParam></apiOperationDef><apiDesc>
  Returns a reference to a locally persistent shared object that is only available to the current client. 
  If the shared object does not already exist, this method creates one. If any values
  passed to <codeph>getLocal()</codeph> are invalid or if the call fails, Flash Player throws an exception.
  
  <p>The following code shows how you assign the returned shared object reference to a variable:</p>
  <p><codeph>var so:SharedObject = SharedObject.getLocal("savedData");</codeph></p>
  
  <p><b>Note:</b> If the user has chosen to never allow local storage for this domain, 
  the object is not saved locally, even if a value for <codeph>localPath</codeph> is specified. The
  exception to this rule is local content. Local content can always write shared objects
  from third-party domains (domains other than the domain in the current browser address bar)
  to disk, even if writing of third-party shared objects to disk is disallowed.
  </p>
  
  <p>To avoid name conflicts, Flash looks at the location of the SWF file creating the 
  shared object. For example, if a SWF file at www.myCompany.com/apps/stockwatcher.swf creates a 
  shared object named <codeph>portfolio</codeph>, that shared object does not conflict with another 
  object named <codeph>portfolio</codeph> that was created by a SWF file at 
  www.yourCompany.com/photoshoot.swf because the SWF files originate from different directories. </p>
  
  <p>Although the <codeph>localPath</codeph> parameter is optional, you should give some 
  thought to its use, especially if other SWF files need to access the shared object. If the 
  data in the shared object is specific to one SWF file that will not be moved to another location, 
  then use of the default value makes sense. If other SWF files need access to the shared object, or 
  if the SWF file that creates the shared object will later be moved, then the value of this parameter
  affects how accessible the shared object will be. For example, if you create a shared object with 
  <codeph>localPath</codeph> set to the default value of the full path to the SWF file, no other SWF 
  file can access that shared object. If you later move the original SWF file to another location, 
  not even that SWF file can access the data already stored in the shared object.</p>
  
  <p>To avoid inadvertently restricting access to a shared object, use
  the <codeph>localpath</codeph> parameter. The most permissive approach is to set 
  <codeph>localPath</codeph> to <codeph>/</codeph> (slash), which makes the shared object available to all SWF files 
  in the domain, but increases the likelihood of name conflicts with other shared objects in 
  the domain. A more restrictive approach is to append <codeph>localPath</codeph> with folder names that are in 
  the full path to the SWF file. For example, for a <codeph>portfolio</codeph> shared object created by the SWF 
  file at www.myCompany.com/apps/stockwatcher.swf, you could set the <codeph>localPath</codeph> parameter to
  <codeph>/</codeph>, <codeph>/apps</codeph>, or <codeph>/apps/stockwatcher.swf</codeph>. You must determine which 
  approach provides optimal flexibility for your application.</p>
  
  <p platform="actionscript">When using this method, consider the following security model:
  
  <ul>
  
    <li>You cannot access shared objects across sandbox boundaries.</li>
    <li>Users can restrict shared object access by using the Flash Player Settings dialog box 
      or the Settings Manager. By default, an application can create shared objects of up 100 KB of data per domain.
      Administrators and users can also place restrictions on the ability to write to the file system.</li>
  </ul></p>
  
  <p platform="actionscript">Suppose you publish SWF file content to be played back as local files (either locally installed SWF files or 
  EXE files), and you need to access a specific shared object from more than one local SWF file. In this situation, 
  be aware that for local files, two different locations might be used to store shared objects. The domain that is 
  used depends on the security permissions granted to the local file that created the shared object. Local files 
  can have three different levels of permissions:
  
  <ol>
    <li>Access to the local filesystem only.</li>
    <li>Access to the network only.</li>
    <li>Access to both the network and the local filesystem.</li>
  </ol></p>
  
  <p platform="actionscript">Local files with access to the local filesystem (level 1 or 3) store their shared objects in one location. 
  Local files without access to the local filesystem (level 2) store their shared objects in another location.</p>
  
  <p platform="actionscript">You can prevent a SWF file from using this method by setting the 
  <codeph>allowNetworking</codeph> parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> 
  tags in the HTML page that contains the SWF content.</p>
  
  <p platform="actionscript">For more information, see the following:
  
  <ul>
    <li product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
    in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
    <li product="flash">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
    in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
    <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
  </ul></p>
  
  </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:SharedObject:getRemote"><apiName>getRemote</apiName><shortdesc>
     Returns a reference to a shared object on Flash Media Server that multiple
     clients can access.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>server-specific: This info is relevant for Flash Media Server, but not Flex Data Services.
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiStatic/><apiException><apiDesc>Flash Player can't create or find the shared object. This might occur if nonexistent paths were 
     specified for the <codeph>remotePath</codeph> and <codeph>persistence</codeph> parameters.
     
     
     </apiDesc><apiItemName>Error</apiItemName><apiOperationClassifier>Error</apiOperationClassifier></apiException><apiReturn><apiDesc>A reference to an object that can be shared across multiple clients.
     
     </apiDesc><apiOperationClassifier>flash.net:SharedObject</apiOperationClassifier></apiReturn><apiParam><apiItemName>name</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The name of the remote shared object. The name can include forward slashes (/); 
     for example, work/addresses is a legal name. Spaces are not allowed in a shared object name,
     nor are the following characters:
     <pre>    ~ % &amp; \ ; :  " ' , &gt; ? ? #</pre>
     
     </apiDesc></apiParam><apiParam><apiItemName>remotePath</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiData>null</apiData><apiDesc>The URI of the server on which the shared object will be stored. 
     This URI must be identical to the URI of the NetConnection object passed to the
     <codeph>connect()</codeph> method. 
     
     </apiDesc></apiParam><apiParam><apiItemName>persistence</apiItemName><apiOperationClassifier>Object</apiOperationClassifier><apiData>false</apiData><apiDesc>Specifies whether the attributes of the shared
     object's data property are persistent locally, remotely, or both. This parameter can also specify 
     where the shared object will be stored locally. Acceptable values are as follows:
     <ul><li>A value of <codeph>false</codeph> specifies that the shared object is not persistent
     on the client or server.</li>
     <li>A value of <codeph>true</codeph> specifies that the shared object is persistent only on the server.</li>
     <li>A full or partial local path to the shared object indicates that the shared 
     object is persistent on the client and the server. On the client, it is stored in the
     specified path; on the server, it is stored in a subdirectory within the application
     directory.</li>
     </ul>
     
     <p><b>Note:</b> If the user has chosen to never allow local storage
     for this domain, the object will not be saved locally, even if a local path is 
     specified for persistence. For more information, see the class description.</p>
     
     </apiDesc></apiParam><apiParam><apiItemName>secure</apiItemName><apiOperationClassifier>Boolean</apiOperationClassifier><apiData>false</apiData><apiDesc>Determines whether access to this shared object is restricted to SWF
     files that are delivered over an HTTPS connection. For more information, see the
     description of the <codeph>secure</codeph> parameter in the 
     <codeph>getLocal</codeph> method entry.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Returns a reference to a shared object on Flash Media Server that multiple
     clients can access.
     If the remote shared object does not already exist, this method creates one. 
     
     <p>
     To create a remote shared object, call <codeph>getRemote()</codeph> the call
     <codeph>connect()</codeph> to connect the remote shared object to the server, as in 
     the following:</p>
     
	 <codeblock platform="actionscript">
     var nc:NetConnection = new NetConnection();
     nc.connect("rtmp://somedomain.com/applicationName");
     var myRemoteSO:SharedObject = SharedObject.getRemote("mo", nc.uri, false);
     myRemoteSO.connect(nc);
     </codeblock>
     
	 <codeblock platform="javascript">
     var nc = new air.NetConnection();
     nc.connect("rtmp://somedomain.com/applicationName");
     var myRemoteSO:SharedObject = SharedObject.getRemote("mo", nc.uri, false);
     myRemoteSO.connect(nc);
     </codeblock>
	 
     <p>
     To confirm that the local and remote copies of the shared object are synchronized,
     listen for and handle the <codeph>sync</codeph> event.
     All clients that want to share this object must pass the same values for 
     the <codeph>name</codeph> and <codeph>remotePath</codeph> parameters. 
     </p> 
     
     <p>To create a shared object that is available only to the current client, 
     use <codeph>SharedObject.getLocal()</codeph>.
     </p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#SharedObject/connect()"><linktext>connect()</linktext></link><link href="flash.net.xml#SharedObject/getLocal()"><linktext>getLocal()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:SharedObject:send"><apiName>send</apiName><shortdesc>
     Broadcasts a message to all clients connected to a remote shared object, 
     including the client that sent the message.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>Needs better documentation, examples.
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>arguments</apiItemName><apiType value="restParam"/><apiDesc>One or more arguments: A string that identifies the message, 
     the name of one or more handler functions to attach to the shared object,
     and optional parameters of any type. 
     The handler name can be only one level deep (that is, it can't be of the 
     form parent/child) and is relative to the shared object. 
     The arguments are serialized and sent over the connection, and the 
     receiving handler receives them in the same order. If a parameter is a 
     circular object (for example, a linked list that is circular), the 
     serializer handles the references correctly.
     
     <p><b>Note</b>: Do not use a reserved term for the function names. 
     For example, <codeph>myRemoteSO.send("close")</codeph> will fail.</p>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Broadcasts a message to all clients connected to a remote shared object, 
     including the client that sent the message. To process and respond to the message,
     create a callback function attached to the shared object.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:SharedObject:setDirty"><apiName>setDirty</apiName><shortdesc>
     Indicates to the server that the value of a property
     in the shared object has changed.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>The AS2 player automatically marks properties dirty as they are changed.
          The FMS server, however, requires an explicit setProperty() call to indicate when a property
          of data has changed.
     
          AS3 does not support auto-dirtying the properties, so we are introducing setDirty() to explicitly
          indicate when a property has changed, and setProperty() to match the method provided with the server.
     
          It's probably best to read the FMS Actionscript reference (search for SharedObject.setProperty at
          www.adobe.com) before writing this documentation, as the details should be similar.
     
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>propertyName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The name of the property that has changed.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Indicates to the server that the value of a property
     in the shared object has changed.
     This method marks properties as <i>dirty</i>, which means changed.
     
     <p>
     Call the <codeph>SharedObject.setProperty()</codeph> to create properties for a shared object. 
     </p>
      
     <p>
     The <codeph>SharedObject.setProperty()</codeph> method implements <codeph>setDirty()</codeph>.
     In most cases, such as when the value of a property is a primitive type like String or Number,
     you can call <codeph>setProperty()</codeph> instead of calling <codeph>setDirty()</codeph>. 
     However, when the value of a property is an object that contains its own properties, 
     call <codeph>setDirty()</codeph> to indicate when a value within the object has changed.
     </p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#SharedObject/data"><linktext>SharedObject.data (client-side property)</linktext></link><link href="flash.net.xml#SharedObject/setProperty()"><linktext>setProperty()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:SharedObject:setProperty"><apiName>setProperty</apiName><shortdesc>
     Updates the value of a property in a shared object and indicates to the server
     that the value of the property has changed.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>propertyName</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>The name of the property in the shared object.
     </apiDesc></apiParam><apiParam><apiItemName>value</apiItemName><apiOperationClassifier>Object</apiOperationClassifier><apiData>null</apiData><apiDesc>The value of the property (an ActionScript object), or <codeph>null</codeph> to delete the property. 
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Updates the value of a property in a shared object and indicates to the server
     that the value of the property has changed. The <codeph>setProperty()</codeph> method
     explicitly marks properties as changed, or dirty.
     
     <p>For more information about remote shared objects see the
     <xref href="http://www.adobe.com/go/learn_fms_docs_en">
     Flash Media Server documentation</xref>.</p>
     
     <p><b>Note:</b> The <codeph>SharedObject.setProperty()</codeph> method implements the <codeph>setDirty()</codeph> method.
     In most cases, such as when the value of a property is a primitive type like String or Number,
     you would use <codeph>setProperty()</codeph> instead of <codeph>setDirty</codeph>. 
     However, when the value of a property is an object that contains its own properties, 
     use <codeph>setDirty()</codeph> to indicate when a value within the object has changed. 
     In general, it is a good idea to call <codeph>setProperty()</codeph> rather than <codeph>setDirty()</codeph>, because 
     <codeph>setProperty()</codeph> updates a property value only when that value has changed, whereas <codeph>setDirty()</codeph>
     forces synchronization on all subscribed clients.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#SharedObject/data"><linktext>SharedObject.data (client-side property)</linktext></link></related-links></apiOperation><apiValue id="flash.net:SharedObject:client:get"><apiName>client</apiName><shortdesc>
     Indicates the object on which
     callback methods are invoked.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>Property documented; needs review.
     </internal></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Object</apiValueClassifier><apiException><apiDesc>The <codeph>client</codeph> property must be set to a non-null object.
     
     </apiDesc><apiItemName>TypeError</apiItemName><apiOperationClassifier>TypeError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
     Indicates the object on which
     callback methods are invoked. The default object is <codeph>this</codeph>. 
     You can set the client property to another object, and callback methods will be 
     invoked on that other object.
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:SharedObject:data:get"><apiName>data</apiName><shortdesc>
     The collection of attributes assigned to the data property of the object; these attributes can 
     be shared and stored.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>SharedObject, SharedObject.data, data
     
     </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Object</apiValueClassifier></apiValueDef><apiDesc>
     The collection of attributes assigned to the <codeph>data</codeph> property of the object; these attributes can 
     be shared and stored. Each attribute can be an object of any ActionScript or JavaScript 
     type — Array, Number, Boolean, ByteArray, XML, and so on. For example, the following lines assign values to various aspects 
     of a shared object:
     
	 <codeblock platform="actionscript">
     var items_array:Array = new Array(101, 346, 483);
     var currentUserIsAdmin:Boolean = true;
     var currentUserName:String = "Ramona";
     
     var my_so:SharedObject = SharedObject.getLocal("superfoo");
     my_so.data.itemNumbers = items_array;
     my_so.data.adminPrivileges = currentUserIsAdmin;
     my_so.data.userName = currentUserName;
     
     for (var prop in my_so.data) {
       trace(prop+": "+my_so.data[prop]);
     }
     </codeblock>
     
	 <codeblock platform="javascript">
	 var items_array = new Array(101, 346, 483);
	 var currentUserIsAdmin = true;
	 var currentUserName = "Ramona";
	 
	 var my_so = air.SharedObject.getLocal("superfoo");
	 my_so.data.itemNumbers = items_array;
	 my_so.data.adminPrivileges = currentUserIsAdmin;
	 my_so.data.userName = currentUserName;
	 
	 for (var prop in my_so.data) {
	   trace(prop+": "+my_so.data[prop]);
	 }
	 </codeblock>
     
     <p>All attributes of a shared object's <codeph>data</codeph> property are saved if the object is persistent, and
     the shared object contains the following information:</p>
     
     <codeblock>
     userName: Ramona
     adminPrivileges: true
     itemNumbers: 101,346,483
     </codeblock>
     
     <p><b>Note:</b> Do not assign values directly to the <codeph>data</codeph> property of a shared 
     object, as in <codeph>so.data = someValue</codeph>; Flash Player ignores these assignments.</p>
     
     <p>To delete attributes for local shared objects, use code such as 
     <codeph>delete so.data.attributeName</codeph>; setting an attribute to 
     <codeph>null</codeph> or <codeph>undefined</codeph> for a local shared object does not 
     delete the attribute.</p>
     
     <p>To create <i>private</i> values for a shared object — values that are available only to the client 
     instance while the object is in use and are not stored with the object when it is closed — create properties 
     that are not named <codeph>data</codeph> to store them, as shown in the following example:</p>
     
	 <codeblock platform="actionscript">
     var my_so:SharedObject = SharedObject.getLocal("superfoo");
     my_so.favoriteColor = "blue";
     my_so.favoriteNightClub = "The Bluenote Tavern";
     my_so.favoriteSong = "My World is Blue";
     
     for (var prop in my_so) {
       trace(prop+": "+my_so[prop]);
     }
     </codeblock>
     
	 <codeblock platform="javascript">
	 var my_so = air.SharedObject.getLocal("superfoo");
	 my_so.favoriteColor = "blue";
	 my_so.favoriteNightClub = "The Bluenote Tavern";
	 my_so.favoriteSong = "My World is Blue";
	 
	 for (var prop in my_so) {
	   trace(prop+": "+my_so[prop]);
	 }
	 </codeblock>
     
     <p>The shared object contains the following data:</p>
     <codeblock>
     favoriteSong: My World is Blue
     favoriteNightClub: The Bluenote Tavern
     favoriteColor: blue
     data: [object Object]
     </codeblock>
     
     <p>
     For remote shared objects used with a server, all attributes of the <codeph>data</codeph> 
     property are available to all clients connected to the shared object, and all attributes 
     are saved if the object is persistent. 
     If one client changes the value of an attribute, all clients now see the new value.
     </p>
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#SharedObject/getLocal()"><linktext>getLocal()</linktext></link></related-links></apiValue><apiValue id="flash.net:SharedObject:defaultObjectEncoding:get"><apiName>defaultObjectEncoding</apiName><shortdesc>
     The default object encoding (AMF version) for all local shared objects created in the SWF file.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiStatic/><apiValueAccess value="readwrite"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
     The default object encoding (AMF version) for all local shared objects created in the SWF file.
     When local shared objects are written to disk, the 
     <codeph>SharedObject.defaultObjectEncoding</codeph> property
     indicates which Action Message Format version should be used: the ActionScript 3.0 format (AMF3) or the ActionScript 1.0 or 2.0 format (AMF0).
     
     <p>For more information about object encoding, including the difference between
     encoding in local and remote shared objects, see the description of the 
     <codeph>objectEncoding</codeph> property.</p>
     
     <p>The default value of <codeph>SharedObject.defaultObjectEncoding</codeph> is set to use the
     ActionScript 3.0 format, AMF3. 
     If you need to write local shared objects that ActionScript 2.0 or 1.0 SWF files can read,
     set <codeph>SharedObject.defaultObjectEncoding</codeph> to use the 
     ActionScript 1.0 or ActionScript 2.0 format, <codeph>flash.net.ObjectEncoding.AMF0</codeph>,
     at the beginning of your script, before you create any local shared objects. 
     All local shared objects
     created thereafter will use AMF0 encoding and can interact with older content.
     You cannot change the <codeph>objectEncoding</codeph> value of existing local shared objects 
     by setting <codeph>SharedObject.defaultObjectEncoding</codeph> after the local shared 
     objects have been created.</p>
     
     <p>To set the object encoding on a per-object basis, rather than for all shared objects
     created by the SWF file, set the <codeph>objectEncoding</codeph> property of the local shared object instead.</p>
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#SharedObject/objectEncoding"><linktext>objectEncoding property</linktext></link><link href="flash.net.xml#ObjectEncoding"><linktext>ObjectEncoding class</linktext></link></related-links></apiValue><apiValue id="flash.net:SharedObject:objectEncoding:get"><apiName>objectEncoding</apiName><shortdesc>
     The object encoding (AMF version) for this shared object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>uint</apiValueClassifier><apiException><apiDesc>You attempted to set the value of the <codeph>objectEncoding</codeph>
     property on a remote shared object. This property is read-only for remote shared objects because
     its value is determined by the associated NetConnection instance.
     
     </apiDesc><apiItemName>ReferenceError</apiItemName><apiOperationClassifier>ReferenceError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
     The object encoding (AMF version) for this shared object. When a local shared object is written to disk, 
     the <codeph>objectEncoding</codeph> property indicates which Action
     Message Format version should be used: the ActionScript 3.0 format (AMF3)
     or the ActionScript 1.0 or 2.0 format (AMF0). 
     
     <p>Object encoding is handled differently depending if the shared object
     is local or remote.</p>
     <ul>
     <li><b>Local shared objects</b>. You can get or set the value of the 
     <codeph>objectEncoding</codeph> property for local shared objects. 
     The value of <codeph>objectEncoding</codeph> 
     affects what formatting is used for <i>writing</i> this local shared object.
     If this local shared object must be readable by 
     ActionScript 2.0 or 1.0 SWF files, set <codeph>objectEncoding</codeph> to 
     <codeph>ObjectEncoding.AMF0</codeph>.
     Even if object encoding is set to write AMF3, Flash Player can still read AMF0 local shared objects. 
     That is, if you use the default value of this property, <codeph>ObjectEncoding.AMF3</codeph>, 
     your SWF file can still read shared objects created by ActionScript 2.0 or 1.0 SWF files.
     </li>
     
     <li><b>Remote shared objects</b>. When connected to the server, a remote shared object
     inherits its <codeph>objectEncoding</codeph> setting from the associated NetConnection
     instance (the instance used to connect to the remote shared object). When not connected
     to the server, a remote shared object inherits the <codeph>defaultObjectEncoding</codeph> 
     setting from the associated NetConnection instance. 
     Because the value of a remote shared object's <codeph>objectEncoding</codeph> property is 
     determined by the NetConnection instance, this property is read-only for remote shared objects.
     </li>
     </ul>
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#SharedObject/defaultObjectEncoding"><linktext>defaultObjectEncoding</linktext></link><link href="flash.net.xml#ObjectEncoding"><linktext>flash.net.ObjectEncoding</linktext></link></related-links></apiValue><apiValue id="flash.net:SharedObject:size:get"><apiName>size</apiName><shortdesc>
     The current size of the shared object, in bytes.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>SharedObject, SharedObject.getSize, getSize
     </keyword></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
     The current size of the shared object, in bytes.
     
     <p>Flash calculates the size of a shared object by stepping through all of its data 
     properties; the more data properties the object has, the longer it takes to estimate its size. 
     Estimating object size can take significant processing time, so you 
     may want to avoid using this method unless you have a specific need for it.</p>
     
     </apiDesc><example conref="examples\SharedObject.size.1.as"> The following code creates a SharedObject object using an id <codeph>"thehobbit"</codeph>.
 A property named <codeph>username</codeph> is added to the data property of the SharedObject object.
 The <codeph>size</codeph> property is then traced, which returns the value indicated.
<codeblock>

import flash.net.SharedObject;

// if these get copied or not
var mySo:SharedObject = SharedObject.getLocal("thehobbit");
mySo.data.username = "bilbobaggins";
trace(mySo.size); // 55
</codeblock></example></apiValueDetail></apiValue><apiValue id="flash.net:SharedObject:fps:set"><apiName>fps</apiName><shortdesc>
     Specifies the number of times per second that a client's changes to a
     shared object are sent to the server.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>server-specific: The info is relevant for Flash Media Server, but not Flex.
     </internal></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="write"/><apiValueClassifier>Number</apiValueClassifier></apiValueDef><apiDesc>
     Specifies the number of times per second that a client's changes to a
     shared object are sent to the server. 
     
     <p>Use this method when you want to control the amount of traffic between
     the client and the server. For example, if the connection between the client
     and server is relatively slow, you may want to set <codeph>fps</codeph>
     to a relatively low value. Conversely, if the client is connected to a multiuser
     application in which timing is important, you may want to set <codeph>fps</codeph>
     to a relatively high value.</p>
     
     <p>Setting <codeph>fps</codeph> will trigger a <codeph>sync</codeph> event and update all changes to the server.
     If you only want to update the server manually, set <codeph>fps</codeph> to 0.</p>
     
     <p>Changes are not sent to the server until the <codeph>sync</codeph> event has been dispatched. 
     That is, if the response time from the server is slow, updates may be sent to
     the server less frequently than the value specified in this property. </p>
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="flash.net:URLLoaderDataFormat"><apiName>URLLoaderDataFormat</apiName><shortdesc>
 The URLLoaderDataFormat class provides values that specify how downloaded data is received.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiFinal/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 The URLLoaderDataFormat class provides values that specify how downloaded data is received.
 
 </apiDesc><example conref="examples\URLLoaderDataFormatExample.as"> The following example uses the URLLoaderDataFormatExample class to display 
 data format and status information for a file loaded at runtime.  This is accomplished 
 using the following steps:
 <ol>
  <li>The class constructor creates a URLLoader instance named <codeph>loader</codeph> and a URLRequest
  instance named <codeph>request</codeph>, which is the location and name of the file to be loaded.</li>
  <li>The <codeph>loader</codeph> object is passed to the <codeph>configureListeners()</codeph> method, which adds 
  listeners for each of the supported URLLoader events:
  <ul>
      <li><codeph>completeHandler()</codeph>: listens for the <codeph>complete</codeph> event, which is dispatched
      after TextFile.txt has successfully loaded.</li>
      <li><codeph>openHandler()</codeph>: listens for the <codeph>open</codeph> event, dispatched upon start of the
      download (to the player) of TextFile.txt.</li>
      <li><codeph>progressHandler()</codeph>: listens for the <codeph>progress</codeph> events, dispatched when data 
      is received as the download operation progresses.</li>
      <li><codeph>securityErrorHandler()</codeph>: listens for <codeph>securityError</codeph> events, which would be
      dispatched if the text file was accessed with the wrong local playback security setting.</li>  
      <li><codeph>httpStatusHandler()</codeph>: listens for <codeph>httpStatusHandler</codeph> events, which will not be
      dispatched in this case since TextFile.txt is local.</li>
      <li><codeph>ioErrorHandler()</codeph>: listens for <codeph>ioError</codeph> events, which would happen only
      if there were a serious problem with the file, such as if it were missing.</li>  
  </ul></li>
  <li>The <codeph>request</codeph> object is then passed to the <codeph>loader.load()</codeph> method, which loads the text file
  into memory using a <codeph>DisplayObject</codeph> object.</li>
 </ol>
 <p> <b>Notes:</b>
 <ul>
  <li>You will need to compile the SWF file with "Local playback security" set to "Access local files only".
  </li>
  <li>This example requires that a file named TextFile.txt be placed in the same directory as your SWF file.
  If you would like to see this example identify binary or URL-encoded data files, you will need to
  provide the file in the proper data format and change TextFile.txt to the name and location of the new
  file.</li>
  </ul>
 </p>
<codeblock>

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.*;

    public class URLLoaderDataFormatExample extends Sprite {
        private var source:String = "TextFile.txt";
        private var dataFormat:String = URLLoaderDataFormat.TEXT;
        
        public function URLLoaderDataFormatExample () {
            var loader:URLLoader = new URLLoader();
            loader.dataFormat = dataFormat;
            configureListeners(loader);
            var request:URLRequest = new URLRequest(source);
            try {
                loader.load(request);
            } catch (error:Error) {
                trace("Error loading requested document: " + source);
            }
        }

        private function configureListeners(dispatcher:URLLoader):void {
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(Event.OPEN, openHandler);
            dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        }

        private function completeHandler(event:Event):void {
            var loader:URLLoader = URLLoader(event.target);
            switch(loader.dataFormat) {
                case URLLoaderDataFormat.TEXT :
                    trace("completeHandler (text): " + loader.data);
                    break;
                case URLLoaderDataFormat.BINARY :
                    trace("completeHandler (binary): " + loader.data);
                    break;
                case URLLoaderDataFormat.VARIABLES :
                    trace("completeHandler (variables): " + loader.data);
                    break;
            }
        }

        private function httpStatusHandler(event:Event):void {
            trace("httpStatusHandler: " + event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }

        private function openHandler(event:Event):void {
            trace("openHandler: " + event);
        }

        private function progressHandler(event:ProgressEvent):void {
            trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }
    }
}
</codeblock></example></apiClassifierDetail><apiValue id="flash.net:URLLoaderDataFormat:BINARY"><apiName>BINARY</apiName><shortdesc>
	 Specifies that downloaded data is received as raw binary data.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>binary</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that downloaded data is received as raw binary data.
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLLoaderDataFormat:TEXT"><apiName>TEXT</apiName><shortdesc>
	 Specifies that downloaded data is received as text.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>text</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that downloaded data is received as text.
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLLoaderDataFormat:VARIABLES"><apiName>VARIABLES</apiName><shortdesc>
	 Specifies that downloaded data is received as URL-encoded variables.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>variables</apiData><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
	 Specifies that downloaded data is received as URL-encoded variables.
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="flash.net:NetStreamPlayTransitions"><apiName>NetStreamPlayTransitions</apiName><shortdesc>
 
 The NetStreamPlayTransitions class specifies the valid strings that you can use with the 
 NetStreamPlayOptions.transition property.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseClassifier>Object</apiBaseClassifier></apiClassifierDef><apiDesc>
 
 The NetStreamPlayTransitions class specifies the valid strings that you can use with the 
 NetStreamPlayOptions.transition property. These strings control the 
 behavior that is used to transition to a new stream or to play a stream, depending on the
 transition mode that is used.
 </apiDesc></apiClassifierDetail><related-links><link href="flash.net.xml#NetStreamPlayOptions"><linktext>NetStreamPlayOptions</linktext></link><link href="flash.net.xml#NetStream/play()"><linktext>NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()"><linktext>NetStream.play2()</linktext></link></related-links><apiValue id="flash.net:NetStreamPlayTransitions:APPEND"><apiName>APPEND</apiName><shortdesc>
	 
	 Adds the stream to a playlist.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>append</apiData><apiType value=""/></apiValueDef><apiDesc>
	 
	 Adds the stream to a playlist. This mode does the same thing as the <codeph>NetStream.play()</codeph> 
	 method with the <codeph>reset</codeph> flag set to <codeph>false</codeph>.
	 
	 <p>In this mode, Flash Media Server queues up the stream specified in <codeph>NetStreamPlayOptions.streamName</codeph> 
	 at the end of the playlist and ignores the <codeph>NetStreamPlayOptions.oldStreamName</codeph> parameter.</p> 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamPlayTransitions:RESET"><apiName>RESET</apiName><shortdesc>
	 
	 Clears any previous play calls and plays the specified stream immediately.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>reset</apiData><apiType value=""/></apiValueDef><apiDesc>
	 
	 Clears any previous play calls and plays the specified stream immediately.
	 This mode does the same thing as the <codeph>NetStream.play()</codeph> method with the <codeph>reset</codeph> flag set to <codeph>true</codeph>
	 (the default behavior for <codeph>NetStream.play()</codeph>).
	 
	 <p>In this mode, the currently playing stream is flushed and the stream specified in <codeph>NetStreamPlayOptions.streamName</codeph> starts to play.
	 The <codeph>NetStreamPlayOptions.oldStreamName</codeph> parameter is ignored.</p> 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamPlayTransitions:STOP"><apiName>STOP</apiName><shortdesc>
	 
	 Stops playing the streams in a playlist.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>stop</apiData><apiType value=""/></apiValueDef><apiDesc>
	 
	 Stops playing the streams in a playlist. This mode does the same thing as calling <codeph>NetStream.play(false)</codeph>. 
	 It stops and resets the playlist.
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamPlayTransitions:SWAP"><apiName>SWAP</apiName><shortdesc>
	 Replaces a content stream with a different content stream and maintains the rest of the playlist.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>swap</apiData><apiType value=""/></apiValueDef><apiDesc>
	 Replaces a content stream with a different content stream and maintains the rest of the playlist.
	 
	 <p>Like <codeph>SWITCH</codeph>, this mode replaces the stream specified in <codeph>NetStreamPlayOptions.oldStreamName</codeph> 
	 with the stream specified in <codeph>NetStreamPlayOptions.streamName</codeph>. The rest of the playlist is maintained. 
	 In this mode, Flash Media Server does not make assumptions about the content of the streams and treats 
	 them like different content. If <codeph>oldStreamName</codeph> has not yet been sent, the server performs the switch
	 at the stream boundary and sends the bits for <codeph>streamName</codeph> from the beginning.
	 If the server has already 
	 started sending the bits for <codeph>oldStreamName</codeph>, it will not switch to <codeph>streamName</codeph> and dispatches a 
	 <codeph>NetStream.Play.Failed</codeph> event.</p>
	 
	 <p>Use this mode if the streams you want to switch are not related to each other and have different content or lengths. One 
	 example is to swap one commercial for another based on user tracking and past commercial-viewing statistics.</p>
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamPlayTransitions:SWITCH"><apiName>SWITCH</apiName><shortdesc>
	 Switches from playing one stream to another stream, typically with streams of the same content.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiAccess value="public"/><apiStatic/><apiData>switch</apiData><apiType value=""/></apiValueDef><apiDesc>
	 Switches from playing one stream to another stream, typically with streams of the same content.
	 Specify the streams to switch in <codeph>NetStreamPlayOptions.oldStreamName</codeph> and <codeph>NetStreamPlayOptions.streamName</codeph>. 
	 
	 <p>Use this mode when you want to switch to a stream that has the same content but is encoded 
	 at a different bit rate or resolution. For example, use this mode when the application queues up streams in a playlist
	 or is playing a single stream at a particular bit rate, then calculates that the bandwidth availability 
	 or the CPU capability is either lower or higher than the stream requirements. The application can then 
	 update the streams with their higher or lower bit rate versions.</p>
	 
	 <p>In this mode, Flash Media Server makes certain assumptions about the relationship between the 
	 <codeph>oldStreamName</codeph> and <codeph>streamName</codeph> streams.
	 The server assumes that the streams contain the same content and have the same keyframe interval but have different 
	 resolutions or bit rates.</p>
	 
	 <p>When a playlist has been queued up and <codeph>oldStreamName</codeph> is one of the streams in the playlist or is currently playing, 
	 <codeph>oldStreamName</codeph> is replaced by <codeph>streamName</codeph>.</p>
	 
	 <p>If <codeph>oldStreamName</codeph> is null or undefined, or if it is not found in the playlist,
	 the server switches to <codeph>streamName</codeph> at the next logical point, to ensure a smooth switch.</p>
	 
	 <p>To switch from one stream to another with different content, use the <codeph>RESET</codeph> mode instead.</p>
	 
	 
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier id="flash.net:NetConnection"><apiName>NetConnection</apiName><shortdesc>
 The NetConnection class creates a bidirectional connection between a Flash Player 
 or AIR an AIR application and a Flash Media Server application or 
 between a Flash Player or AIR an AIR 
 application and an application server running Flash Remoting.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetConnection, Video, Responder
 </keyword></asCustoms></prolog><apiClassifierDetail><apiClassifierDef><apiAccess value="public"/><apiStatic/><apiBaseClassifier>flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc>
 The NetConnection class creates a bidirectional connection between <ph platform="actionscript">a Flash Player 
 or AIR</ph> <ph platform="javascript">an AIR</ph> application and a Flash Media Server application or 
 between <ph platform="actionscript">a Flash Player or AIR</ph> <ph platform="javascript">an AIR</ph> 
 application and an application server running Flash Remoting. A NetConnection object is like a pipe between 
 the client and the server. Use NetStream objects to send streams through the pipe. 
 <p>Create a Responder object and pass it as a paramter for <codeph>NetConnection.call()</codeph> to handle return values
 from the server related to the success or failure of specific operations.</p>  
 <p>
 Without Flash Media Server, you can use the NetConnection class to play video and MP3 files from a local file system or from a web server.
 </p>
 
 <p>
 For information about supported codecs and file formats, see <xref href="http://www.adobe.com/go/hardware_scaling_en" scope="external">http://www.adobe.com/go/hardware_scaling_en</xref>
 and the <xref href="http://www.adobe.com/support/documentation" scope="external">Flash Media Server documentation</xref>.
 </p>
 
 <p>When you use the NetConnection class, consider the following security model:</p>
 
 <ul>
 <li>Loading and playing an audio or video file is not allowed if the calling file is in a network sandbox
 and the file to be loaded is local.</li>
 
 	<li>By default, loading and playing an audio or video file is not allowed if the calling file is local and 
 tries to load and play a remote file. A user must grant explicit permission to allow this.</li>
 </ul>
 
 <p>However, in Adobe AIR, content in the <codeph>application</codeph> 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 product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
 in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
 
 <li product="flash">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
 in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
 
 <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li> 
 </ul>
 
 
 <p platform="actionscript"><b>Note</b>: This class was dynamic in ActionScript 2.0 but is now sealed.
 To write callback methods for this class, you can either extend the class and define the 
 callback methods in your subclass, or you can use the <codeph>client</codeph>
 property to refer to an object and define the callback methods on that object.</p>
 
 </apiDesc><example conref="examples\NetConnectionExample.as"> The following example uses a Video object with the NetConnection and 
 NetStream classes to load and play an FLV file. To run this example, you need an FLV file 
 whose name and location match the variable passed to <codeph>videoURL</codeph>; 
 in this case, an FLV file called Video.flv that is in the same directory as the SWF file.
 <p>In this example, the code that creates the Video and NetStream objects and calls the
 <codeph>Video.attachNetStream()</codeph> and <codeph>NetStream.play()</codeph> methods is placed 
 in a handler function. The handler is called only if the
 attempt to connect to the NetConnection object is successful; that is, 
 when the <codeph>netStatus</codeph> event returns an <codeph>info</codeph> object with a <codeph>code</codeph>
 property that indicates success. 
 It is recommended that you wait for a successful connection before you call
 <codeph>NetStream.play()</codeph>. </p>
 <codeblock>

package {
    import flash.display.Sprite;
    import flash.events.NetStatusEvent;
    import flash.events.SecurityErrorEvent;
    import flash.media.Video;
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.events.Event;

    public class NetConnectionExample extends Sprite {
        private var videoURL:String = "Video.flv";
        private var connection:NetConnection;
        private var stream:NetStream;

        public function NetConnectionExample() {
            connection = new NetConnection();
            connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            connection.connect(null);
        }

        private function netStatusHandler(event:NetStatusEvent):void {
            switch (event.info.code) {
                case "NetConnection.Connect.Success":
                    connectStream();
                    break;
                case "NetStream.Play.StreamNotFound":
                    trace("Stream not found: " + videoURL);
                    break;
            }
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }

        private function connectStream():void {
            var stream:NetStream = new NetStream(connection);
            stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            stream.client = new CustomClient();
            var video:Video = new Video();
            video.attachNetStream(stream);
            stream.play(videoURL);
            addChild(video);
        }
    }
}

class CustomClient {
    public function onMetaData(info:Object):void {
        trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate);
    }
    public function onCuePoint(info:Object):void {
        trace("cuepoint: time=" + info.time + " name=" + info.name + " type=" + info.type);
    }
}
</codeblock></example></apiClassifierDetail><related-links><link href="flash.net.xml#NetConnection/client"><linktext>client</linktext></link><link href="flash.net.xml#NetStream"><linktext>NetStream</linktext></link><link href="flash.net.xml#NetConnection/connect()"><linktext>connect()</linktext></link><link href="flash.net.xml#Responder"><linktext>flash.net.Responder</linktext></link></related-links><adobeApiEvent id="flash.net:NetConnection_flash.events.NetStatusEvent.NET_STATUS_netStatus"><apiName>netStatus</apiName><shortdesc>
 Dispatched when a NetConnection object is reporting its status or error condition.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.NetStatusEvent.NET_STATUS</apiEventType><adobeApiEventClassifier>flash.events.NetStatusEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when a NetConnection object is reporting its status or error condition. 
 The <codeph>netStatus</codeph> event contains an <codeph>info</codeph> property,
 which is an information object that contains specific information about the event, 
 such as whether a connection attempt succeeded or failed. 
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.events.xml#NetStatusEvent/info"><linktext>flash.events.NetStatusEvent.info</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetConnection_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError"><apiName>securityError</apiName><shortdesc>
 Dispatched if a call to NetConnection.call() 
 attempts to connect to a server outside the caller's security sandbox.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier>flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched if a call to <codeph>NetConnection.call()</codeph> 
 attempts to connect to a server outside the caller's security sandbox.
 </apiDesc></adobeApiEventDetail><related-links><link href="flash.net.xml#NetConnection/call()"><linktext>NetConnection.call()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetConnection_flash.events.IOErrorEvent.IO_ERROR_ioError"><apiName>ioError</apiName><shortdesc>
 Dispatched when an input or output error occurs that causes a network operation to fail.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier>flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when an input or output error occurs that causes a network operation to fail. 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:NetConnection_flash.events.AsyncErrorEvent.ASYNC_ERROR_asyncError"><apiName>asyncError</apiName><shortdesc>
 Dispatched when an exception is thrown asynchronously &amp;#x2014; that is, 
 from native asynchronous code.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><adobeApiEventDetail><adobeApiEventDef><apiEventType>flash.events.AsyncErrorEvent.ASYNC_ERROR</apiEventType><adobeApiEventClassifier>flash.events.AsyncErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>
 Dispatched when an exception is thrown asynchronously — that is, 
 from native asynchronous code. 
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:NetConnection:NetConnection"><apiName>NetConnection</apiName><shortdesc>
     Creates a NetConnection object.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><oldexample>See the example for <code>connect()</code>.
     
     </oldexample></asCustoms></prolog><apiConstructorDetail><apiConstructorDef><apiAccess value="public"/></apiConstructorDef><apiDesc>
     Creates a NetConnection object. Call <codeph>connect()</codeph> to make a connection.
     
	 <p>If an application needs to communicate with servers released prior
     to Flash Player 9, you might need to set the NetConnection object's 
     <codeph>objectEncoding</codeph> property.</p>
     
     
     </apiDesc></apiConstructorDetail><related-links><link href="flash.net.xml#NetConnection/connect()"><linktext>flash.net.NetConnection.connect()</linktext></link><link href="flash.net.xml#NetConnection/objectEncoding"><linktext>objectEncoding</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:NetConnection:addHeader"><apiName>addHeader</apiName><shortdesc>
     Adds a context header to the Action Message Format (AMF) packet structure.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>IMD: This method can be used in the client Flash Player for Flash Remoting
     and Flex apps. It is also a server side method used by Flash Media Server apps.
     
     
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>operation</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>Identifies the header and the ActionScript object data associated with it.
     
     </apiDesc></apiParam><apiParam><apiItemName>mustUnderstand</apiItemName><apiOperationClassifier>Boolean</apiOperationClassifier><apiData>false</apiData><apiDesc>A value of <codeph>true</codeph> indicates that the server must understand
     and process this header before it handles any of the following headers or messages.
     </apiDesc></apiParam><apiParam><apiItemName>param</apiItemName><apiOperationClassifier>Object</apiOperationClassifier><apiData>null</apiData><apiDesc>Any ActionScript object.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Adds a context header to the Action Message Format (AMF) packet structure. This header is sent with
     every future AMF packet. If you call <codeph>NetConnection.addHeader()</codeph>
     using the same name, the new header replaces the existing header, and the new header
     persists for the duration of the NetConnection object. You can remove a header by
     calling <codeph>NetConnection.addHeader()</codeph> with the name of the header to remove 
     an undefined object.
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetConnection:call"><apiName>call</apiName><shortdesc>
     Invokes a command or method on Flash Media Server or on an application server running Flash Remoting.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>command</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>A method specified in the form <codeph>[objectPath/]method</codeph>. For example, 
     the <codeph>someObject/doSomething</codeph> command tells the remote server
     to invoke the <codeph>clientObject.someObject.doSomething()</codeph> method, with all the optional
     <codeph>... arguments</codeph> parameters. If the object path is missing, 
     <codeph>clientObject.doSomething()</codeph> is invoked on the remote server.
     <p>
     With Flash Media Server, <codeph>command</codeph> is the name of a function
     defined in an application's server-side script.
     You do not need to use an object path before <codeph>command</codeph>
     if the server-side script is placed at the root level of
     the application directory.
     </p>
     
     </apiDesc></apiParam><apiParam><apiItemName>responder</apiItemName><apiOperationClassifier>flash.net:Responder</apiOperationClassifier><apiDesc>An optional object that is used to handle return values from the server.
     The Responder object can have two defined methods to handle the returned result: 
     <codeph>result</codeph> and <codeph>status</codeph>. If an error is returned as the result,
     <codeph>status</codeph> is invoked; otherwise, <codeph>result</codeph> is invoked. The Responder object
     can process errors related to specific operations, while the NetConnection object responds to
     errors related to the connection status.
     
     </apiDesc></apiParam><apiParam><apiItemName>arguments</apiItemName><apiType value="restParam"/><apiDesc>Optional arguments that can be of any ActionScript type, 
     including a reference to another ActionScript object. These arguments are passed 
     to the method specified in the <codeph>command</codeph> parameter when the method is executed on the 
     remote application server.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Invokes a command or method on Flash Media Server or on an application server running Flash Remoting.
     
     Before calling <codeph>NetConnection.call()</codeph> you must call <codeph>NetConnection.connect()</codeph> 
     to connect to the server. You must create a server-side function to pass to this method. 
     
      <p>You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     <ph product="flex">
     <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     </ph>
     <ph product="flash">
     <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     </ph>
      of the <i>Programming ActionScript 3.0</i> book.</p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#Responder"><linktext>flash.net.Responder</linktext></link></related-links><adobeApiEvent id="flash.net:NetConnection:call_securityError"><apiName>securityError</apiName><prolog/><adobeApiEventDetail><adobeApiEventDef><adobeApiEventClassifier>flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent/></adobeApiEventDef><apiDesc>A call attempted
     to communicate with a server outside the caller's security sandbox.
     You can avoid this problem by using a policy file on the server.
     </apiDesc></adobeApiEventDetail><shortdesc>A call attempted
     to communicate with a server outside the caller's security sandbox.</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:NetConnection:close"><apiName>close</apiName><shortdesc>
     Closes the connection that was opened locally or to the server and dispatches
     a netStatus event
     with a code property of NetConnection.Connect.Closed.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>server-specific: Documented this method with server-specific info in span tags. The
     info is relevant for Flex servers, as well as Flash Media Server.
     </internal></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiReturn><apiType value="void"/></apiReturn></apiOperationDef><apiDesc>
     Closes the connection that was opened locally or to the server and dispatches
     a <codeph>netStatus</codeph> event
     with a <codeph>code</codeph> property of <codeph>NetConnection.Connect.Closed</codeph>.
     
     <p>
     This method disconnects all NetStream objects running over the connection. 
     Any queued data that has not been sent is discarded. (To terminate 
     local or server streams without closing the connection, use <codeph>NetStream.close()</codeph>.) 
     If you close the connection and then want to create a new one,
     you must create a new NetConnection object and call the <codeph>connect()</codeph> method again.
     </p>
     
     <p>The <codeph>close()</codeph> method also disconnects all remote shared objects running 
     over this connection.
     However, you don't need to recreate the shared object to reconnect. Instead, you can just
     call <codeph>SharedObject.connect()</codeph> to reestablish the connection to the shared object.
     Also, any data in the shared object that was queued when you issued 
     <codeph>NetConnection.close()</codeph> will be sent after you reestablish a connection
     to the shared object.</p>
     
     <p>
     With Flash Media Server, the best development practice is to call <codeph>close()</codeph> 
     when the client no longer needs the connection to the server. Calling <codeph>close()</codeph>
     is the fastest way to clean up unused connections. You can configure the server to close idle connections
     automatically as a back-up measure. For more information, see 
     the <i><xref href="http://www.adobe.com/support/documentation" scope="external">Flash Media Server Configuration and Administration Guide</xref></i>. 
     </p>
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetStream"><linktext>NetStream</linktext></link><link href="flash.events.xml#NetStatusEvent/info"><linktext>flash.events.NetStatusEvent.info</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetConnection:connect"><apiName>connect</apiName><shortdesc>
     Creates a bidirectional connection between a Flash Player 
	 or AIR an AIR application and a Flash Media Server application.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><keyword>NetConnection.connect, connect
     </keyword></asCustoms></prolog><apiOperationDetail><apiOperationDef><apiAccess value="public"/><apiException><apiDesc>The URI passed to the <codeph>command</codeph> parameter is 
     improperly formatted.
     
     </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException><apiException><apiDesc>The connection failed. This might happen if you call <codeph>connect()</codeph>
     from within a <codeph>netStatus</codeph> event handler, which is not allowed.
     
	 </apiDesc><apiItemName>IOError</apiItemName><apiOperationClassifier>flash.errors:IOError</apiOperationClassifier></apiException><apiException><apiDesc>Local-with-filesystem SWF files cannot communicate with the Internet. 
	 You can avoid this problem by reclassifying the SWF file as local-with-networking or trusted.
	 
      </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiException><apiDesc>If you are trying to connect to a commonly reserved port. 
      For a complete list of blocked ports, see "Restricting Networking APIs" in the 
      security chapter of the <i>Programming ActionScript 3.0</i> book.
     
     </apiDesc><apiItemName>SecurityError</apiItemName><apiOperationClassifier>SecurityError</apiOperationClassifier></apiException><apiReturn><apiType value="void"/></apiReturn><apiParam><apiItemName>command</apiItemName><apiOperationClassifier>String</apiOperationClassifier><apiDesc>Set this parameter to <codeph>null</codeph> if you are connecting to a 
     video file on the local computer.
     If you are connecting to a server, set this parameter to the URI of the 
     application that contains the video file on the server. Use the following  
     syntax (items in brackets are optional):
     
     <p><codeph>protocol:[//host][:port]/appname[/instanceName]</codeph></p>
     
     <p>To connect to Flash Media Server, use <codeph>rtmp</codeph>,
     <codeph>rtmpe</codeph>, <codeph>rtmps</codeph>, <codeph>rtmpt</codeph>, <codeph>rtmpte</codeph>, or <codeph>rtmfp</codeph>
     as the protocol. If the connection is successful, a
     <codeph>netStatus</codeph> event with a <codeph>code</codeph> property of
     <codeph>NetConnection.Connect.Success</codeph> is returned.
     See the <codeph>NetStatusEvent.info</codeph> property for a list of
     all event codes returned in response to calling <codeph>connect()</codeph>.
     </p>
     
     <p>If the file is served from the same host where the server is installed, 
     you can omit the <codeph>host</codeph> parameter. If you omit the <codeph>instanceName</codeph> parameter, 
	 <ph platform="actionscript">Flash Player or</ph> AIR connects to the application's default instance.</p>
     
     </apiDesc></apiParam><apiParam><apiItemName>arguments</apiItemName><apiType value="restParam"/><apiDesc>Optional parameters of any type to be passed to the application 
     specified in <codeph>command</codeph>. 
     With Flash Media Server, the additional arguments are passed to the
     <codeph>application.onConnect()</codeph> event handler in the application's server-side 
     code. You must define and handle the arguments in <codeph>onConnect()</codeph>.
     
     </apiDesc></apiParam></apiOperationDef><apiDesc>
     Creates a bidirectional connection between <ph platform="actionscript">a Flash Player 
	 or AIR</ph> <ph platform="javascript">an AIR</ph> application and a Flash Media Server application. 
     A NetConnection object is like a pipe between the client and the server. Use NetStream objects to send streams through the pipe. 
     For information about codecs and file formats supported by Flash Media Server, see
     the <xref href="http://www.adobe.com/support/documentation" scope="external">Flash Media Server documentation</xref>.
     
     <p>
     Without Flash Media Server, call <codeph>NetConnection.connect()</codeph> to play video and MP3 files from a local file system or from a web server. 
     For information about supported codecs and file formats, see <xref href="http://www.adobe.com/go/hardware_scaling_en" scope="external">http://www.adobe.com/go/hardware_scaling_en</xref>.
     </p>
     
     <p>
     Creates a bidirectional connection between <ph platform="actionscript">a Flash Player 
	 or AIR</ph> <ph platform="javascript">an AIR</ph> application and an application server running
     the Flash Remoting service. Use the NetServices class to call functions on and return results from application servers over a NetConnection object.
     For more information, see the <xref href="http://www.adobe.com/support/documentation" scope="external">Flash Remoting documentation</xref>. 
     </p>
     
	 <p>When using this method, consider the following security model:</p>
     
     <ul>
      <li>By default, <ph platform="actionscript">Flash Player or</ph> AIR denies access between sandboxes.  
      A website can enable access to a resource by using a URL policy file. </li>
     
      <li>Your application can deny access to a resource on the server.
      In a Flash Media Server application, you need to add server-side code to deny access.
      See the Flash Media Server documentation for details. </li> 
     
      <li>You cannot use <codeph>NetConnection.connect()</codeph> if the calling file is in the
      local-with-file-system sandbox.</li>
     
      <li>You cannot connect to commonly reserved ports. For a complete list of blocked
     ports, see "Restricting Networking APIs" in the 
     <ph product="flex">
     <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     </ph>
     <ph product="flash">
     <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     </ph>
      of the <i>Programming ActionScript 3.0</i> book. </li>
     
     <li>You can prevent a SWF file from using this method by setting the <codeph>allowNetworking</codeph> 
     parameter of the the <codeph>object</codeph> and <codeph>embed</codeph> tags in the HTML 
     page that contains the SWF content.</li>
     
     </ul>
     
	 <p>However, in Adobe AIR, content in the <codeph>application</codeph> 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 product="flex">The <xref href="http://www.adobe.com/go/flex3_progAS3_security" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     <li product="flash">The <xref href="http://www.adobe.com/go/flashcs4_prog_as3_security_en" scope="external">security chapter</xref>
     in the <i>Programming ActionScript 3.0</i> book and the latest comments on LiveDocs</li>
     
     <li>The Flash Player Developer Center Topic: <xref href="http://www.adobe.com/go/devnet_security_en" scope="external">Security</xref></li>
     </ul>
     
     
     </apiDesc></apiOperationDetail><related-links><link href="flash.net.xml#NetStream"><linktext>flash.net.NetStream</linktext></link><link href="flash.events.xml#NetStatusEvent/info"><linktext>flash.events.NetStatusEvent.info</linktext></link></related-links></apiOperation><apiValue id="flash.net:NetConnection:client:get"><apiName>client</apiName><shortdesc>
     Indicates the object on which callback methods should be invoked.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>Property documented; needs review.
     </internal></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>Object</apiValueClassifier><apiException><apiDesc>The <codeph>client</codeph> property must be set to a non-null object. 
     
     </apiDesc><apiItemName>TypeError</apiItemName><apiOperationClassifier>TypeError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
     Indicates the object on which callback methods should be invoked. The default is 
     this NetConnection instance. If you set the <codeph>client</codeph> property to another object, 
     callback methods will be invoked on that object.
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:connected:get"><apiName>connected</apiName><shortdesc>
	 Indicates whether the application is connected to a server through
     a persistent RTMP connection (true) or not (false).</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Boolean</apiValueClassifier></apiValueDef><apiDesc>
	 Indicates whether the application is connected to a server through
     a persistent RTMP connection (<codeph>true</codeph>) or not (<codeph>false</codeph>). 
     When connected through HTTP, this property is <codeph>false</codeph>, except
     when connected to Flash Remoting services on an application server, 
     in which case it is <codeph>true</codeph>. 
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:connectedProxyType:get"><apiName>connectedProxyType</apiName><shortdesc>
     The proxy type used to make a successful NetConnection.connect() call to Flash Media Server:
      "none", "HTTP", "HTTPS", or "CONNECT".</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>This property is used in Breeze 5.5.
     </internal></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier><apiException><apiDesc>An attempt was made to access this property when the NetConnection instance
     was not connected. 
     
     </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
     The proxy type used to make a successful <codeph>NetConnection.connect()</codeph> call to Flash Media Server:
      <codeph>"none"</codeph>, <codeph>"HTTP"</codeph>, <codeph>"HTTPS"</codeph>, or <codeph>"CONNECT"</codeph>. 
     The value is <codeph>"none"</codeph> if the connection is not tunneled,
     <codeph>"HTTP"</codeph> if the connection is tunneled over HTTP, <codeph>"HTTPS"</codeph> if the connection is tunneled over HTTPS, 
     and <codeph>"CONNECT"</codeph> if the connection is tunneled using the HTTP CONNECT method.
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:defaultObjectEncoding:get"><apiName>defaultObjectEncoding</apiName><shortdesc>
	 The default object encoding for NetConnection objects.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiStatic/><apiValueAccess value="readwrite"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
	 The default object encoding for NetConnection objects.
     When an object is written to or read from binary data, the <codeph>defaultObjectEncoding</codeph>
	 property indicates which Action Message Format (AMF) version is used to serialize the data: 
	 the ActionScript 3.0 format (<codeph>ObjectEncoding.AMF3</codeph>)
     or the ActionScript 1.0 and ActionScript 2.0 format (<codeph>ObjectEncoding.AMF0</codeph>). 
     
     <p>The default value is <codeph>ObjectEncoding.AMF3</codeph>. 
     Changing <codeph>NetConnection.defaultObjectEncoding</codeph>
     does not affect existing NetConnection instances; it affects only instances that 
     are created subsequently.</p>
     
     <p>To set an object's encoding separately (rather than setting object encoding for the entire
     application), set the <codeph>objectEncoding</codeph> property of the NetConnection object instead.</p>
     
     <p>For more detailed information, see the description of the <codeph>objectEncoding</codeph>
     property.</p>
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetConnection/objectEncoding"><linktext>NetConnection.objectEncoding</linktext></link><link href="flash.net.xml#ObjectEncoding"><linktext>flash.net.ObjectEncoding</linktext></link></related-links></apiValue><apiValue id="flash.net:NetConnection:farID:get"><apiName>farID</apiName><shortdesc>
     The identifier of the Flash Media Server instance to which this Flash Player or Adobe AIR instance is connected.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     The identifier of the Flash Media Server instance to which this Flash Player or Adobe AIR instance is connected.  
     This property is meaningful only for RTMFP connections. The value of this property is available only after an RTMFP connection is established.
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetConnection/nearID"><linktext>nearID</linktext></link></related-links></apiValue><apiValue id="flash.net:NetConnection:farNonce:get"><apiName>farNonce</apiName><shortdesc>
     A value chosen substantially by Flash Media Server, unique to this connection.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     A value chosen substantially by Flash Media Server, unique to this connection. This value appears to the server
     as its <codeph>client.nearNonce</codeph> value. This value is defined only for RTMFP, RTMPE and RTMPTE connections.
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:maxPeerConnections:get"><apiName>maxPeerConnections</apiName><shortdesc>
     The total number of inbound and outbound peer connections that this instance of Flash Player or Adobe AIR allows.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>uint</apiValueClassifier></apiValueDef><apiDesc>
     The total number of inbound and outbound peer connections that this instance of Flash Player or Adobe AIR allows. 
     The default value is 8. 
     <p>This value does not distinguish between publisher and subscriber connections. If this value is reduced while
     peer connections are present, the new value affects new incoming connections only. Existing connections are not dropped.</p>
     
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:nearID:get"><apiName>nearID</apiName><shortdesc>
     The identifier of this Flash Player or Adobe AIR instance for this NetConnection instance.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     The identifier of this Flash Player or Adobe AIR instance for this NetConnection instance. This property is meaningful only for RTMFP connections.
     
     <p>Every NetConnection instance has a unique <codeph>nearID</codeph> property. No Flash Player or Adobe AIR instance
     or NetConnection instance has the same identifier.</p>
     
     <p>Other Flash Player or Adobe AIR instances
     use this identifier as the <codeph>peerID</codeph> for new NetStream connections to this client.
     Subsequently, this identifier is the <codeph>farID</codeph> in any peer NetStream that connects to this instance.</p>
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetConnection/farID"><linktext>farID</linktext></link></related-links></apiValue><apiValue id="flash.net:NetConnection:nearNonce:get"><apiName>nearNonce</apiName><shortdesc>
     A value chosen substantially by this Flash Player or Adobe AIR instance, unique to this connection.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     A value chosen substantially by this Flash Player or Adobe AIR instance, unique to this connection. This value appears to the server
     as its <codeph>client.farNonce</codeph> value. This value is defined only for RTMFP, RTMPE and RTMPTE connections.
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:objectEncoding:get"><apiName>objectEncoding</apiName><shortdesc>
     The object encoding for this NetConnection instance.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>uint</apiValueClassifier><apiException><apiDesc>An attempt was made to set the value of the <codeph>objectEncoding</codeph>
     property while the NetConnection instance was connected.
     
     </apiDesc><apiItemName>ReferenceError</apiItemName><apiOperationClassifier>ReferenceError</apiOperationClassifier></apiException><apiException><apiDesc>This property was set to a value other than <codeph>ObjectEncoding.AMF0</codeph>
     or <codeph>ObjectEncoding.AMF3</codeph>.
     
     </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
     The object encoding for this NetConnection instance.
     
     <p>
     When an object is written to or read from binary data, the <codeph>defaultObjectEncoding</codeph>
     property indicates which Action Message Format (AMF) version should be used to serialize the data: the ActionScript 3.0 format (<codeph>ObjectEncoding.AMF3</codeph>)
     or the ActionScript 1.0 and ActionScript 2.0 format (<codeph>ObjectEncoding.AMF0</codeph>). 
     Set the <codeph>objectEncoding</codeph> property to set an AMF version for a NetConnection instance.
     </p>
     
	 <p>It's important to understand this property if your application needs to
     communicate with servers released prior to Flash Player 9. The following three scenarios are possible:
     </p>
     
     <ul>
	 <li>Connecting to a server that supports AMF3 (for example, Flex Data Services 2 or Flash Media Server 3). 
	 The default value of <codeph>defaultObjectEncoding</codeph> is
     <codeph>ObjectEncoding.AMF3</codeph>. All NetConnection instances created in this
	 file use AMF3 serialization, so you don't need to set the
	 <codeph>objectEncoding</codeph> property.</li>
       
     <li>Connecting to a server that doesn't support AMF3 (for example, Flash Media Server 2). 
     In this scenario, set the static <codeph>NetConnection.defaultObjectEncoding</codeph> property to
     <codeph>ObjectEncoding.AMF0</codeph>. All NetConnection instances created in this
     SWF file use AMF0 serialization. You don't need to set the
     <codeph>objectEncoding</codeph> property. </li>
     
     <li>Connecting to multiple servers that use different encoding versions. Instead of
     using <codeph>defaultObjectEncoding</codeph>, set the object encoding on a per-connection
     basis using the <codeph>objectEncoding</codeph> property for each connection. 
     Set it to <codeph>ObjectEncoding.AMF0</codeph> to connect to
     servers that use AMF0 encoding, such as Flash Media Server 2, 
     and set it to <codeph>ObjectEncoding.AMF3</codeph> to connect to
     servers that use AMF3 encoding, such as Flex Data Services 2.</li>
     </ul>
     
     <p>Once a NetConnection instance is connected, its <codeph>objectEncoding</codeph>
     property is read-only.</p>
     
	 <p>If you use the wrong encoding to connect to a server, the NetConnection object 
	 dispatches the <codeph>netStatus</codeph> event. The <codeph>NetStatusEvent.info</codeph>
     property contains an information object with a <codeph>code</codeph> property value of
     <codeph>NetConnection.Connect.Failed</codeph>, and a description explaining that the object
     encoding is incorrect.</p>
     
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetConnection/defaultObjectEncoding"><linktext>defaultObjectEncoding</linktext></link><link href="flash.net.xml#ObjectEncoding"><linktext>flash.net.ObjectEncoding</linktext></link></related-links></apiValue><apiValue id="flash.net:NetConnection:protocol:get"><apiName>protocol</apiName><shortdesc>
     The protocol used to establish the connection.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier><apiException><apiDesc>An attempt was made to access this property when the NetConnection instance
     was not connected. 
     
     </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
     The protocol used to establish the connection. This property is relevant when using
     Flash Media Server. Possible values are as follows:
     <ul>
     <li><codeph>"rtmp"</codeph>: Real-Time Messaging Protocol (RTMP)</li>
     <li><codeph>"rtmpe"</codeph>: Encrypted RTMP</li>
     <li><codeph>"rtmpt"</codeph>: HTTP tunneling RTMP</li>
     <li><codeph>"rtmpte"</codeph>: HTTP tunneling encrypted RTMP</li>
     <li><codeph>"rtmps"</codeph>: HTTPS based RTMP</li>
     <li><codeph>"rtmfp"</codeph>: Real-Time Media Flow Protocol (RTMFP)</li>
     </ul>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:proxyType:get"><apiName>proxyType</apiName><shortdesc>
     Determines which fallback methods are tried if an
     initial connection attempt to the server fails.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>This property is used in Breeze 5.5. In the Breeze Add-in, the default value is <code>"best"</code>; if this value
     is not changed, native SSL sockets are used by default, and a fallback
     to other methods is used if necessary. 
     </internal></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="readwrite"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     Determines which fallback methods are tried if an
     initial connection attempt to the server fails. You must set the <codeph>proxyType</codeph> property before 
     calling the <codeph>NetConnection.connect()</codeph> method.
     
     <p>Acceptable values are <codeph>"none"</codeph>, <codeph>"HTTP"</codeph>, <codeph>"CONNECT"</codeph>, 
	 and <codeph>"best"</codeph>.</p>
     
	 <p>The default value for this property is <codeph>"none"</codeph>; 
	 if you do not change this value, the application uses HTTPS tunneling for RTMPS.
	 If the property is set to <codeph>"best"</codeph>, the client attempts to connect using native SSL. 
	 If the connection fails, other connection methods are attempted.
	 If the property is set to <codeph>"HTTP"</codeph>
     and a direct connection fails, HTTP tunneling is used.
	 If the property is set to <codeph>"CONNECT"</codeph> and a direct connection fails,
     the <codeph>CONNECT</codeph> method of tunneling is used. If that fails, the connection will
     not fall back to HTTP tunneling.</p>
     
     <p>This property is applicable only when using RTMP, RTMPS, or RTMPT. The <codeph>CONNECT</codeph> 
	 method is applicable only to users who are connected to the network by a proxy server.</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:unconnectedPeerStreams:get"><apiName>unconnectedPeerStreams</apiName><shortdesc>
     
     An object that holds all of the peer subscriber NetStream objects that are not associated with publishing NetStream objects.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="10"/><apiPlatform description="" name="AIR" version="1.5"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Array</apiValueClassifier></apiValueDef><apiDesc>
     
     An object that holds all of the peer subscriber NetStream objects that are not associated with publishing NetStream objects.
     Subscriber NetStream objects that are associated with publishing NetStream objects are in the <codeph>NetStream.peerStreams</codeph>
     array.
     </apiDesc></apiValueDetail><related-links><link href="flash.net.xml#NetStream/peerStreams"><linktext>NetStream.peerStreams</linktext></link></related-links></apiValue><apiValue id="flash.net:NetConnection:uri:get"><apiName>uri</apiName><shortdesc>
     The URI passed to the NetConnection.connect() method.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata><asCustoms><internal>server-specific: Documented this method with server-specific info in span tags. The
     info is relevant for Flex servers, as well as Flash Media Server.
     </internal></asCustoms></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>String</apiValueClassifier></apiValueDef><apiDesc>
     The URI passed to the <codeph>NetConnection.connect()</codeph> method. 
     If <codeph>NetConnection.connect()</codeph> hasn't been called or if no URI was passed, 
     this property is <codeph>undefined</codeph>.
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:usingTLS:get"><apiName>usingTLS</apiName><shortdesc>
     Indicates whether a secure connection was made using native Transport Layer Security (TLS) 
     rather than HTTPS.</shortdesc><prolog><asMetadata><apiVersion><apiLanguage version="3.0"/><apiPlatform description="" name="Flash" version="9"/></apiVersion></asMetadata></prolog><apiValueDetail><apiValueDef><apiProperty/><apiAccess value="public"/><apiDynamic/><apiValueAccess value="read"/><apiValueClassifier>Boolean</apiValueClassifier><apiException><apiDesc>An attempt was made to access this property when the NetConnection instance
     was not connected. 
     
     </apiDesc><apiItemName>ArgumentError</apiItemName><apiOperationClassifier>ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc>
     Indicates whether a secure connection was made using native Transport Layer Security (TLS) 
     rather than HTTPS. This property is valid only when a NetConnection object is connected.
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier></apiPackage>