<?xml version="1.0" encoding="UTF-8"?>
<apiPackage xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" id="flash.net" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiPackage/apiPackage "><apiName class="- topic/title reference/title apiRef/apiName ">flash.net</apiName><apiDetail class="- topic/body reference/refbody apiRef/apiDetail "/><apiClassifier languages="" id="flash.net:XMLSocket" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">XMLSocket</apiName><shortdesc class="- topic/shortdesc ">
 
 XMLSocket 类可实现客户端套接字，从而使 Flash Player 或 AIR 应用程序可以与由 IP 地址或域名标识的服务器计算机进行通信。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">XMLsocket, XMLsocket object, built-in class
 </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 
 XMLSocket 类可实现客户端套接字，从而使 <ph class="- topic/ph ">Flash Player 或</ph> AIR 应用程序可以与由 IP 地址或域名标识的服务器计算机进行通信。对于要求滞后时间较短的客户端/服务器应用程序，如实时聊天系统，XMLSocket 类非常有用。传统的基于 HTTP 的聊天解决方案频繁轮询服务器，并使用 HTTP 请求来下载新的消息。与此相对照，XMLSocket 聊天解决方案保持与服务器的开放连接，这一连接允许服务器即时发送传入的消息，而无需客户端发出请求。要使用 XMLSocket 类，服务器计算机必须运行可识别 XMLSocket 类使用的协议的守护程序。下面的列表说明了该协议： 
 <ul class="- topic/ul "><li class="- topic/li ">XML 消息通过全双工 TCP/IP 流套接字连接发送。</li><li class="- topic/li ">每个 XML 消息都是一个完整的 XML 文档，以一个零 (0) 字节结束。</li><li class="- topic/li ">通过 XMLSocket 连接发送和接收的 XML 消息的数量没有限制。</li></ul>
 
 <p class="- topic/p ">将服务器设置为与 XMLSocket 对象进行通信可能会遇到一些困难。如果您的应用程序不需要进行实时交互，请使用 URLLoader 类，而不要使用 XMLSocket 类。 </p>
 
 <p class="- topic/p ">要使用 XMLSocket 类的方法，请先使用构造函数 <codeph class="+ topic/ph pr-d/codeph ">new XMLSocket</codeph> 创建一个 XMLSocket 对象。</p>
 
 <p class="- topic/p ">只能与本地文件系统内容交互的沙箱中的 SWF 文件无法使用套接字。</p>
      
  <p class="- topic/p "> 目标主机上的<i class="+ topic/ph hi-d/i ">套接字策略文件</i> 指定 SWF 文件可从中建立套接字连接的主机，并指定可以建立这些连接的端口。在新近发布的几个版本的 Flash Player 中，有关套接字策略文件的安全要求变得更加严格。对于所有版本的 Flash Player，Adobe 建议使用套接字策略文件；在某些情况下，必须使用套接字策略文件。因此，如果使用的是 XMLSocket 对象，必要时请确保目标主机提供了套接字策略文件。 </p>
 
  <p class="- topic/p ">以下列表汇总了各个版本的 Flash Player 中针对套接字策略文件的要求：</p>
 
  <ul class="- topic/ul "><li class="- topic/li "> 在 Flash Player 9.0.124.0 及更高版本中，套接字策略文件对于任何 XMLSocket 连接都是必需的。也就是说，无论连接到哪一个端口（即使连接到提供 SWF 文件的同一主机上的端口），目标主机上都需要套接字策略文件。 </li><li class="- topic/li "> 在 Flash Player 9.0.115.0 版及更低版本中，如果要连接到小于 1024 的端口号或连接到除提供 SWF 文件的主机之外的主机，则目标主机上必须具有套接字策略文件。 </li><li class="- topic/li "> 在 Flash Player 9.0.115.0 中，尽管套接字策略文件不是必需的，但如果目标主机未提供套接字策略文件，那么当使用 Flash Debug Player 时，也会显示警告。 </li></ul>
 
 <p class="- topic/p ">但在 Adobe AIR 中，<codeph class="+ topic/ph pr-d/codeph ">application</codeph> 安全沙箱中的内容（使用 AIR 应用程序安装的内容）不受这些安全限制的约束。</p>
 
 <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
 
 </apiDesc><example conref="examples\XMLSocketExample.as" class="- topic/example "> 下例使用 XMLSocketExample 类来通过 XMLSocket 发送数据并输出 XMLSocket 事件过程中的信息。这是使用以下步骤完成的：
 <ol class="- topic/ol "><li class="- topic/li ">XMLSocketExample 构造函数创建名为 <codeph class="+ topic/ph pr-d/codeph ">socket</codeph> 的 XMLSocket 实例，并将 <codeph class="+ topic/ph pr-d/codeph ">socket</codeph> 传递给 <codeph class="+ topic/ph pr-d/codeph ">ConfigureListeners()</codeph>（如下所述），然后使用主机名“localhost”和端口号 <codeph class="+ topic/ph pr-d/codeph ">8080</codeph> 调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> XMLSocket 的方法。</li><li class="- topic/li ">随后调用 <codeph class="+ topic/ph pr-d/codeph ">configureListeners()</codeph> 方法，该方法为每个受支持的 XMLSocket 事件添加侦听器：
  <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">closeHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">close</codeph> 事件，在网络连接关闭后调度该事件。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">connectHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件，在建立网络连接后调度该事件。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">dataHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 事件，在 XMLSocket 每次接收新数据时调度该事件。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">progressHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 事件，已调用 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 并且发送正在进行时调度该事件。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">securityErrorHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">securityError</codeph> 事件，如果试图使用错误的本地播放安全性设置或端口号低于 1024 的端口访问 XMLSocket，则调度该事件。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">ioErrorHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">ioError</codeph> 事件，仅当发送或接收数据的操作失败时，才会发生该事件。</li></ul></li></ol>
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>
 <ul class="- topic/ul "><li class="- topic/li ">您需要编译 SWF 文件并将“本地播放安全性”设置为“只访问网络”。</li><li class="- topic/li ">为了让本示例正常工作，需要一个在域上运行并使用 8080 端口的服务器。</li><li class="- topic/li ">如果运行的是 Flash Player 9.0.124.0 或更高版本，则需要在服务器上放置一个套接字策略文件，以允许建立从域到端口 8080 的套接字连接。有关提供套接字策略文件的信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html" scope="external" class="- topic/xref ">设置套接字策略文件服务器</xref>。</li></ul>
 </p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#URLLoader/load()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.URLLoader.load()</linktext></link><link href="flash.net.xml#URLLoader" class="- topic/link "><linktext class="- topic/linktext ">flash.net.URLLoader</linktext></link></related-links><adobeApiEvent id="flash.net:XMLSocket_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><shortdesc class="- topic/shortdesc ">
 若对 XMLSocket.connect() 方法的调用尝试连接到调用方安全沙箱外部的服务器或低于 1024 的端口，则进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 若对 <codeph class="+ topic/ph pr-d/codeph ">XMLSocket.connect()</codeph> 方法的调用尝试连接到调用方安全沙箱外部的服务器或低于 1024 的端口，则进行调度。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#XMLSocket/connect()" class="- topic/link "><linktext class="- topic/linktext ">XMLSocket.connect()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket_flash.events.IOErrorEvent.IO_ERROR_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><shortdesc class="- topic/shortdesc ">
 在出现输入/输出错误并导致发送或接收操作失败时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在出现输入/输出错误并导致发送或接收操作失败时调度。 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket_flash.events.DataEvent.DATA_data" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">data</apiName><shortdesc class="- topic/shortdesc ">
 在发送或接收原始数据后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.DataEvent.DATA</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.DataEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在发送或接收原始数据后调度。
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket_flash.events.Event.CONNECT_connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
 在成功调用 XMLSocket.connect() 方法后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.CONNECT</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在成功调用 <codeph class="+ topic/ph pr-d/codeph ">XMLSocket.connect()</codeph> 方法后调度。
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket_flash.events.Event.CLOSE_close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
 在服务器关闭套接字连接时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.CLOSE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在服务器关闭套接字连接时调度。仅在服务器关闭连接时调度 <codeph class="+ topic/ph pr-d/codeph ">close</codeph> 事件；在调用 <codeph class="+ topic/ph pr-d/codeph ">XMLSocket.close()</codeph> 方法时不调度该事件。
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:XMLSocket:XMLSocket" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">XMLSocket</apiName><shortdesc class="- topic/shortdesc ">
    创建一个新的 XMLSocket 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">host</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个完全限定的 DNS 域名，或 <i class="+ topic/ph hi-d/i ">.222.333.444</i> 形式的 IP 地址。在 Flash Player 9.0.115.0 以及 AIR 1.0 和更高版本中，可以指定 IPv6 地址，如 rtmp://[2001:db8:ccc3:ffff:0:444d:555e:666f]。也可指定 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 以连接到 SWF 文件所在的主机服务器。如果发出此调用的 SWF 文件正在 Web 浏览器中运行，则 <codeph class="+ topic/ph pr-d/codeph ">host</codeph> 必须与 SWF 文件位于同一个域中。
    
    </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">port</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">用于建立连接的目标主机上的 TCP 端口号。在 Flash Player 9.0.124.0 及更高版本中，目标主机必须提供套接字策略文件，以指定允许建立从提供 SWF 文件的主机到指定端口的套接字连接。在早期版本的 Flash Player 中，仅在要连接到小于 1024 的端口号或连接到除提供 SWF 文件的主机之外的主机时，才需要使用套接字策略文件。
    
    
    </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    创建一个新的 XMLSocket 对象。若未指定参数，将创建一个最初处于断开状态的套接字。若指定了参数，则尝试连接到指定的主机和端口。
    
    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>强烈建议使用<b class="+ topic/ph hi-d/b ">不带参数</b>的构造函数形式，并添加任意事件侦听器，然后使用 <codeph class="+ topic/ph pr-d/codeph ">host</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">port</codeph> 参数调用 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 方法。此序列将确保所有事件侦听器工作正常。</p>
    
    </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.net.xml#XMLSocket/connect()" class="- topic/link "><linktext class="- topic/linktext ">connect()</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:XMLSocket:close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     关闭由 XMLSocket 对象指定的连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">xmlsocket.close, close
      
      </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     关闭由 XMLSocket 对象指定的连接。仅在服务器关闭连接时调度 <codeph class="+ topic/ph pr-d/codeph ">close</codeph> 事件；在调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 方法时不调度该事件。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#XMLSocket/connect()" class="- topic/link "><linktext class="- topic/linktext ">connect()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:XMLSocket:connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
     使用指定的 TCP 端口建立到指定 Internet 主机的连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">xmlsocket.connect, connect
     
     </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">本地不受信任的 文件可能无法与 Internet 进行通信。可以通过将此文件重新分类为只能与远程内容交互的文件或受信任的文件来突破此限制。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">您不能指定高于 65535 的套接字端口。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">host</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个完全限定的 DNS 域名，或 <i class="+ topic/ph hi-d/i ">111.222.333.444</i> 形式的 IP 地址。也可指定 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 以连接到 SWF 文件所在的主机服务器。如果进行调用的文件是正在 Web 浏览器中运行的 SWF 文件，则 <codeph class="+ topic/ph pr-d/codeph ">host</codeph> 必须与该文件位于同一个域中。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">port</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">用于建立连接的目标主机上的 TCP 端口号。在 Flash Player 9.0.124.0 及更高版本中，目标主机必须提供套接字策略文件，以指定允许建立从提供 SWF 文件的主机到指定端口的套接字连接。在早期版本的 Flash Player 中，仅在要连接到小于 1024 的端口号或连接到除提供 SWF 文件的主机之外的主机时，才需要使用套接字策略文件。
     
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     使用指定的 TCP 端口建立到指定 Internet 主机的连接。
     
     <p class="- topic/p ">如果指定 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 为 <codeph class="+ topic/ph pr-d/codeph ">host</codeph> 参数，则与调用 <codeph class="+ topic/ph pr-d/codeph ">XMLSocket.connect()</codeph> 的文件所在的主机连接。例如，如果进行调用的文件是从 www.adobe.com 下载的，则将 host 参数指定为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 表示您将连接到 www.adobe.com。</p>
     
     
     <p class="- topic/p ">可以在包含 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数，防止 SWF 文件使用此方法。</p>
     
     <p class="- topic/p ">有关详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.events.xml#Event/CONNECT" class="- topic/link "><linktext class="- topic/linktext ">flash.events.Event.CONNECT</linktext></link></related-links><adobeApiEvent id="flash.net:XMLSocket:connect_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">连接操作试图连接到调用方的安全沙箱外部的主机，或试图连接到需要套接字策略文件的端口。可以通过在目标主机上使用套接字策略文件来解决上述任何一个问题。
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">连接操作试图连接到调用方的安全沙箱外部的主机，或试图连接到需要套接字策略文件的端口。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket:connect_data" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">data</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:DataEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在收到原始数据时调度。
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在收到原始数据时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:XMLSocket:connect_connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在建立网络连接后调度。 
      
      </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在建立网络连接后调度。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:XMLSocket:send" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">send</apiName><shortdesc class="- topic/shortdesc ">
     将 object 参数中指定的 XML 对象或数据转换成字符串，并将其传输到服务器，后面跟有一个零 (0) 字节。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">xmlsocket.send, send
      
      </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">XMLSocket 对象未与服务器连接。
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">object</apiItemName><apiType value="any" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个要传输到服务器的 XML 对象或其它数据。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 参数中指定的 XML 对象或数据转换成字符串，并将其传输到服务器，后面跟有一个零 (0) 字节。如果 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 是一个 XML 对象，则该字符串是此 XML 对象的 XML 文本表示形式。发送操作是异步的；它将立即返回，但数据可能会以后传输。<codeph class="+ topic/ph pr-d/codeph ">XMLSocket.send()</codeph> 方法不返回表示数据是否成功传输的值。
     
     <p class="- topic/p ">如果不是使用 <codeph class="+ topic/ph pr-d/codeph ">XMLSocket.connect()</codeph> 将 XMLSocket 对象连接到服务器，则 <codeph class="+ topic/ph pr-d/codeph ">XMLSocket.send()</codeph> 操作失败。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#XMLSocket/connect()" class="- topic/link "><linktext class="- topic/linktext ">connect()</linktext></link></related-links></apiOperation><apiValue id="flash.net:XMLSocket:connected:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">connected</apiName><shortdesc class="- topic/shortdesc ">
     表示此 XMLSocket 对象目前是否已连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示此 XMLSocket 对象目前是否已连接。还可以通过为 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件和 <codeph class="+ topic/ph pr-d/codeph ">ioError</codeph> 事件注册来检查连接是否成功。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#XMLSocket/event:connect" class="- topic/link "><linktext class="- topic/linktext ">connect</linktext></link><link href="flash.net.xml#XMLSocket/event:ioError" class="- topic/link "><linktext class="- topic/linktext ">ioError</linktext></link></related-links></apiValue><apiValue id="flash.net:XMLSocket:timeout:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">timeout</apiName><shortdesc class="- topic/shortdesc ">
     表示建立连接时需等待的毫秒数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示建立连接时需等待的毫秒数。
     
     <p class="- topic/p ">如果在指定时间内未成功建立连接，则连接失败。默认值是 20,000（20 秒）。</p>
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:IPVersion" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">IPVersion</apiName><shortdesc class="- topic/shortdesc ">
	 IPVersion 类定义代表 IP 地址的不同系列的常量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 IPVersion 类定义代表 IP 地址的不同系列的常量。
	 
 	 </apiDesc></apiClassifierDetail><apiValue id="flash.net:IPVersion:IPV4" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">IPV4</apiName><shortdesc class="- topic/shortdesc ">
		 Internet 协议版本 4 (IPv4) 地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">IPv4</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 Internet 协议版本 4 (IPv4) 地址。
		 
		 <p class="- topic/p ">IPv4 地址在 ActionScript 中表示为使用十进制点符号的字符串，例如，<codeph class="+ topic/ph pr-d/codeph ">"192.0.2.0"</codeph>。</p> 
		 
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:IPVersion:IPV6" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">IPV6</apiName><shortdesc class="- topic/shortdesc ">
		 Internet 协议版本 6 (IPv6) 地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">IPv6</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 Internet 协议版本 6 (IPv6) 地址。
		 
		 <p class="- topic/p ">IPv6 地址在 ActionScript 中表示为使用十六进制冒号符号并括在括号中的字符串，例如，<codeph class="+ topic/ph pr-d/codeph ">"[2001:db8:ccc3:ffff:0:444d:555e:666f]"</codeph>。</p>
		  
		 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:Socket" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Socket</apiName><shortdesc class="- topic/shortdesc ">
 Socket 类启用代码以建立传输控制协议 (TCP) 套接字连接，用于发送和接收二进制数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseInterface>flash.utils:IDataInput</apiBaseInterface><apiBaseInterface>flash.utils:IDataOutput</apiBaseInterface><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 Socket 类启用代码以建立传输控制协议 (TCP) 套接字连接，用于发送和接收二进制数据。
 
 <p class="- topic/p ">Socket 类与使用二进制协议的服务器一起使用时非常有用。</p>
 
 <p class="- topic/p ">要使用 Socket 类的方法，请先使用构造函数 <codeph class="+ topic/ph pr-d/codeph ">new Socket</codeph> 创建一个 Socket 对象。</p>
 
 <p class="- topic/p ">套接字以异步方式传输和接收数据。 </p>
 
 <p class="- topic/p ">在某些操作系统上，在执行帧之间会自动调用 flush()，但在其他操作系统（如 Windows）上，除非明确调用 <codeph class="+ topic/ph pr-d/codeph ">flush()</codeph>，否则不会发送数据。要确保应用程序在所有操作系统上都具有可靠的功能，在将每条消息（或相关数据组）写入套接字之后，最好调用 <codeph class="+ topic/ph pr-d/codeph ">flush()</codeph> 方法。</p>
 
 <p class="- topic/p ">在 Adobe AIR 中，当侦听 ServerSocket 接收到来自外部进程的连接时，也会创建 Socket 对象。Socket 对象表示在 ServerSocketConnectEvent 中调度了该连接。您的应用程序负责保持对此 Socket 对象的引用。如果不这样做，则 Socket 对象符合垃圾回收的条件，可能会在运行时损坏，但不会发出警告。</p>
 
 <p class="- topic/p ">在只能与本地文件系统内容交互的安全沙箱中运行的 SWF 内容无法使用套接字。</p>
 
  <p class="- topic/p "> 目标主机上的<i class="+ topic/ph hi-d/i ">套接字策略文件</i> 指定 SWF 文件可从中建立套接字连接的主机，并指定可以建立这些连接的端口。在新近发布的几个版本的 Flash Player 中，有关套接字策略文件的安全要求变得更加严格。对于所有版本的 Flash Player，Adobe 建议使用套接字策略文件；在某些情况下，必须使用套接字策略文件。因此，如果使用的是 Socket 对象，必要时请确保目标主机提供了套接字策略文件。 </p>
 
  <p class="- topic/p ">以下列表汇总了各个版本的 Flash Player 中针对套接字策略文件的要求：</p>
 
  <ul class="- topic/ul "><li class="- topic/li "> 在 Flash Player 9.0.124.0 和更高版本中，任何套接字连接都要求套接字策略文件。也就是说，无论连接到哪一个端口（即使连接到提供 SWF 文件的同一主机上的端口），目标主机上都需要套接字策略文件。 </li><li class="- topic/li "> 在 Flash Player 9.0.115.0 版及更低版本中，如果要连接到小于 1024 的端口号或连接到除提供 SWF 文件的主机之外的主机，则目标主机上必须具有套接字策略文件。 </li><li class="- topic/li "> 在 Flash Player 9.0.115.0 中，尽管套接字策略文件不是必需的，但如果目标主机未提供套接字策略文件，那么当使用 Flash Debug Player 时，也会显示警告。 </li><li class="- topic/li ">在 AIR 中，在应用程序安全沙箱中运行的内容不要求套接字策略文件。在 AIR 应用程序安全沙箱之外运行的内容建立的任何套接字连接均要求套接字策略文件。</li></ul>
 
 <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>
 </p>
 
 </apiDesc><example conref="examples\SocketExample.as" class="- topic/example "> 下例对套接字执行读写操作，并输出在套接字事件期间传输的信息。该示例的要点遵循：
 <ol class="- topic/ol "><li class="- topic/li ">该构造函数创建 <codeph class="+ topic/ph pr-d/codeph ">CustomSocket</codeph> 实例，名为 <codeph class="+ topic/ph pr-d/codeph ">socket</codeph>，并将主机名 <codeph class="+ topic/ph pr-d/codeph ">localhost</codeph> 和端口 80 作为参数传递。由于 <codeph class="+ topic/ph pr-d/codeph ">CustomSocket</codeph> 扩展了 Socket，因此在调用 <codeph class="+ topic/ph pr-d/codeph ">super()</codeph> 时将调用 Socket 的构造函数。</li><li class="- topic/li ">然后，该示例调用了 <codeph class="+ topic/ph pr-d/codeph ">configureListeners()</codeph> 方法，该方法可为 Socket 事件添加侦听器。</li><li class="- topic/li ">最后，调用套接字 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法，其中使用 <codeph class="+ topic/ph pr-d/codeph ">localhost</codeph> 作为主机名并使用 80 作为端口号。</li></ol>
 
 <p class="- topic/p "> <b class="+ topic/ph hi-d/b ">注意：</b>为了运行该示例，您需要一台与 SWF 位于同一个域（在本例中为 <codeph class="+ topic/ph pr-d/codeph ">localhost</codeph>）服务器并侦听端口 80。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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><related-links class="- topic/related-links "><link href="flash.net.xml#ServerSocket" class="- topic/link "><linktext class="- topic/linktext ">ServerSocket</linktext></link><link href="flash.net.xml#DatagramSocket" class="- topic/link "><linktext class="- topic/linktext ">DatagramSocket</linktext></link></related-links><adobeApiEvent id="flash.net:Socket_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><shortdesc class="- topic/shortdesc ">
 若对 Socket.connect() 的调用尝试连接到调用方的安全沙箱禁止的服务器或低于 1024 的端口，且不存在允许进行此类连接的套接字策略文件，则进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">发生安全性错误时调度。
  
  </apiTipText></apiTipTexts></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 若对 <codeph class="+ topic/ph pr-d/codeph ">Socket.connect()</codeph> 的调用尝试连接到调用方的安全沙箱禁止的服务器或低于 1024 的端口，且不存在允许进行此类连接的套接字策略文件，则进行调度。
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在 AIR 应用程序中，不需要套接字策略文件即允许在应用程序安全沙箱中运行的内容连接到任何服务器和端口号。</p>
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/connect()" class="- topic/link "><linktext class="- topic/linktext ">Socket.connect()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:Socket_flash.events.ProgressEvent.SOCKET_DATA_socketData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">socketData</apiName><shortdesc class="- topic/shortdesc ">
 在套接字接收到数据后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.ProgressEvent.SOCKET_DATA</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在套接字接收到数据后调度。
 
 <p class="- topic/p ">套接字接收的数据在被读取之前一直保持在套接字中。在此事件的处理期间，您不必读取所有可用的数据。</p>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">socketData</codeph> 类型的事件不使用 <codeph class="+ topic/ph pr-d/codeph ">ProgressEvent.bytesTotal</codeph> 属性。</p>
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:Socket_flash.events.IOErrorEvent.IO_ERROR_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><shortdesc class="- topic/shortdesc ">
 在出现输入/输出错误并导致发送或加载操作失败时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在出现输入/输出错误并导致发送或加载操作失败时调度。
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:Socket_flash.events.Event.CONNECT_connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
 在建立网络连接后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.CONNECT</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在建立网络连接后调度。
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:Socket_flash.events.Event.CLOSE_close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
 在服务器关闭套接字连接时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.CLOSE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在服务器关闭套接字连接时调度。
 
 <p class="- topic/p ">仅在服务器关闭连接时调度 <codeph class="+ topic/ph pr-d/codeph ">close</codeph> 事件；在调用 <codeph class="+ topic/ph pr-d/codeph ">Socket.close()</codeph> 方法时不调度该事件。</p>
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:Socket:Socket" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">Socket</apiName><shortdesc class="- topic/shortdesc ">
    创建新的 Socket 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>BRS determine if all above events are accurate, and which ones also apply
     </internal></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">SWF 内容中发生此错误的<ph class="- topic/ph ">原因如下：</ph>
     
     <ul class="- topic/ul "><li class="- topic/li ">与本地文件系统内容交互的文件无法与 Internet 进行通信。您可以通过将此 SWF 文件重新分类为只能与远程内容交互或受信任来解决此问题。此限制不是为应用程序安全沙箱中的 AIR 应用程序内容设置的。</li><li class="- topic/li ">您不能指定高于 65535 的套接字端口。</li></ul>
     
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">host</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">完全限定的 DNS 域名或 IP 地址。IPv4 地址使用十进制点符号指定，如 <i class="+ topic/ph hi-d/i ">192.0.2.0</i>。在 Flash Player 9.0.115.0 和 AIR 1.0 和更高版本中，可以使用十六进制冒号符号指定 IPv6 地址，如 <i class="+ topic/ph hi-d/i ">2001:db8:ccc3:ffff:0:444d:555e:666f</i>。也可指定 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 以连接到 SWF 文件所在的主机服务器。如果发出此调用的 SWF 文件正在 Web 浏览器中运行，则 <codeph class="+ topic/ph pr-d/codeph ">host</codeph> 必须与该 SWF 文件位于同一域中。
    
    </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">port</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">用于建立连接的目标主机上的 TCP 端口号。在 Flash Player 9.0.124.0 及更高版本中，目标主机必须提供套接字策略文件，以指定允许建立从提供 SWF 文件的主机到指定端口的套接字连接。在早期版本的 Flash Player 中，仅在要连接到小于 1024 的端口号或连接到除提供 SWF 文件的主机之外的主机时，才需要使用套接字策略文件。
    
    
     </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    创建新的 Socket 对象。若未指定参数，将创建一个最初处于断开状态的套接字。若指定了参数，则尝试连接到指定的主机和端口。
    
    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>强烈建议使用<b class="+ topic/ph hi-d/b ">不带参数</b>的构造函数形式，并添加任意事件侦听器，然后使用 <codeph class="+ topic/ph pr-d/codeph ">host</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">port</codeph> 参数调用 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 方法。此序列将确保所有事件侦听器工作正常。</p>
    
    </apiDesc></apiConstructorDetail><adobeApiEvent id="flash.net:Socket:Socket_connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在建立网络连接后调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在建立网络连接后调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:Socket:Socket_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在出现输入/输出错误并由此导致连接失败时调度。
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在出现输入/输出错误并由此导致连接失败时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:Socket:Socket_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     <ph class="- topic/ph ">如果对 <codeph class="+ topic/ph pr-d/codeph ">Socket.connect()</codeph> 的调用试图连接的服务器不提供套接字策略文件，或者服务器的策略文件未授予对指定端口的调用主机访问权限，则调度此事件。有关策略文件的详细信息，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“网站控制（策略文件）”和 Flash Player 开发人员中心主题<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</ph>
     
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">此错误出现在 SWF 内容中。如果对 Socket.connect() 的调用试图与未提供套接字策略文件的服务器进行连接，或者试图与其策略文件未授予执行调用的主机对指定端口的访问权的服务器进行连接，则调度此事件。</shortdesc></adobeApiEvent></apiConstructor><apiOperation id="flash.net:Socket:close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     关闭套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法关闭套接字，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     关闭套接字。在调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 方法之后，将无法读取或写入任何数据。
     
     <p class="- topic/p ">仅在服务器关闭连接时调度 <codeph class="+ topic/ph pr-d/codeph ">close</codeph> 事件；在调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 方法时不调度该事件。</p>
     
     <p class="- topic/p ">可通过再次对 Socket 对象调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法来重复使用该对象。</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
     将套接字连接到指定的主机和端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>BRS compare this entire description with XMLSocket.connect() and make consistent
      
      </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">未指定任何主机，而且连接失败。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">SWF 内容中发生此错误的<ph class="- topic/ph ">原因如下：</ph>
     
          <ul class="- topic/ul "><li class="- topic/li ">本地不受信任的 SWF 文件可能无法与 Internet 进行通信。可以通过将此文件重新分类为只能与远程内容交互的文件或受信任的文件来突破此限制。</li><li class="- topic/li ">您不能指定高于 65535 的套接字端口。</li><li class="- topic/li ">在包含 SWF 内容的 HTML 页中，<codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数设置为 <codeph class="+ topic/ph pr-d/codeph ">"none"</codeph>。</li></ul>
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">host</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要连接到的主机的名称或 IP 地址。如果未指定主机，则要连接的主机为执行调用的 文件所在的主机。如果不指定主机，请使用事件侦听器来确定连接是否成功。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">port</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要连接到的端口号。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将套接字连接到指定的主机和端口。
     
     <p class="- topic/p ">如果连接立即失败，则调度一个事件或引发一个异常。如果指定了主机，则调度一个错误事件；如果未指定主机，则引发异常。另外，连接的状态由事件来报告。如果已连接上套接字，则现有的连接将首先关闭。</p>
     
     </apiDesc></apiOperationDetail><adobeApiEvent id="flash.net:Socket:connect_connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在建立网络连接后调度。
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在建立网络连接后调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:Socket:connect_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在指定了主机但出现输入/输出错误并由此导致连接失败时调度。
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在指定了主机但出现输入/输出错误并由此导致连接失败时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:Socket:connect_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果对 <codeph class="+ topic/ph pr-d/codeph ">Socket.connect() </codeph>的调用试图与未提供套接字策略文件的服务器进行连接，或者试图与其策略文件未授予执行调用的主机对指定端口的访问权的服务器进行连接，则调度此事件。有关策略文件的详细信息，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“网站控制（策略文件）”和 Flash Player 开发人员中心主题<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">如果对 Socket.connect() 的调用试图与未提供套接字策略文件的服务器进行连接，或者试图与其策略文件未授予执行调用的主机对指定端口的访问权的服务器进行连接，则调度此事件。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:Socket:flush" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">flush</apiName><shortdesc class="- topic/shortdesc ">
     对套接字输出缓冲区中积累的所有数据进行刷新。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对套接字输出缓冲区中积累的所有数据进行刷新。
     
	 <p class="- topic/p ">在某些操作系统上，在执行帧之间会自动调用 flush()，但在其他操作系统（如 Windows）上，除非明确调用 <codeph class="+ topic/ph pr-d/codeph ">flush()</codeph>，否则不会发送数据。要确保应用程序在所有操作系统上都具有可靠的功能，在将每条消息（或相关数据组）写入套接字之后，最好调用 <codeph class="+ topic/ph pr-d/codeph ">flush()</codeph> 方法。</p>
	 
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readBoolean" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readBoolean</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取一个布尔值。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果所读取的字节不为零，则值为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，否则为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取一个布尔值。在读取一个字节之后，如果该字节不为零，则该方法返回 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，否则返回 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readByte" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readByte</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取一个带符号字节。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">从 -128 至 127 的值。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取一个带符号字节。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readBytes" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readBytes</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取 length 参数所指定的数据的字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">bytes</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.utils:ByteArray</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要将数据读入的 ByteArray 对象。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">offset</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">数据读取的偏移量应从该字节数组中开始。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">length</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要读取的字节数。默认值 0 导致读取所有可用的数据。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取 length 参数指定的数据字节数。从 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 所表示的位置开始，将这些字节读入指定的字节数组。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readDouble" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readDouble</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取一个 IEEE 754 双精度浮点数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 IEEE 754 双精度浮点数。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取一个 IEEE 754 双精度浮点数。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readFloat" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readFloat</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取一个 IEEE 754 单精度浮点数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 IEEE 754 单精度浮点数。
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取一个 IEEE 754 单精度浮点数。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readInt" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readInt</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取一个带符号的 32 位整数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">从 -2147483648 至 2147483647 的值。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取一个带符号的 32 位整数。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readMultiByte" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readMultiByte</apiName><shortdesc class="- topic/shortdesc ">
     使用指定的字符集，从该字节流读取一个多字节字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Socket, Socket.readMultiByte, readMultiByte
      
      </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">UTF-8 编码的字符串。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">length</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要从字节流中读取的字节数。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">charSet</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">表示用于解释字节的字符集的字符串。可能的字符集字符串包括 <codeph class="+ topic/ph pr-d/codeph ">"shift_jis"</codeph>、<codeph class="+ topic/ph pr-d/codeph ">"CN-GB"</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">"iso-8859-1"</codeph>。有关完整列表，请参阅<xref href="../../charset-codes.html" class="- topic/xref ">支持的字符集</xref>。
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果当前系统无法识别 <codeph class="+ topic/ph pr-d/codeph ">charSet</codeph> 参数的值，则应用程序将使用系统的默认代码页作为字符集。例如，<codeph class="+ topic/ph pr-d/codeph ">charSet</codeph> 参数的值（如在使用 <codeph class="+ topic/ph pr-d/codeph ">01</codeph> 而不是 <codeph class="+ topic/ph pr-d/codeph ">1</codeph> 的 <codeph class="+ topic/ph pr-d/codeph ">myTest.readMultiByte(22, "iso-8859-01")</codeph> 中）可能在您的开发计算机上起作用，但在其他计算机上可能不起作用。在其它计算机上，应用程序将使用系统的默认代码页。</p>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     使用指定的字符集，从该字节流读取一个多字节字符串。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readObject" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readObject</apiName><shortdesc class="- topic/shortdesc ">
     从以 AMF 序列化格式编码的套接字读取一个对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">反序列化的对象
     
     </apiDesc><apiType value="any" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从以 AMF 序列化格式编码的套接字读取一个对象。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#ObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding</linktext></link><link href="../../flash/net/package.html#registerClassAlias()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.registerClassAlias()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:readShort" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readShort</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取一个带符号的 16 位整数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">从 -32768 至 32767 的值。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取一个带符号的 16 位整数。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readUTFBytes" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readUTFBytes</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取 length 参数所指定的 UTF-8 数据的字节数，并返回一个字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">UTF-8 字符串。
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">length</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要读取的字节数。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取 <codeph class="+ topic/ph pr-d/codeph ">length</codeph> 参数所指定的 UTF-8 数据的字节数，并返回一个字符串。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readUTF" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readUTF</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取一个 UTF-8 字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">UTF-8 字符串。
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取一个 UTF-8 字符串。假定该字符串的前缀是表示字符串长度（以字节为单位）的无符号短整数。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readUnsignedByte" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readUnsignedByte</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取一个无符号字节。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">从 0 至 255 的值。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取一个无符号字节。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readUnsignedInt" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readUnsignedInt</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取一个无符号的 32 位整数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">从 0 至 4294967295 的值。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取一个无符号的 32 位整数。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:readUnsignedShort" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readUnsignedShort</apiName><shortdesc class="- topic/shortdesc ">
     从套接字读取一个无符号的 16 位整数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">从 0 至 65535 的值。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从套接字读取一个无符号的 16 位整数。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:Socket:writeBoolean" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeBoolean</apiName><shortdesc class="- topic/shortdesc ">
     将一个布尔值写入套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入套接字的值：1 (<codeph class="+ topic/ph pr-d/codeph ">true</codeph> ) 或 0 ( <codeph class="+ topic/ph pr-d/codeph ">false</codeph>)。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将一个布尔值写入套接字。此方法写入了一个字节，其值为 1 (<codeph class="+ topic/ph pr-d/codeph ">true</codeph> ) 或 0 ( <codeph class="+ topic/ph pr-d/codeph ">false</codeph>)。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeByte" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeByte</apiName><shortdesc class="- topic/shortdesc ">
     将一个字节写入套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入套接字的值。使用了该值的低 8 位；忽略了高 24 位。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将一个字节写入套接字。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeBytes" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeBytes</apiName><shortdesc class="- topic/shortdesc ">
     从指定的字节数组写入一系列字节。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 大于 <codeph class="+ topic/ph pr-d/codeph ">bytes</codeph> 指定的 ByteArray 长度；如果指定的要根据 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 加上 <codeph class="+ topic/ph pr-d/codeph ">length</codeph> 写入的数据量超出可用数据。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">bytes</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.utils:ByteArray</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要从中读取数据的 ByteArray 对象。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">offset</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc "><codeph class="+ topic/ph pr-d/codeph ">bytes</codeph> ByteArray 对象中从零开始的偏移量，应由此开始执行数据写入。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">length</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入的字节数。默认值 0 导致从 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 参数指定的值开始写入整个缓冲区。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从指定的字节数组写入一系列字节。写入操作从 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 指定的位置开始。
     
     <p class="- topic/p ">如果省略了 <codeph class="+ topic/ph pr-d/codeph ">length</codeph> 参数，则默认长度 0 将导致该方法从 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 开始写入整个缓冲区。</p>
     
     <p class="- topic/p ">如果还省略了 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 参数，则写入整个缓冲区。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeDouble" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeDouble</apiName><shortdesc class="- topic/shortdesc ">
     将一个 IEEE 754 双精度浮点数写入套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入套接字的值。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将一个 IEEE 754 双精度浮点数写入套接字。
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeFloat" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeFloat</apiName><shortdesc class="- topic/shortdesc ">
     将一个 IEEE 754 单精度浮点数写入套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入套接字的值。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将一个 IEEE 754 单精度浮点数写入套接字。
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeInt" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeInt</apiName><shortdesc class="- topic/shortdesc ">
     将一个带符号的 32 位整数写入套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入套接字的值。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将一个带符号的 32 位整数写入套接字。
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeMultiByte" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeMultiByte</apiName><shortdesc class="- topic/shortdesc ">
     使用指定的字符集，从该字节流写入一个多字节字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Socket, Socket.writeMultiByte, writeMultiByte
      
      </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入的字符串值。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">charSet</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">表示用于解释字节的字符集的字符串。可能的字符集字符串包括 <codeph class="+ topic/ph pr-d/codeph ">"shift_jis"</codeph>、<codeph class="+ topic/ph pr-d/codeph ">"CN-GB"</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">"iso-8859-1"</codeph>。有关完整列表，请参阅<xref href="../../charset-codes.html" class="- topic/xref ">支持的字符集</xref>。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     使用指定的字符集，从该字节流写入一个多字节字符串。
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeObject" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeObject</apiName><shortdesc class="- topic/shortdesc ">
     以 AMF 序列化格式将一个对象写入套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">object</apiItemName><apiType value="any" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要进行序列化处理的对象。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     以 AMF 序列化格式将一个对象写入套接字。
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link><link href="flash.net.xml#ObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding</linktext></link><link href="../../flash/net/package.html#registerClassAlias()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.registerClassAlias()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeShort" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeShort</apiName><shortdesc class="- topic/shortdesc ">
     将一个 16 位整数写入套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入套接字的值。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将一个 16 位整数写入套接字。写入的字节如下：
     
     <pre xml:space="preserve" class="- topic/pre "><codeph class="+ topic/ph pr-d/codeph ">(v >> 8) &amp; 0xff v &amp; 0xff</codeph></pre>
     
     <p class="- topic/p ">使用了该参数的低 16 位；忽略了高 16 位。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeUTFBytes" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeUTFBytes</apiName><shortdesc class="- topic/shortdesc ">
     将一个 UTF-8 字符串写入套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入套接字的字符串。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将一个 UTF-8 字符串写入套接字。
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeUTF" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeUTF</apiName><shortdesc class="- topic/shortdesc ">
     将以下数据写入套接字：一个无符号 16 位整数，它表示了指定 UTF-8 字符串的长度（以字节为单位），后面跟随字符串本身。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">长度大于 65535。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入套接字的字符串。
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将以下数据写入套接字：一个无符号 16 位整数，它表示了指定 UTF-8 字符串的长度（以字节为单位），后面跟随字符串本身。
     
     <p class="- topic/p ">写入字符串之前，该方法会计算表示该字符串的所有字符所需的字节数。</p>
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:Socket:writeUnsignedInt" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeUnsignedInt</apiName><shortdesc class="- topic/shortdesc ">
     将一个无符号的 32 位整数写入套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">套接字上发生 I/O 错误，或者套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入套接字的值。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将一个无符号的 32 位整数写入套接字。
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link></related-links></apiOperation><apiValue id="flash.net:Socket:bytesAvailable:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesAvailable</apiName><shortdesc class="- topic/shortdesc ">
     输入缓冲区中可读取的数据的字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     输入缓冲区中可读取的数据的字节数。
     
     <p class="- topic/p ">代码必须访问 <codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 以确保在尝试使用其中一种 <codeph class="+ topic/ph pr-d/codeph ">read</codeph> 方法读取数据之前，有足够的数据可用。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:Socket:connected:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">connected</apiName><shortdesc class="- topic/shortdesc ">
     表示此 Socket 对象目前是否已连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示此 Socket 对象目前是否已连接。如果该套接字当前已连接，则对此属性的调用将返回值 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，否则将返回 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:Socket:endian:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">endian</apiName><shortdesc class="- topic/shortdesc ">
     表示数据的字节顺序。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiDefaultValue>Endian.BIG_ENDIAN
     </apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示数据的字节顺序。可能的值为来自 flash.utils.Endian 类的常量、<codeph class="+ topic/ph pr-d/codeph ">Endian.BIG_ENDIAN</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">Endian.LITTLE_ENDIAN</codeph>。
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.utils.xml#Endian" class="- topic/link "><linktext class="- topic/linktext ">flash.utils.Endian</linktext></link></related-links></apiValue><apiValue id="flash.net:Socket:localAddress:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">localAddress</apiName><shortdesc class="- topic/shortdesc ">
     本地计算机上此套接字绑定到的 IP 地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     本地计算机上此套接字绑定到的 IP 地址。

     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/bind()" class="- topic/link "><linktext class="- topic/linktext ">bind()</linktext></link></related-links></apiValue><apiValue id="flash.net:Socket:localPort:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">localPort</apiName><shortdesc class="- topic/shortdesc ">
     本地计算机上此套接字绑定到的端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     本地计算机上此套接字绑定到的端口。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/bind()" class="- topic/link "><linktext class="- topic/linktext ">bind()</linktext></link></related-links></apiValue><apiValue id="flash.net:Socket:objectEncoding:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">objectEncoding</apiName><shortdesc class="- topic/shortdesc ">
     在写入或读取对象时，控制所使用的 AMF 的版本。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Property documented; needs review
     </internal></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在写入或读取对象时，控制所使用的 AMF 的版本。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#ObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding 类</linktext></link><link href="flash.net.xml#Socket/readObject()" class="- topic/link "><linktext class="- topic/linktext ">readObject()</linktext></link><link href="flash.net.xml#Socket/writeObject()" class="- topic/link "><linktext class="- topic/linktext ">writeObject()</linktext></link></related-links></apiValue><apiValue id="flash.net:Socket:remoteAddress:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">remoteAddress</apiName><shortdesc class="- topic/shortdesc ">
     此套接字连接到的远程计算机的 IP 地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此套接字连接到的远程计算机的 IP 地址。
     
     <p class="- topic/p ">您可以使用此属性确定 ServerSocketConnectEvent 中由 ServerSocket 对象调度的客户端套接字的 IP 地址。如果需要，使用 DNSResolver 类将 IP 地址转换为域名。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/connect()" class="- topic/link "><linktext class="- topic/linktext ">connect()</linktext></link><link href="flash.net.xml#ServerSocket" class="- topic/link "><linktext class="- topic/linktext ">ServerSocket</linktext></link><link href="flash.events.xml#ServerSocketConnectEvent" class="- topic/link "><linktext class="- topic/linktext ">ServerSocketConnectEvent</linktext></link><link href="flash.net.dns.xml#DNSResolver" class="- topic/link "><linktext class="- topic/linktext ">DNSResolver</linktext></link></related-links></apiValue><apiValue id="flash.net:Socket:remotePort:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">remotePort</apiName><shortdesc class="- topic/shortdesc ">
     此套接字连接到的远程计算机的端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此套接字连接到的远程计算机的端口。
     
     <p class="- topic/p ">您可以使用此属性确定 ServerSocketConnectEvent 中由 ServerSocket 对象调度的客户端套接字的端口号。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket/connect()" class="- topic/link "><linktext class="- topic/linktext ">connect()</linktext></link><link href="flash.net.xml#ServerSocket" class="- topic/link "><linktext class="- topic/linktext ">ServerSocket</linktext></link><link href="flash.events.xml#ServerSocketConnectEvent" class="- topic/link "><linktext class="- topic/linktext ">ServerSocketConnectEvent</linktext></link></related-links></apiValue><apiValue id="flash.net:Socket:timeout:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">timeout</apiName><shortdesc class="- topic/shortdesc ">
     表示建立连接时需等待的毫秒数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示建立连接时需等待的毫秒数。
     
     <p class="- topic/p ">如果在指定时间内未成功建立连接，则连接失败。默认值是 20,000（20 秒）。</p>
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:ObjectEncoding" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">ObjectEncoding</apiName><shortdesc class="- topic/shortdesc ">
 ObjectEncoding 类用于在对对象进行序列化的类（例如，FileStream、NetStream、NetConnection、SharedObject 和 ByteArray）中定义序列化设置，以便与 ActionScript 的以前版本一起使用。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">ObjectEncoding, ObjectEncoding object, built-in class, AMF, Action Message Format
 
  </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 ObjectEncoding 类用于在对对象进行序列化的类（例如，FileStream、NetStream、NetConnection、SharedObject 和 ByteArray）中定义序列化设置，以便与 ActionScript 的以前版本一起使用。
 
 <p class="- topic/p ">对象编码用于控制如何以 Action Message Format (AMF) 表示对象。Flash Player 使用 AMF 来启用应用程序和远程服务器之间的高效通信。AMF 将远程过程调用编码为一种紧凑的二进制表示形式，这种表示形式可以通过 HTTP/HTTPS 协议或 Flash Media Server 使用的 RTMP/RTMPS 协议进行传输。对象和数据值将被序列化为这种二进制格式，这种格式通常比其他表示形式（例如 XML）紧凑。</p>
 
 <p class="- topic/p ">Adobe AIR 和 Flash Player 9 提供两种不同的序列化格式：AMF3 和 AMF0。AMF3 是为 ActionScript 3.0 开发的默认序列化格式，与用于 ActionScript 1.0 和 2.0 的 AMF0 相比，AMF3 具有多种优点。AMF3 通过网络发送数据比 AMF0 更高效。<ph class="- topic/ph ">AMF3 支持将 <codeph class="+ topic/ph pr-d/codeph ">int</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">uint</codeph> 对象作为整型发送出去，并支持只可在 ActionScript 3.0 中使用的数据类型，例如 ByteArray、XML 和 IExternalizable。AMF3 只能在 ActionScript 3.0 和使用 AMF3 编码的服务器（例如 Flex 2）中使用。</ph></p>
 
 <p class="- topic/p ">ByteArray、FileStream、NetConnection、NetStream、<ph class="- topic/ph ">SharedObject、</ph>Socket 和 URLStream 类均包含一个 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性，为该属性分配的常量来自 ObjectEncoding 类。<codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性的行为因对象而异；每个类的 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性描述更加全面地说明了其行为。</p>
 
 
 </apiDesc></apiClassifierDetail><apiValue id="flash.net:ObjectEncoding:AMF0" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">AMF0</apiName><shortdesc class="- topic/shortdesc ">
	 指定使用 ActionScript 1.0 和 2.0 的 Action Message Format 来序列化对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定使用 ActionScript 1.0 和 2.0 的 Action Message Format 来序列化对象。
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:ObjectEncoding:AMF3" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">AMF3</apiName><shortdesc class="- topic/shortdesc ">
	 指定使用 ActionScript 3.0 的 Action Message Format 来序列化对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">3</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定使用 ActionScript 3.0 的 Action Message Format 来序列化对象。
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:ObjectEncoding:DEFAULT" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">DEFAULT</apiName><shortdesc class="- topic/shortdesc ">
	 为当前运行时（Flash Player 或 AIR）指定默认（最新）格式。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">3</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 为当前运行时（Flash Player 或 AIR）指定默认（最新）格式。由于对象编码控件仅在 Flash Player 9 和更高版本以及 Adobe AIR 中提供，因而使用的最早格式是用于 ActionScript 3.0 的 Action Message Format。
	 
	 <p class="- topic/p ">例如，如果某个对象的 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.DEFAULT</codeph>，则将使用 AMF3 编码。以后，如果更高版本的 Flash Player 或 Adobe AIR 引入了新版 AMF，并且您重新发布了内容，则应用程序将使用此新版 AMF。仅当您毫不担心新版与旧版之间的互操作性时才能使用此常数。</p>
     
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:ObjectEncoding:dynamicPropertyWriter:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">dynamicPropertyWriter</apiName><shortdesc class="- topic/shortdesc ">
	 允许对动态对象的动态属性的序列化进行更大程度的控制。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.net:IDynamicPropertyWriter</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 允许对动态对象的动态属性的序列化进行更大程度的控制。当将此属性设为默认值 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 时，将使用本机代码序列化动态属性，这将写入除值为函数以外的所有动态属性。
     <p class="- topic/p ">仅对动态对象（在动态类中声明的对象）或使用 <codeph class="+ topic/ph pr-d/codeph ">new</codeph> 运算符声明的对象的属性调用该值。</p>
	 
	 <p class="- topic/p ">可以使用此属性将动态对象的属性排除在序列化之外，将值写入动态对象的属性中或为动态对象创建新属性。为此，请将此属性设置为实现 IDynamicPropertyWriter 接口的对象。有关详细信息，请参阅 IDynamicPropertyWriter 接口。</p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#IDynamicPropertyWriter" class="- topic/link "><linktext class="- topic/linktext ">IDynamicPropertyWriter</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetStreamAppendBytesAction" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetStreamAppendBytesAction</apiName><shortdesc class="- topic/shortdesc ">

NetStreamAppendBytesAction 类是可以传递给 NetStream.appendBytesAction() 方法的常量的枚举。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">

NetStreamAppendBytesAction 类是可以传递给 <codeph class="+ topic/ph pr-d/codeph ">NetStream.appendBytesAction()</codeph> 方法的常量的枚举。

<p class="- topic/p ">其中两个常量表示时间刻度不连续。每个 FLV 标签都有一个表示其在时间刻度中位置的时间戳。时间戳用于同步视频、音频和脚本数据播放。同一类型（视频、音频、脚本数据）的 FLV 标签的时间戳不得在 FLV 播放时减小。</p>

</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/appendBytesAction()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.appendBytesAction()</linktext></link><link href="flash.net.xml#NetStream/appendBytes()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.appendBytes()</linktext></link></related-links><apiValue id="flash.net:NetStreamAppendBytesAction:END_SEQUENCE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">END_SEQUENCE</apiName><shortdesc class="- topic/shortdesc ">
    表示媒体流数据是完整的。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">endSequence</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    表示媒体流数据是完整的。对于某些编解码器，如 H.264，字节分析程序会等待缓冲区填充某个点后才开始播放。传递 <codeph class="+ topic/ph pr-d/codeph ">END_SEQUENCE</codeph> 以通知字节分析程序立即开始播放。
    
    
    </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamAppendBytesAction:RESET_BEGIN" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">RESET_BEGIN</apiName><shortdesc class="- topic/shortdesc ">
    
    表示时间刻度不连续。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">resetBegin</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    
    表示时间刻度不连续。刷新 FIFO（由不完整的 FLV 标签组成），并将时间刻度重置为从下一个追加消息的时间戳开始。在下次调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 时，字节分析程序将需要分析文件标头，并从文件的开头开始。
    
    
    </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamAppendBytesAction:RESET_SEEK" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">RESET_SEEK</apiName><shortdesc class="- topic/shortdesc ">
    表示时间刻度不连续。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">resetSeek</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    表示时间刻度不连续。刷新 FIFO（由不完整的 FLV 标签组成），并将时间刻度重置为从下一个追加消息的时间戳开始。在下次调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 时，字节分析程序将需要分析 FLV 标签的开头，尽管您刚刚在标签边界上的同一 FLV 中搜索过某个位置。
    
    
    </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetGroupReplicationStrategy" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetGroupReplicationStrategy</apiName><shortdesc class="- topic/shortdesc ">
NetGroupReplicationStrategy 类是常量值的枚举，用于设置 NetGroup 类的 replicationStrategy 属性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">用于设置 NetGroup 类的 replicationStrategy 属性的常量值的枚举。
</apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
NetGroupReplicationStrategy 类是在设置 <codeph class="+ topic/ph pr-d/codeph ">NetGroup</codeph> 类的 <codeph class="+ topic/ph pr-d/codeph ">replicationStrategy</codeph> 属性时使用的常量值的枚举。

</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addWantObjects()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.addWantObjects()</linktext></link><link href="flash.net.xml#NetGroup/replicationStrategy" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.replicationStrategy</linktext></link></related-links><apiValue id="flash.net:NetGroupReplicationStrategy:LOWEST_FIRST" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">LOWEST_FIRST</apiName><shortdesc class="- topic/shortdesc "> 
    指定当从邻居获取对象以满足需求时，首先请求具有最低索引编号的对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">lowestFirst</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
    指定当从邻居获取对象以满足需求时，首先请求具有最低索引编号的对象。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addWantObjects()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.addWantObjects()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroupReplicationStrategy:RAREST_FIRST" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">RAREST_FIRST</apiName><shortdesc class="- topic/shortdesc "> 
    指定当从邻居获取对象以满足需求时，首先请求所有邻居中具有最少副本的对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">rarestFirst</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
    指定当从邻居获取对象以满足需求时，首先请求所有邻居中具有最少副本的对象。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addWantObjects()" class="- topic/link "><linktext class="- topic/linktext ">NetGroup.addWantObjects()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:URLLoader" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">URLLoader</apiName><shortdesc class="- topic/shortdesc ">
 URLLoader 类以文本、二进制数据或 URL 编码变量的形式从 URL 下载数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 URLLoader 类以文本、二进制数据或 URL 编码变量的形式从 URL 下载数据。在下载文本文件、XML 或其他用于动态数据驱动应用程序的信息时，它很有用。
 
 <p class="- topic/p ">URLLoader 对象会先从 URL 中下载所有数据，然后才将数据用于应用程序中的代码。它会发出有关下载进度的通知，通过 <codeph class="+ topic/ph pr-d/codeph ">bytesLoaded</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">bytesTotal</codeph> 属性以及已调度的事件，可以监视下载进度。</p>
 
 <p class="- topic/p ">在加载非常大的视频文件（如 FLV 的视频文件）时，可能会出现内存不足错误。
 </p>
 

 
 <p class="- topic/p ">当在应用程序安全沙箱以外的安全沙箱中的 <ph class="- topic/ph ">Flash Player</ph> 和 AIR 应用程序内容中使用此类时，请考虑以下安全模型：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">只能与本地文件系统内容交互的沙箱中的 SWF 文件无法加载网络沙箱中的资源所包含的数据，也无法为该资源提供数据。 </li><li class="- topic/li "> 默认情况下，执行调用的 SWF 文件和加载的 URL 必须在同一域中。例如，位于 www.adobe.com 的 SWF 文件只能从同样位于 www.adobe.com 的源中加载数据。要从不同的域中加载数据，请在承载数据的服务器上放置一个 URL 策略文件。</li></ul>
 
 <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
 
 
 </apiDesc><example conref="examples\URLLoaderExample.as" class="- topic/example "> 下例加载并显示在本地文本文件中找到的数据。它还会跟踪事件处理信息。
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>要运行此示例，请将名为 urlLoaderExample.txt 的文件与 SWF 文件放在同一目录下。该文件应仅包含以下文本行：<codeph class="+ topic/ph pr-d/codeph ">answer=42&amp;question=unknown</codeph>
 </p>
 <p class="- topic/p ">该示例代码执行以下操作：</p>
 <ol class="- topic/ol "><li class="- topic/li ">该构造函数创建名为 <codeph class="+ topic/ph pr-d/codeph ">loader</codeph> 的 URLLoader 实例和名为 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> URLRequest 的实例，后者包含要加载的文件的位置和名称。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">loader</codeph> 对象被传递给 <codeph class="+ topic/ph pr-d/codeph ">configureListeners()</codeph> 方法，该方法可为每个受支持的 URLLoader 事件添加侦听器。</li><li class="- topic/li ">然后，<codeph class="+ topic/ph pr-d/codeph ">request</codeph> 对象被传递给 <codeph class="+ topic/ph pr-d/codeph ">loader.load()</codeph>，该方法可加载文本文件。</li><li class="- topic/li ">当 URLLoader 完成文本文件的加载时，将引发 <codeph class="+ topic/ph pr-d/codeph ">Event.COMPLETE event</codeph>，同时触发 <codeph class="+ topic/ph pr-d/codeph ">completeHandler()</codeph> 方法。<codeph class="+ topic/ph pr-d/codeph ">completeHandler()</codeph> 方法通过从该文件中加载的文本创建 URLVariables 对象。URLVariables 对象将 URL 编码的名称/值对转换成 ActionScript 属性，从而更便于处理加载的数据。</li></ol>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#URLRequest" class="- topic/link "><linktext class="- topic/linktext ">URLRequest</linktext></link><link href="flash.net.xml#URLVariables" class="- topic/link "><linktext class="- topic/linktext ">URLVariables</linktext></link><link href="flash.net.xml#URLStream" class="- topic/link "><linktext class="- topic/linktext ">URLStream</linktext></link></related-links><adobeApiEvent id="flash.net:URLLoader_flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS_httpResponseStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpResponseStatus</apiName><shortdesc class="- topic/shortdesc ">
 当对 load() 方法的调用尝试通过 HTTP 访问数据，并且 Adobe AIR 可以检测并返回请求的状态代码时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当对 load() 方法的调用尝试通过 HTTP 访问数据，并且 Adobe AIR 可以检测并返回请求的状态代码时调度。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoader/load()" class="- topic/link "><linktext class="- topic/linktext ">load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.HTTPStatusEvent.HTTP_STATUS_httpStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpStatus</apiName><shortdesc class="- topic/shortdesc ">
 在 URLLoader.load() 方法调用尝试通过 HTTP 访问数据时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.HTTPStatusEvent.HTTP_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当对 URLLoader.load() 的调用尝试通过 HTTP 访问数据时调度。<ph class="- topic/ph ">对于在 Flash Player 中运行的内容，只有当前 Flash Player 环境能够检测并返回请求的状态代码时，才能调度此事件。（有些浏览器环境可能无法提供此信息。）</ph>请注意：在发送任何 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">error</codeph> 事件之前还将发送 <codeph class="+ topic/ph pr-d/codeph ">httpStatus</codeph> 事件（如果有）。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoader/load()" class="- topic/link "><linktext class="- topic/linktext ">URLLoader.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><shortdesc class="- topic/shortdesc ">
 若对 URLLoader.load() 的调用尝试从安全沙箱外部的服务器加载数据，则进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 若对 URLLoader.load() 的调用尝试从安全沙箱外部的服务器加载数据，则进行调度。在对 <codeph class="+ topic/ph pr-d/codeph ">URLLoader.load()</codeph> 的调用尝试加载 SWZ 文件而证书无效或摘要字符串与组件不匹配时也会调度。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoader/load()" class="- topic/link "><linktext class="- topic/linktext ">URLLoader.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.IOErrorEvent.IO_ERROR_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><shortdesc class="- topic/shortdesc ">
 若对 URLLoader.load() 的调用导致致命错误并因此终止了下载，则进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 若对 URLLoader.load() 的调用导致致命错误并因此终止了下载，则进行调度。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoader/load()" class="- topic/link "><linktext class="- topic/linktext ">URLLoader.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.ProgressEvent.PROGRESS_progress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">progress</apiName><shortdesc class="- topic/shortdesc ">
 在下载操作过程中收到数据时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.ProgressEvent.PROGRESS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在下载操作过程中收到数据时调度。
 
 <p class="- topic/p ">请注意，对于 URLLoader 对象，在完全接收数据前无法访问该数据。因此，该 progress 事件仅用作有关下载进展的通知。要在完整下载前访问该数据，请使用 URLStream 对象。 </p>
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoader/load()" class="- topic/link "><linktext class="- topic/linktext ">URLLoader.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.Event.COMPLETE_complete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">complete</apiName><shortdesc class="- topic/shortdesc ">
 在对所有已接收数据进行解码并将其放在 URLLoader 对象的 data 属性中以后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.COMPLETE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在对所有已接收数据进行解码并将其放在 URLLoader 对象的 data 属性中以后调度。调度该事件后，可以访问已接收的数据。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoader/load()" class="- topic/link "><linktext class="- topic/linktext ">URLLoader.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader_flash.events.Event.OPEN_open" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><shortdesc class="- topic/shortdesc ">
 在调用 URLLoader.load() 方法之后开始下载操作时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.OPEN</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">当下载操作开始时进行调度。
 </apiTipText></apiTipTexts></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在调用 <codeph class="+ topic/ph pr-d/codeph ">URLLoader.load()</codeph> 方法和开始下载操作时调度。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoader/load()" class="- topic/link "><linktext class="- topic/linktext ">URLLoader.load()</linktext></link></related-links></adobeApiEvent><apiConstructor id="flash.net:URLLoader:URLLoader" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">URLLoader</apiName><shortdesc class="- topic/shortdesc ">
     创建 URLLoader 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">request</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:URLRequest</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 URLRequest 对象，指定要下载的 URL。如果省略该参数，则不开始加载操作。如果已指定参数，则立即开始加载操作（有关详细信息，请参阅 <codeph class="+ topic/ph pr-d/codeph ">load</codeph> 条目）。
     
     </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建 URLLoader 对象。
     
     </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoader/load()" class="- topic/link "><linktext class="- topic/linktext ">URLLoader.load()</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:URLLoader:addEventListener" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">addEventListener</apiName><shortdesc class="- topic/shortdesc ">
    
	使用 EventDispatcher 对象注册事件侦听器对象，以使侦听器能够接收事件通知。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiIsOverride class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiIsOverride "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">type</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">事件的类型。
	
	</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">listener</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Function</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">处理事件的侦听器函数。此函数必须接受 Event 对象作为其唯一的参数，并且不能返回任何结果<ph class="- topic/ph ">，如下面的示例所示：</ph>
	
	
    <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">function(evt:Event):void</codeblock>
	
	<p class="- topic/p ">函数可以有任何名称。</p>
	
	</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">useCapture</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	
	<ph class="- topic/ph ">确定侦听器是运行于捕获阶段还是运行于目标和冒泡阶段。如果将 <codeph class="+ topic/ph pr-d/codeph ">useCapture</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则侦听器只在捕获阶段处理事件，而不在目标或冒泡阶段处理事件。如果 <codeph class="+ topic/ph pr-d/codeph ">useCapture</codeph> 为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>，则侦听器只在目标或冒泡阶段处理事件。要在所有三个阶段都侦听事件，请调用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener</codeph> 两次：一次将 <codeph class="+ topic/ph pr-d/codeph ">useCapture</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，一次将 <codeph class="+ topic/ph pr-d/codeph ">useCapture</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。</ph>
	
	</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">priority</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">事件侦听器的优先级。优先级由一个带符号的 32 位整数指定。数字越大，优先级越高。优先级为 <i class="+ topic/ph hi-d/i ">n</i> 的所有侦听器会在优先级为 <i class="+ topic/ph hi-d/i ">n</i> -1 的侦听器之前得到处理。如果两个或更多个侦听器共享相同的优先级，则按照它们的添加顺序进行处理。默认优先级为 0。
	
	</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">useWeakReference</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">确定对侦听器的引用是强引用，还是弱引用。强引用（默认值）可防止您的侦听器被当作垃圾回收。弱引用则没有此作用。 <p class="- topic/p ">类级别成员函数不属于垃圾回收的对象，因此可以对类级别成员函数将 <codeph class="+ topic/ph pr-d/codeph ">useWeakReference</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 而不会使它们受垃圾回收的影响。如果对作为嵌套内部函数的侦听器将 <codeph class="+ topic/ph pr-d/codeph ">useWeakReference</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则该函数将作为垃圾回收并且不再是永久函数。如果创建对该内部函数的引用（将该函数保存到另一个变量中），则该函数将不作为垃圾回收并仍将保持永久。</p>
	
	</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    
	使用 EventDispatcher 对象注册事件侦听器对象，以使侦听器能够接收事件通知。<ph class="- topic/ph ">可以为特定类型的事件、阶段和优先级在显示列表中的所有节点上注册事件侦听器。</ph>
	
	
	
	<p class="- topic/p ">成功注册一个事件侦听器后，无法通过额外调用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 来更改其优先级。要更改侦听器的优先级，必须首先调用 <codeph class="+ topic/ph pr-d/codeph ">removeListener()</codeph>。然后，可以使用新的优先级再次注册该侦听器。 </p>
	
	<p class="- topic/p ">请记住，注册该侦听器后，如果继续调用具有不同 <codeph class="+ topic/ph pr-d/codeph ">type</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">useCapture</codeph> 值的 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph>，则会创建单独的侦听器注册。<ph class="- topic/ph ">例如，如果首先注册 <codeph class="+ topic/ph pr-d/codeph ">useCapture</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 的侦听器，则该侦听器只在捕获阶段进行侦听。如果使用同一个侦听器对象再次调用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph>，并将 <codeph class="+ topic/ph pr-d/codeph ">useCapture</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>，那么便会拥有两个单独的侦听器：一个在捕获阶段进行侦听，另一个在目标和冒泡阶段进行侦听。</ph>
	</p>
	
	<p class="- topic/p ">不能只为目标阶段或冒泡阶段注册事件侦听器。这些阶段在注册期间是成对出现的，因为冒泡阶段只适用于目标节点的始祖。</p>
	
	<p class="- topic/p ">如果不再需要某个事件侦听器，可调用 <codeph class="+ topic/ph pr-d/codeph ">removeEventListener()</codeph> 删除它，否则会产生内存问题。事件侦听器不会自动从内存中删除，因为只要调度对象存在，垃圾回收器就不会删除侦听器（除非 <codeph class="+ topic/ph pr-d/codeph ">useWeakReference</codeph> 参数设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>）。</p>
		
	<p class="- topic/p ">复制 EventDispatcher 实例时并不复制其中附加的事件侦听器。（如果新近创建的节点需要一个事件侦听器，必须在创建该节点后附加该侦听器。）但是，如果移动 EventDispatcher 实例，则其中附加的事件侦听器也会随之移动。</p>
	
	
	<p class="- topic/p ">如果在正在处理事件的节点上注册事件侦听器，则不会在当前阶段触发事件侦听器，但会在事件流的稍后阶段触发，如冒泡阶段。</p>
	
	<p class="- topic/p ">如果从正在处理事件的节点中删除事件侦听器，则该事件侦听器仍由当前操作触发。删除事件侦听器后，决不会再次调用该事件侦听器（除非再次注册以备将来处理）。 </p>
	
	</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLLoader:close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     关闭进行中的加载操作。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     关闭进行中的加载操作。任何正在进行中的加载操作将立即终止。如果当前未对 URL 进行流式处理，将引发无效流错误。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLLoader:load" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">load</apiName><shortdesc class="- topic/shortdesc ">
     从指定的 URL 发送和加载数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><codeph class="+ topic/ph pr-d/codeph ">URLRequest.requestHeader</codeph> 对象不能包含某些被禁用的 HTTP 请求标头。有关详细信息，请参阅 URLRequestHeader 类的描述。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">发生此错误的原因有：1) <ph class="- topic/ph ">Flash Player 或</ph> AIR 无法将 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.data</codeph> 参数从 UTF8 转换为 MBCS。若传递给 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 的 URLRequest 对象设置为执行 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 操作并且 <codeph class="+ topic/ph pr-d/codeph ">System.useCodePage</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，就会发生该错误。2) <ph class="- topic/ph ">Flash Player 或</ph> AIR 无法为 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 数据分配内存。如果传递给 <codeph class="+ topic/ph pr-d/codeph ">load</codeph> 的 URLRequest 对象设置为执行 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 操作，将发生该错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">MemoryError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:MemoryError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">本地不受信任的 文件可能无法与 Internet 进行通信。可通过将此 文件重新分类为只能与远程内容交互或受信任来解决此问题。
     
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">正在尝试连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">所传递的请求参数值或 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.url</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">TypeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">TypeError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">request</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:URLRequest</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 URLRequest 对象，指定要下载的 URL。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从指定的 URL 发送和加载数据。可以以文本、原始二进制数据或 URL 编码变量格式接收数据，这取决于为 <codeph class="+ topic/ph pr-d/codeph ">dataFormat</codeph> 属性所设置的值。请注意 <codeph class="+ topic/ph pr-d/codeph ">dataFormat</codeph> 属性的默认值为文本。如果想将数据发送至指定的 URL，则可以在 URLRequest 对象中设置 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性。
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果要加载的文件包含非 ASCII 字符（在许多非英语的语言中出现），则建议使用 UTF-8 或 UTF-16 编码（而不是 ASCII 等非 Unicode 格式）来保存文件。</p>
     
     <p class="- topic/p "> 只能与本地文件系统内容交互的沙箱中的 SWF 文件无法加载网络沙箱中的资源所包含的数据，也无法为该资源提供数据。</p>
     
     <p class="- topic/p "> 默认情况下，执行调用的 SWF 文件和加载的 URL 必须在同一域中。例如，位于 www.adobe.com 的 SWF 文件只能从同样位于 www.adobe.com 的源中加载数据。要从不同的域中加载数据，请在承载数据的服务器上放置一个 URL 策略文件。</p>
     
     <p class="- topic/p ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。</p>
     
     <p class="- topic/p "> 在 Flash Player 10 和更高版本中，如果使用包含上载（由 POST 体内的“content-disposition”标头中的“filename”参数表示）的 multipart Content-Type（例如“multipart/form-data”），则 POST 操作会受应用于上载的安全规则的约束：</p>
     <ul class="- topic/ul "><li class="- topic/li ">必须执行 POST 操作以响应用户启动的操作（如鼠标单击或按键）。</li><li class="- topic/li ">如果 POST 操作是跨域的（POST 目标与发送 POST 请求的 SWF 文件不在同一台服务器上），则目标服务器必须提供一个允许跨域访问的 URL 策略文件。</li></ul>
     <p class="- topic/p ">另外，对于任何 multipart Content-Type，语法必须有效（根据 RFC2046 标准）。如果语法无效，则 POST 操作受应用于上载的安全规则约束。</p>
     
     <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
     
     
     </apiDesc><example conref="examples\URLLoader_loadExample.as" class="- topic/example "> 在下面的示例中，加载了一个 XML 文件，并在文本字段中显示其元素的第一个参数的内容。
 
 <p class="- topic/p ">将创建一个用于指定 XML 文件位置的 <codeph class="+ topic/ph pr-d/codeph ">URLRequest</codeph> 对象，就本示例而言，该文件与 SWF 文件位于同一个目录中。将在 <codeph class="+ topic/ph pr-d/codeph ">try...catch</codeph> 块中加载该文件，以便捕获可能发生的任何错误。（此处，我们捕获了 <codeph class="+ topic/ph pr-d/codeph ">SecurityError</codeph> 错误。） 如果发生 <codeph class="+ topic/ph pr-d/codeph ">IO_ERROR</codeph> 事件，则会调用 <codeph class="+ topic/ph pr-d/codeph ">errorHandler()</codeph> 方法，它在 <codeph class="+ topic/ph pr-d/codeph ">xmlTextField</codeph> 文本字段中写入一条错误消息。在收到 XML 文件数据并将其放在 <codeph class="+ topic/ph pr-d/codeph ">loader</codeph> URLLoader 对象的 data 属性中后，将调度 <codeph class="+ topic/ph pr-d/codeph ">Event.COMPLETE</codeph> 事件并调用 <codeph class="+ topic/ph pr-d/codeph ">loaderCompleteHandler()</codeph> 方法。</p>
 
 <p class="- topic/p ">在 <codeph class="+ topic/ph pr-d/codeph ">loaderCompleteHandler()</codeph> 方法中，使用 <codeph class="+ topic/ph pr-d/codeph ">try...catch</codeph> 块来捕获将从文件中加载的数据转换为 XML 对象时可能发生的任何分析错误。<codeph class="+ topic/ph pr-d/codeph ">readNodes()</codeph> 方法随后以递归方式查看 XML 文档节点中的所有元素，并在 <codeph class="+ topic/ph pr-d/codeph ">xmlTextField</codeph> 文本字段中附加所有元素的第一个属性的列表。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#URLRequestHeader" class="- topic/link "><linktext class="- topic/linktext ">URLRequestHeader</linktext></link><link href="flash.net.xml#URLRequest/requestHeaders" class="- topic/link "><linktext class="- topic/linktext ">URLRequest.requestHeaders</linktext></link><link href="flash.net.xml#URLRequest/data" class="- topic/link "><linktext class="- topic/linktext ">URLRequest.data</linktext></link><link href="flash.net.xml#URLRequest/digest" class="- topic/link "><linktext class="- topic/linktext ">URLRequest.digest</linktext></link></related-links><adobeApiEvent id="flash.net:URLLoader:load_complete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">complete</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在成功加载数据后调度。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在成功加载数据后调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_httpStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpStatus</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果通过 HTTP 进行访问，并且当前 Flash Player 环境支持获得状态代码，则除了 <codeph class="+ topic/ph pr-d/codeph ">complete </codeph>或 <codeph class="+ topic/ph pr-d/codeph ">error </codeph>事件，还可以接收到这些事件。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">如果通过 HTTP 进行访问，并且当前 Flash Player 环境支持获得状态代码，则除了 complete 或 error 事件，还可以接收到这些事件。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法完成加载操作。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">无法完成加载操作。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_progress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">progress</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在下载操作过程中收到数据时调度。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在下载操作过程中收到数据时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">加载操作尝试从调用方安全沙箱外部的服务器检索数据。可以通过在服务器上使用策略文件来解决此问题。
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">加载操作尝试从调用方安全沙箱外部的服务器检索数据。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">加载操作尝试加载 SWZ 文件（一个 Adobe 平台组件），但是证书无效或摘要与组件不匹配。
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">加载操作尝试加载 SWZ 文件（一个 Adobe 平台组件），但是证书无效或摘要与组件不匹配。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_open" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在加载操作开始时调度。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在加载操作开始时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLLoader:load_httpResponseStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpResponseStatus</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在对 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法的调用试图通过 HTTP 访问数据，并且 Adobe AIR 可以检测并返回请求的状态代码时调度。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在对 load() 方法的调用试图通过 HTTP 访问数据，并且 Adobe AIR 可以检测并返回请求的状态代码时调度。</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.net:URLLoader:bytesLoaded" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesLoaded</apiName><shortdesc class="- topic/shortdesc ">
     表示加载操作期间到目前为止加载的字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示加载操作期间到目前为止加载的字节数。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLLoader:bytesTotal" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesTotal</apiName><shortdesc class="- topic/shortdesc ">
     表示所下载数据中的字节总数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示所下载数据中的字节总数。正在进行加载操作时该属性包含 0，完成操作时会填充该属性。另外，丢失的 Content-Length 标题将会导致 bytesTotal 不确定。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLLoader:dataFormat" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">dataFormat</apiName><shortdesc class="- topic/shortdesc ">
     控制是以文本 (URLLoaderDataFormat.TEXT)、原始二进制数据 (URLLoaderDataFormat.BINARY) 还是 URL 编码变量 (URLLoaderDataFormat.VARIABLES) 形式接收下载的数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">text</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiDefaultValue>URLLoaderDataFormat.TEXT
     </apiDefaultValue><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">控制如何接收已下载的数据。
     
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     控制是以文本 (<codeph class="+ topic/ph pr-d/codeph ">URLLoaderDataFormat.TEXT</codeph>)、原始二进制数据 (<codeph class="+ topic/ph pr-d/codeph ">URLLoaderDataFormat.BINARY</codeph>) 还是 URL 编码变量 (<codeph class="+ topic/ph pr-d/codeph ">URLLoaderDataFormat.VARIABLES</codeph>) 接收下载的数据。
     
     <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">dataFormat</codeph> 属性的值是 <codeph class="+ topic/ph pr-d/codeph ">URLLoaderDataFormat.TEXT</codeph>，则所接收的数据是一个包含已加载文件文本的字符串。</p>
     
     <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">dataFormat</codeph> 属性的值是 <codeph class="+ topic/ph pr-d/codeph ">URLLoaderDataFormat.BINARY</codeph>，则所接收的数据是一个包含原始二进制数据的 ByteArray 对象。</p>
     
     <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">dataFormat</codeph> 属性的值是 <codeph class="+ topic/ph pr-d/codeph ">URLLoaderDataFormat.VARIABLES</codeph>，则所接收的数据是一个包含 URL 编码变量的 URLVariables 对象。</p>
     
     </apiDesc><example conref="examples\URLLoader_dataFormat.as" class="- topic/example "> 以下示例显示如何加载外部文本文件。使用 URLRequest 和 URLLoader 类，然后侦听 complete 事件。<xref href="http://actionscriptexamples.com/2008/02/26/loading-text-files-using-the-urlloader-class-in-actionscript-30/" scope="_mmexternal" class="- topic/xref ">ActionScriptExamples.com</xref> 提供的示例。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var PATH:String = "lorem.txt";
var urlRequest:URLRequest = new URLRequest(PATH);
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.TEXT; // default
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.load(urlRequest);
 
function urlLoader_complete(evt:Event):void {
    textArea.text = urlLoader.data;
}
</codeblock></example></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoaderDataFormat" class="- topic/link "><linktext class="- topic/linktext ">URLLoaderDataFormat</linktext></link></related-links></apiValue><apiValue id="flash.net:URLLoader:data" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">data</apiName><shortdesc class="- topic/shortdesc ">
     从加载操作接收的数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiType value="" name="type" class="- topic/state reference/state apiRef/apiType "/></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从加载操作接收的数据。只有完成加载操作时，才会填充该属性。该数据的格式取决于 <codeph class="+ topic/ph pr-d/codeph ">dataFormat</codeph> 属性的设置：
     
     <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">dataFormat</codeph> 属性是 <codeph class="+ topic/ph pr-d/codeph ">URLLoaderDataFormat.TEXT</codeph>，则所接收的数据是一个包含已加载文件文本的字符串。</p>
     
     <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">dataFormat</codeph> 属性是 <codeph class="+ topic/ph pr-d/codeph ">URLLoaderDataFormat.BINARY</codeph>，则所接收的数据是一个包含原始二进制数据的 ByteArray 对象。</p>
     
     <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">dataFormat</codeph> 属性是 <codeph class="+ topic/ph pr-d/codeph ">URLLoaderDataFormat.VARIABLES</codeph>，则所接收的数据是一个包含 URL 编码变量的 URLVariables 对象。</p>
     
     </apiDesc><example conref="examples\URLLoader_data.as" class="- topic/example "> 以下示例显示如何通过使用 URLLoader 类并将 dataFormat 属性设置为 URLLoaderDataFormat.VARIABLES 常量（“变量”）来将具有 URL 编码的变量的外部文本文件加载到 ActionScript 3.0 文档。<xref href="http://actionscriptexamples.com/2008/02/27/loading-url-encoded-variables-into-a-flash-application-using-the-urlloader-class-in-actionscript-30/" scope="_mmexternal" class="- topic/xref ">ActionScriptExamples.com</xref> 提供的示例。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
//params.txt is a local file that includes: firstName=Tom&amp;lastName=Jones
var lbl:TextField = new TextField();
var urlRequest:URLRequest = new URLRequest("params.txt");
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.load(urlRequest);
 
function urlLoader_complete(evt:Event):void {
    lbl.text = urlLoader.data.lastName + "," + urlLoader.data.firstName;
    addChild(lbl);
}
</codeblock></example></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLLoaderDataFormat" class="- topic/link "><linktext class="- topic/linktext ">URLLoaderDataFormat</linktext></link><link href="flash.net.xml#URLLoader/dataFormat" class="- topic/link "><linktext class="- topic/linktext ">URLLoader.dataFormat</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:IDynamicPropertyOutput" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">IDynamicPropertyOutput</apiName><shortdesc class="- topic/shortdesc ">
	 此接口控制动态对象的动态属性的序列化。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiInterface class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiInterface "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier "/></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 此接口控制动态对象的动态属性的序列化。将该接口与 IDynamicPropertyWriter 接口和 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.dynamicPropertyWriter</codeph> 属性一起使用。
	 
     </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#IDynamicPropertyWriter" class="- topic/link "><linktext class="- topic/linktext ">IDynamicPropertyWriter</linktext></link><link href="flash.net.xml#ObjectEncoding/dynamicPropertyWriter" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding.dynamicPropertyWriter</linktext></link></related-links><apiOperation id="flash.net:IDynamicPropertyOutput:flash.net:IDynamicPropertyOutput:writeDynamicProperty" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeDynamicProperty</apiName><shortdesc class="- topic/shortdesc ">
		 将动态属性添加到已序列化对象的二进制输出。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">name</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该属性的名称。可以使用该参数来指定动态对象现有属性的名称，也可以创建一个新属性。  
		 
		 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiType value="any" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入指定属性值。
		 
         </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 将动态属性添加到已序列化对象的二进制输出。随后读取该对象时（使用 <codeph class="+ topic/ph pr-d/codeph ">readObject</codeph> 等方法），该对象会包含新的属性。可以使用该方法从序列化中排除动态对象的属性，将值写入动态对象的属性中，或为动态对象创建新属性。
		 
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#IDynamicPropertyWriter" class="- topic/link "><linktext class="- topic/linktext ">IDynamicPropertyWriter</linktext></link><link href="flash.net.xml#ObjectEncoding/dynamicPropertyWriter" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding.dynamicPropertyWriter</linktext></link></related-links></apiOperation></apiClassifier><apiClassifier languages="" id="flash.net:NetStreamPlayOptions" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetStreamPlayOptions</apiName><shortdesc class="- topic/shortdesc ">
 
 NetStreamPlayOptions 类指定可以传递给 NetStream.play2() 方法的各个选项。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">NetStreamPlayOptions 类指定可以传递给 NetStream.play2() 方法的各个选项。
 
 </apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 
 NetStreamPlayOptions 类指定可以传递给 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 方法的各个选项。将 NetStreamPlayOptions 对象传递给 <codeph class="+ topic/ph pr-d/codeph ">play2()</codeph> 后，该类的属性会指定各个选项。此类的主要用途是动态实现流之间的过渡，以便切换具有不同比特率和大小的流或交换到播放列表中的不同内容。
 
 </apiDesc></apiClassifierDetail><apiConstructor id="flash.net:NetStreamPlayOptions:NetStreamPlayOptions" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">NetStreamPlayOptions</apiName><shortdesc class="- topic/shortdesc ">
     
     创建一个 NetStreamPlayOptions 对象以指定要传递给 NetStream.play2() 方法的选项。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
     创建一个 NetStreamPlayOptions 对象以指定要传递给 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 方法的选项。 
     
     </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link></related-links></apiConstructor><apiValue id="flash.net:NetStreamPlayOptions:len" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">len</apiName><shortdesc class="- topic/shortdesc ">
    streamName 中指定的流的持续播放时间（以秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">streamName 中指定的流的持续播放时间（以秒为单位）。
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 中指定的流的持续播放时间（以秒为单位）。默认值为 -1，这意味着 Flash Player 会播放实时流直到此流不再可用，或播放录制流直至结尾。如果传递给 <codeph class="+ topic/ph pr-d/codeph ">len</codeph> 的值为 0，则 Flash Player 将播放录制流开始后的 <codeph class="+ topic/ph pr-d/codeph ">start</codeph> 秒处的单个帧（假设 <codeph class="+ topic/ph pr-d/codeph ">start</codeph> 值大于或等于 0）。
    <p class="- topic/p ">如果传递给 <codeph class="+ topic/ph pr-d/codeph ">len</codeph> 的值为正数，则 Flash Player 会在实时流可用后将其播放 <codeph class="+ topic/ph pr-d/codeph ">len</codeph> 秒，或将录制流播放 <codeph class="+ topic/ph pr-d/codeph ">len</codeph> 秒。（如果流在 <codeph class="+ topic/ph pr-d/codeph ">len</codeph> 秒之前结束，则播放会随流的结束而结束。）</p> 
    <p class="- topic/p ">如果传递给 <codeph class="+ topic/ph pr-d/codeph ">len</codeph> 的值为 -1 之外的负数，则 Flash Player 会将该值视为 -1 进行解释。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/start" class="- topic/link "><linktext class="- topic/linktext ">start</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayOptions:offset" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">offset</apiName><shortdesc class="- topic/shortdesc ">
     流播放中应执行到新流的切换时所对应的时间（以秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     流播放中应执行到新流的切换时所对应的时间（以秒为单位）。当在 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayTransitions.SWITCH</codeph> 过渡模式下调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 时，将使用 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 参数。Flash Media Server 在指定偏移时间后查找最近切换点，并开始从该点向前流化新流。 
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Fast switch</b></p>
     
     <p class="- topic/p ">指定此属性后，Flash Media Server 将预先清空当前流并立即开始从指定的索引位置流式加载新流，而无需等待查找关键帧。在偏移后任何已从先前流缓冲的数据都将被刷新。与标准切换相比，此技术不必将从较早流缓冲的数据播放完，因此可更快地切换到新流。</p>
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 的默认值为 -1，即快速切换模式。在此模式中，在 <codeph class="+ topic/ph pr-d/codeph ">netstream.time + 3</codeph> 之后的第一个可用关键帧发生切换，大约比播放点晚 3 秒。</p>
     
     <p class="- topic/p ">偏移值必须高于当前播放时间 (<codeph class="+ topic/ph pr-d/codeph ">Netstream.time</codeph>)。如果值小于当前播放时间，将发送 <codeph class="+ topic/ph pr-d/codeph ">NetStream.Play.Failed</codeph> 状态事件。</p>
     
     <p class="- topic/p ">有关详细信息，请参阅 <i class="+ topic/ph hi-d/i ">Adobe Flash Media Server Developer's Guide</i> 中的<xref href="http://www.adobe.com/go/learn_fms_fastswitch_cn" scope="external" class="- topic/xref "> “Fast switching between streams”</xref>。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamPlayOptions/start" class="- topic/link "><linktext class="- topic/linktext ">start</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link><link href="flash.net.xml#NetStream/time" class="- topic/link "><linktext class="- topic/linktext ">NetStream.time</linktext></link><link href="flash.net.xml#NetStreamPlayTransitions/SWITCH" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayTransitions.SWITCH</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayOptions:oldStreamName" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">oldStreamName</apiName><shortdesc class="- topic/shortdesc ">
    旧的流或要从其过渡的流的名称。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    旧的流或要从其过渡的流的名称。当使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 简单地播放流（而不执行过渡）时，此属性的值应为 null 或未定义。否则，请指定要从其过渡的流。   
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamPlayOptions/streamName" class="- topic/link "><linktext class="- topic/linktext ">streamName</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayOptions:start" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">start</apiName><shortdesc class="- topic/shortdesc ">
    streamName 的开始时间（以秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">streamName 的开始时间（以秒为单位）。
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 的开始时间（以秒为单位）。有效值为 -2、-1 和 0。
    
    <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">start</codeph> 的默认值为 -2，这意味着 Flash Player 将首先尝试播放 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 中指定的实时流。如果未找到具有该名称的实时流，Flash Player 将播放 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 中指定的录制流。如果实时流和录制流均未找到，Flash Player 将打开名为 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 的实时流（即使无人在此实时流上进行发布）。当有人开始在此实时流上进行发布时，Flash Player 将开始播放此流。</p>
    
    <p class="- topic/p ">如果传递给 <codeph class="+ topic/ph pr-d/codeph ">start</codeph> 的值为 -1，则 Flash Player 仅播放 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 中指定的实时流。在未找到任何实时流的情况下，如果 <codeph class="+ topic/ph pr-d/codeph ">len</codeph> 设置为 -1，则 Flash Player 会无限期地等待实时流；如果 <codeph class="+ topic/ph pr-d/codeph ">len</codeph> 设置为其他值，则 Flash Player 会在等待 <codeph class="+ topic/ph pr-d/codeph ">len</codeph> 值指定的秒数之后，开始播放播放列表中的下一项。</p>
    
    <p class="- topic/p "> 如果传递给 <codeph class="+ topic/ph pr-d/codeph ">start</codeph> 的值为 0 或一个正数，则 Flash Player 仅播放名为 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 的录制流，并从该流开始后的 <codeph class="+ topic/ph pr-d/codeph ">start</codeph> 秒处开始播放。如果未找到任何录制流，则 Flash Player 将立即开始播放播放列表中的下一项。</p>
    
    <p class="- topic/p ">如果传递给 <codeph class="+ topic/ph pr-d/codeph ">start</codeph> 的值为 -1 或 -2 之外的负数，则 Flash Player 会将该值视为 -2 进行解释。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/len" class="- topic/link "><linktext class="- topic/linktext ">len</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayOptions:streamName" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">streamName</apiName><shortdesc class="- topic/shortdesc ">
    要过渡到或播放的新流的名称。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    要过渡到或播放的新流的名称。如果 <codeph class="+ topic/ph pr-d/codeph ">oldStreamName</codeph> 为 null 或未定义，则只需调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 即可开始播放 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph>。如果指定了 <codeph class="+ topic/ph pr-d/codeph ">oldStreamName</codeph>，则当调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 时，将使用 <codeph class="+ topic/ph pr-d/codeph ">transition</codeph> 属性中指定的过渡模式将 <codeph class="+ topic/ph pr-d/codeph ">oldStreamName</codeph> 过渡到 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph>。 
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamPlayOptions/oldStreamName" class="- topic/link "><linktext class="- topic/linktext ">oldStreamName</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayOptions:transition" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">transition</apiName><shortdesc class="- topic/shortdesc ">
    播放或过渡到 streamName 所使用的模式。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">播放或过渡到 streamName 所使用的模式。
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    播放或过渡到 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 所使用的模式。可能的值是 NetStreamPlayTransitions 类中的常量。根据是否调用 <codeph class="+ topic/ph pr-d/codeph ">Netstream.play2()</codeph> 来播放或过渡某个流，过渡模式会导致不同的行为。有关过渡模式的详细信息，请参阅 NetStreamPlayTransitions 类。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamPlayTransitions" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayTransitions</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetStreamMulticastInfo" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetStreamMulticastInfo</apiName><shortdesc class="- topic/shortdesc ">
NetStreamMulticastInfo 类指定与 NetStream 对象的基础 RTMFP 对等和 IP 多播流传输相关的各种服务质量 (QOS) 统计数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
NetStreamMulticastInfo 类指定与 NetStream 对象的基础 RTMFP 对等和 IP 多播流传输相关的各种服务质量 (QOS) 统计数据。NetStreamMulticastInfo 对象由 <codeph class="+ topic/ph pr-d/codeph ">NetStream.multicastInfo</codeph> 属性返回。

<p class="- topic/p ">返回数值的属性表示从多播流开始计算的总数。这些类型的属性包括发送的媒体字节数或接收的媒体片断消息数。速率属性表示采用当前几秒钟的平均速率的快照。这些类型的属性包括本地节点正在接收数据时所使用的速率。 </p>

<p class="- topic/p ">要了解 NetStreamMulticastInfo 对象中包含的值的列表，请使用 <codeph class="+ topic/ph pr-d/codeph ">NetStreamMulticastInfo.toString()</codeph> 方法。</p>

</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/toString()" class="- topic/link "><linktext class="- topic/linktext ">toString()</linktext></link><link href="flash.net.xml#NetStream/multicastInfo" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.multicastInfo</linktext></link></related-links><apiOperation id="flash.net:NetStreamMulticastInfo:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc ">
    返回列出 NetStreamMulticastInfo 对象的属性的字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个字符串，其中包含 NetStreamMulticastInfo 对象的属性的值
    
    </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    返回列出 NetStreamMulticastInfo 对象的属性的字符串。
    
    </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:NetStreamMulticastInfo:bytesPushedFromPeers:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesPushedFromPeers</apiName><shortdesc class="- topic/shortdesc ">
    指定主动从同级推入并由本地节点接收的媒体字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定主动从同级推入并由本地节点接收的媒体字节数。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesRequestedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesRequestedFromPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsPushedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsPushedFromPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsRequestedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsRequestedFromPeers</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:bytesPushedToPeers:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesPushedToPeers</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点已主动推入同级的媒体字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点已主动推入同级的媒体字节数。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesRequestedByPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesRequestedByPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsPushedToPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsPushedToPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsRequestedByPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsRequestedByPeers</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:bytesReceivedFromIPMulticast:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesReceivedFromIPMulticast</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点已从 IP 多播接收的媒体字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点已从 IP 多播接收的媒体字节数。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesReceivedFromServer" class="- topic/link "><linktext class="- topic/linktext ">bytesReceivedFromServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsReceivedFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">fragmentsReceivedFromIPMulticast</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsReceivedFromServer" class="- topic/link "><linktext class="- topic/linktext ">fragmentsReceivedFromServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromIPMulticast</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:bytesReceivedFromServer:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesReceivedFromServer</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点从服务器接收的媒体字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点从服务器接收的媒体字节数。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesReceivedFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">bytesReceivedFromIPMulticast</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsReceivedFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">fragmentsReceivedFromIPMulticast</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsReceivedFromServer" class="- topic/link "><linktext class="- topic/linktext ">fragmentsReceivedFromServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromServer" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromServer</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:bytesRequestedByPeers:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesRequestedByPeers</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点已发送到同级以响应来自特定片段的同级请求的媒体字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点已发送到同级以响应来自特定片段的同级请求的媒体字节数。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesPushedToPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesPushedToPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsPushedToPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsPushedToPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsRequestedByPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsRequestedByPeers</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:bytesRequestedFromPeers:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesRequestedFromPeers</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点请求并从同级接收的媒体字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点请求并从同级接收的媒体字节数。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesPushedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesPushedFromPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsPushedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsPushedFromPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsRequestedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsRequestedFromPeers</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:fragmentsPushedFromPeers:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">fragmentsPushedFromPeers</apiName><shortdesc class="- topic/shortdesc ">
    指定主动从同级推入并由本地节点接收的媒体片段消息的数量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定主动从同级推入并由本地节点接收的媒体片段消息的数量。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesPushedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesPushedFromPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/bytesRequestedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesRequestedFromPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsRequestedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsRequestedFromPeers</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:fragmentsPushedToPeers:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">fragmentsPushedToPeers</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点已主动推入同级的媒体片段消息的数量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点已主动推入同级的媒体片段消息的数量。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesPushedToPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesPushedToPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/bytesRequestedByPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesRequestedByPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsRequestedByPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsRequestedByPeers</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:fragmentsReceivedFromIPMulticast:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">fragmentsReceivedFromIPMulticast</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点已从 IP 多播接收的媒体片段消息的数量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点已从 IP 多播接收的媒体片段消息的数量。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesReceivedFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">bytesReceivedFromIPMulticast</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/bytesReceivedFromServer" class="- topic/link "><linktext class="- topic/linktext ">bytesReceivedFromServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsReceivedFromServer" class="- topic/link "><linktext class="- topic/linktext ">fragmentsReceivedFromServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromIPMulticast</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:fragmentsReceivedFromServer:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">fragmentsReceivedFromServer</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点已从服务器接收的媒体片段消息的数量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点已从服务器接收的媒体片段消息的数量。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesReceivedFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">bytesReceivedFromIPMulticast</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/bytesReceivedFromServer" class="- topic/link "><linktext class="- topic/linktext ">bytesReceivedFromServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsReceivedFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">fragmentsReceivedFromIPMulticast</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromServer" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromServer</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:fragmentsRequestedByPeers:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">fragmentsRequestedByPeers</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点已发送到同级以响应来自特定片段的同级请求的媒体片段消息的数量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点已发送到同级以响应来自特定片段的同级请求的媒体片段消息的数量。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesPushedToPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesPushedToPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/bytesRequestedByPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesRequestedByPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsPushedToPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsPushedToPeers</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:fragmentsRequestedFromPeers:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">fragmentsRequestedFromPeers</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点请求并从同级接收的媒体片段消息的数量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点请求并从同级接收的媒体片段消息的数量。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/bytesPushedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesPushedFromPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/bytesRequestedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">bytesRequestedFromPeers</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/fragmentsPushedFromPeers" class="- topic/link "><linktext class="- topic/linktext ">fragmentsPushedFromPeers</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:receiveControlBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">receiveControlBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点从同级接收控件开销消息所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点从同级接收控件开销消息所使用的速率，以每秒字节数为单位。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecond</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromServer" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromIPMulticast</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/sendControlBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">sendControlBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:receiveDataBytesPerSecondFromIPMulticast:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">receiveDataBytesPerSecondFromIPMulticast</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点从 IP 多播接收数据所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点从 IP 多播接收数据所使用的速率，以每秒字节数为单位。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/receiveControlBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">receiveControlBytesPerSecond</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecond</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromServer" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/sendDataBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">sendDataBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:receiveDataBytesPerSecondFromServer:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">receiveDataBytesPerSecondFromServer</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点从服务器接收媒体数据所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点从服务器接收媒体数据所使用的速率，以每秒字节数为单位。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/receiveControlBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">receiveControlBytesPerSecond</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecond</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromIPMulticast</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/sendDataBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">sendDataBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:receiveDataBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">receiveDataBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点从同级、从服务器和通过 IP 多播接收媒体数据所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点从同级、从服务器和通过 IP 多播接收媒体数据所使用的速率，以每秒字节数为单位。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/receiveControlBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">receiveControlBytesPerSecond</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromIPMulticast" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromIPMulticast</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromServer" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/sendDataBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">sendDataBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:sendControlBytesPerSecondToServer:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">sendControlBytesPerSecondToServer</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点将控件开销消息发送到服务器所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点将控件开销消息发送到服务器所使用的速率，以每秒字节数为单位。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecondFromServer" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecondFromServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/sendControlBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">sendControlBytesPerSecond</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/sendDataBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">sendDataBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:sendControlBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">sendControlBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点将控件开销消息发送到同级和服务器所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点将控件开销消息发送到同级和服务器所使用的速率，以每秒字节数为单位。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/receiveControlBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">receiveControlBytesPerSecond</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/sendControlBytesPerSecondToServer" class="- topic/link "><linktext class="- topic/linktext ">sendControlBytesPerSecondToServer</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/sendDataBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">sendDataBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamMulticastInfo:sendDataBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">sendDataBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
    指定本地节点将媒体数据发送到同级所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定本地节点将媒体数据发送到同级所使用的速率，以每秒字节数为单位。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo/receiveDataBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">receiveDataBytesPerSecond</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/sendControlBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">sendControlBytesPerSecond</linktext></link><link href="flash.net.xml#NetStreamMulticastInfo/sendControlBytesPerSecondToServer" class="- topic/link "><linktext class="- topic/linktext ">sendControlBytesPerSecondToServer</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetworkInfo" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetworkInfo</apiName><shortdesc class="- topic/shortdesc ">
 NetworkInfo 类提供有关计算机上网络接口的信息。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 NetworkInfo 类提供有关计算机上网络接口的信息。 
 
 <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>所有桌面操作系统和用于电视的 AIR 设备均支持此功能，但移动设备不支持此功能。您可以使用 <codeph class="+ topic/ph pr-d/codeph ">NetworkInfo.isSupported</codeph> 属性在运行时测试是否受支持。有关在多个配置文件之间支持 API 的详细信息，请参阅 <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">AIR 配置文件支持</xref>。</p>
 
 <p class="- topic/p ">NetworkInfo 对象是唯一的。要获取单个 NetworkInfo 对象，可使用静态 <codeph class="+ topic/ph pr-d/codeph ">NetworkInfo.networkInfo</codeph> 属性。不要调用类构造函数 <codeph class="+ topic/ph pr-d/codeph ">new NetworkInfo()</codeph>。</p>
 
 <p class="- topic/p ">大多数计算机具有一个或多个接口，例如，有线网络接口和无线网络接口。还可以有 VPN、环回或虚拟接口等其他接口。</p>
 
 <p class="- topic/p ">当可用接口更改时，NetworkInfo 对象将调度 change 事件。调用 <codeph class="+ topic/ph pr-d/codeph ">findInterfaces()</codeph> 方法来确定最新网络信息。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>NativeApplication 对象还调度网络更改事件。</p>
 
 </apiDesc><example conref="examples\NetInfoExample.as" class="- topic/example "/></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetworkInterface" class="- topic/link "><linktext class="- topic/linktext ">NetworkInterface 类</linktext></link><link href="flash.net.xml#InterfaceAddress" class="- topic/link "><linktext class="- topic/linktext ">InterfaceAddress 类</linktext></link></related-links><adobeApiEvent id="flash.net:NetworkInfo_flash.events.Event.NETWORK_CHANGE_networkChange" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">networkChange</apiName><shortdesc class="- topic/shortdesc ">
 在网络接口更改后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.NETWORK_CHANGE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在网络接口更改后调度。
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.net:NetworkInfo:findInterfaces" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">findInterfaces</apiName><shortdesc class="- topic/shortdesc ">
     返回与此计算机相关联的网络接口的列表。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">NetworkInterface 对象数组
     
     </apiDesc><apiType value="Vector$flash.net:NetworkInterface" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回与此计算机相关联的网络接口的列表。 
     
     </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:NetworkInfo:isSupported:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">isSupported</apiName><shortdesc class="- topic/shortdesc ">
	 表示客户端系统是否支持访问网络接口信息。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><language>3.0 
	 </language></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 表示客户端系统是否支持访问网络接口信息。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetworkInfo:networkInfo:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">networkInfo</apiName><shortdesc class="- topic/shortdesc ">
	 NetworkInfo 对象的单一实例。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.net:NetworkInfo</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在 AIR 应用程序安全沙箱外部运行的内容是否可访问此属性。
	 
	 </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 NetworkInfo 对象的单一实例。
	 
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:URLVariables" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">URLVariables</apiName><shortdesc class="- topic/shortdesc ">
 
 使用 URLVariables 类可以在应用程序和服务器之间传输变量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">URLVariables, constructor
 
 </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 
 使用 URLVariables 类可以在应用程序和服务器之间传输变量。将 URLVariables 对象与 URLLoader 类的方法、URLRequest 类的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性和 flash.net 包函数一起使用。
 
 </apiDesc><example conref="examples\URLVariablesExample.as" class="- topic/example "> 下例在一个新的浏览器窗口中打开位于 http://www.[yourDomain].com/application.jsp 上的远程应用程序，并将 URLVariables 对象中捕获的有关用户会话的数据传递给该应用程序。 
  
 <p class="- topic/p ">该示例的要点遵循：</p>
 <ol class="- topic/ol "><li class="- topic/li ">构造函数会创建名为 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> 的 URLRequest 实例，同时将远程应用程序的 URL 作为参数。</li><li class="- topic/li ">创建了一个 URLVariables 对象，并对它的两个属性进行了赋值。</li><li class="- topic/li ">URLVariables 对象被赋给了 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性。</li><li class="- topic/li ">该示例调用 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL</codeph>，在一个新的浏览器窗口中打开远程应用程序的 URL。</li></ol>
 <p class="- topic/p "> <b class="+ topic/ph hi-d/b ">注意：</b>要运行该示例，必须将该示例中的远程应用程序 URL 替换为工作 URL。此外，需要用服务器代码处理 Flash Player 在 URLVariables 对象中捕获的信息。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#URLLoader" class="- topic/link "><linktext class="- topic/linktext ">URLLoader</linktext></link></related-links><apiConstructor id="flash.net:URLVariables:URLVariables" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">URLVariables</apiName><shortdesc class="- topic/shortdesc ">
	 创建一个新的 URLVariables 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">source</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">包含名称/值对的 URL 编码的字符串。
	 </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 创建一个新的 URLVariables 对象。将 URLVariables 对象传递给 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性。
	 
	 <p class="- topic/p ">如果使用字符串来调用 URLVariables 构造函数，将自动调用 <codeph class="+ topic/ph pr-d/codeph ">decode()</codeph> 方法，以将该字符串转换成 URLVariables 对象的属性。</p>
	 
	 </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.net:URLVariables:decode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">decode</apiName><shortdesc class="- topic/shortdesc ">
	 将变量字符串转换为指定 URLVariables 对象的属性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">URLVariables, URLVariables.decode, decode
	 </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">源参数必须是包含名称/值对的 URL 编码的查询字符串。
	 
	 </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">source</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">包含名称/值对的 URL 编码的查询字符串。	 
	 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 将变量字符串转换为指定 URLVariables 对象的属性。
	 <p class="- topic/p ">该方法供 URLVariables 事件内部使用。绝大多数用户无需直接调用此方法。</p>
	 
	 </apiDesc><example conref="examples\URLVariables_decode.as" class="- topic/example "> 以下示例显示如何解析 URL 编码的字符串。<xref href="http://actionscriptexamples.com/2008/02/27/decoding-url-encoded-strings-in-a-flash-application-using-the-urlvariables-class-in-actionscript-30/" scope="_mmexternal" class="- topic/xref ">ActionScriptExamples.com</xref> 提供的示例。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
// The first method passes the string to be decoded to the URLVariables class constructor:
var urlVariables:URLVariables = new URLVariables("firstName=Tom&amp;lastName=Jones");
lbl.text = urlVariables.lastName + "," + urlVariables.firstName;

// The second method uses the decode() method to parse the URL encoded string:
var urlVariables:URLVariables = new URLVariables();
urlVariables.decode("firstName=Tom&amp;lastName=Jones");
lbl.text = urlVariables.lastName + "," + urlVariables.firstName;
</codeblock></example></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLVariables:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc ">
	 以 MIME 内容编码格式 application/x-www-form-urlencoded 返回包含所有可枚举变量的字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">URLVariables, URLVariables.toString, toString
	  
	  </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">包含名称/值对的 URL 编码的字符串。
	 
	 </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 以 MIME 内容编码格式 <i class="+ topic/ph hi-d/i ">application/x-www-form-urlencoded</i> 返回包含所有可枚举变量的字符串。
	 
	 </apiDesc></apiOperationDetail></apiOperation></apiClassifier><apiClassifier languages="" id="flash.net:IDynamicPropertyWriter" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">IDynamicPropertyWriter</apiName><shortdesc class="- topic/shortdesc ">
     此接口与 IDynamicPropertyOutput 接口一起用于控制动态对象的动态属性的序列化。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiInterface class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiInterface "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier "/></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此接口与 IDynamicPropertyOutput 接口一起用于控制动态对象的动态属性的序列化。为了使用此接口，则应将实现了 IDynamicPropertyWriter 接口的对象赋给 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.dynamicPropertyWriter</codeph> 属性。
      
     </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#IDynamicPropertyOutput" class="- topic/link "><linktext class="- topic/linktext ">IDynamicPropertyOutput</linktext></link><link href="flash.net.xml#ObjectEncoding/dynamicPropertyWriter" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding.dynamicPropertyWriter</linktext></link></related-links><apiOperation id="flash.net:IDynamicPropertyWriter:flash.net:IDynamicPropertyWriter:writeDynamicProperties" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeDynamicProperties</apiName><shortdesc class="- topic/shortdesc ">
         将 IDynamicPropertyOutput 对象的名称和值写入带有动态属性的对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">obj</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Object</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要写入的对象。
		 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">output</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:IDynamicPropertyOutput</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">包含要动态写入对象的名称和值的 IDynamicPropertyOutput 对象。
		 
		 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         将 IDynamicPropertyOutput 对象的名称和值写入带有动态属性的对象。如果设置了 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.dynamicPropertyWriter</codeph>，则可为带有动态属性的每个对象调用此方法。 
		 
		 </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#IDynamicPropertyOutput" class="- topic/link "><linktext class="- topic/linktext ">IDynamicPropertyOutput</linktext></link><link href="flash.net.xml#ObjectEncoding/dynamicPropertyWriter" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding.dynamicPropertyWriter</linktext></link></related-links></apiOperation></apiClassifier><apiClassifier languages="" id="flash.net:DatagramSocket" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">DatagramSocket</apiName><shortdesc class="- topic/shortdesc ">
 DatagramSocket 类启用代码以发送和接收通用数据报协议 (UDP) 数据包。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 DatagramSocket 类启用代码以发送和接收通用数据报协议 (UDP) 数据包。 
 
 <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>所有桌面操作系统均支持此功能，但移动设备或用于电视的 AIR 设备不支持此功能。您可以使用 <codeph class="+ topic/ph pr-d/codeph ">DatagramSocket.isSupported</codeph> 属性在运行时测试是否受支持。有关在多个配置文件之间支持 API 的详细信息，请参阅 <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">AIR 配置文件支持</xref>。</p>
 
 <p class="- topic/p ">数据报数据包在源和目标之间个别传输。数据包可按与发送顺序不同的顺序到达。不会重新传输在传输中丢失的数据包，甚至不检测这种丢失。</p>
 
 <p class="- topic/p ">使用数据报套接字发送的数据不会自动分解为具有可传输大小的数据包。如果发送超出最大传输单元 (MTU) 大小的 UDP 数据包，网络会丢弃该数据包（不发出警告）。限制 MTU 是传输路径中任何接口、开关或路由器的最小 MTU。可使用 NetworkInterface 类确定本地接口的 MTU，但是网络中的其他节点可以具有不同的 MTU 值。</p>
 
 <p class="- topic/p ">Socket 类使用 TCP 保护数据包传输，并自动分解和重组大型数据包。TCP 还提供更好的网络带宽管理。这些功能意味着使用 TCP 套接字发送的数据会导致更高的延迟，但是在多数使用情况下，TCP 的好处远远超过延迟的代价。大多数网络通信应使用 Socket 类而不是 DatagramSocket 类。</p>
 
 <p class="- topic/p ">此 DatagramSocket 类在与注重短传输延迟和容许包丢失的应用程序一起使用时很有用。例如，voice-over-IP (VoIP) 应用程序中的网络操作和实时、多玩家游戏通常可受益于 UDP。对于一些服务器端应用程序，DatagramSocket 类也很有用。由于 UDP 是无状态协议，与使用 TCP 相比，使用它服务器可处理来自更多客户端的更多请求。</p>
 
 <p class="- topic/p ">DatagramSocket 类仅可在 Adobe AIR 应用程序的应用程序安全沙箱中使用。</p>
 
 <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
 
 </apiDesc><example conref="examples\DatagramSocketExample.as" class="- topic/example "><codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package
{
    import flash.display.Sprite;
    import flash.events.DatagramSocketDataEvent;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.events.TimerEvent;
    import flash.net.DatagramSocket;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFieldType;
    import flash.utils.ByteArray;
    import flash.utils.Timer;
    
    public class DatagramSocketExample extends Sprite
    {
        private var datagramSocket:DatagramSocket = new DatagramSocket();;

        private var localIP:TextField;
        private var localPort:TextField;
        private var logField:TextField;
        private var targetIP:TextField;
        private var targetPort:TextField;
        private var message:TextField;
        
        public function DatagramSocketExample()
        {
            setupUI();
        }

        private function bind( event:Event ):void
        {
            if( datagramSocket.bound ) 
            {
                datagramSocket.close();
                datagramSocket = new DatagramSocket();
                
            }
            datagramSocket.bind( parseInt( localPort.text ), localIP.text );
            datagramSocket.addEventListener( DatagramSocketDataEvent.DATA, dataReceived );
            datagramSocket.receive();
            log( "Bound to: " + datagramSocket.localAddress + ":" + datagramSocket.localPort );
        }
        
        private function dataReceived( event:DatagramSocketDataEvent ):void
        {
            //Read the data from the datagram
            log("Received from " + event.srcAddress + ":" + event.srcPort + "> " + 
                event.data.readUTFBytes( event.data.bytesAvailable ) );
        }
        
        private function send( event:Event ):void
        {
            //Create a message in a ByteArray
            var data:ByteArray = new ByteArray();
            data.writeUTFBytes( message.text );
            
            //Send a datagram to the target
            try
            {
                datagramSocket.send( data, 0, 0, targetIP.text, parseInt( targetPort.text )); 
                log( "Sent message to " + targetIP.text + ":" + targetPort.text );
            }
            catch ( error:Error )
            {
                log( error.message );
            }
        }
        
        private function log( text:String ):void
        {
            logField.appendText( text + "\n" );
            logField.scrollV = logField.maxScrollV;
            trace( text );
        }
        private function setupUI():void
        {
            targetIP = createTextField( 10, 10, "Target IP:", "192.168.0.1" );
            targetPort = createTextField( 10, 35, "Target port:", "8989" );
            message = createTextField( 10, 60, "Message:", "Lucy can't drink milk." );
            localIP = createTextField( 10, 85, "Local IP", "0.0.0.0");
            localPort = createTextField( 10, 110, "Local port:", "0" );
            createTextButton( 250, 135, "Bind", bind );
            createTextButton( 300, 135, "Send", send );
            logField = createTextField( 10, 160, "Log:", "", false, 200 )
                
            this.stage.nativeWindow.activate();
        }
        
        private function createTextField( x:int, y:int, label:String, defaultValue:String = '', editable:Boolean = true, height:int = 20 ):TextField
        {
            var labelField:TextField = new TextField();
            labelField.text = label;
            labelField.type = TextFieldType.DYNAMIC;
            labelField.width = 180;
            labelField.x = x;
            labelField.y = y;
            
            var input:TextField = new TextField();
            input.text = defaultValue;
            input.type = TextFieldType.INPUT;
            input.border = editable;
            input.selectable = editable;
            input.width = 280;
            input.height = height;
            input.x = x + labelField.width;
            input.y = y;
            
            this.addChild( labelField );
            this.addChild( input );
            
            return input;
        }
        
        private function createTextButton( x:int, y:int, label:String, clickHandler:Function ):TextField
        {
            var button:TextField = new TextField();
            button.htmlText = "&lt;u>&lt;b>" + label + "&lt;/b>&lt;/u>";
            button.type = TextFieldType.DYNAMIC;
            button.selectable = false;
            button.width = 180;
            button.x = x;
            button.y = y;
            button.addEventListener( MouseEvent.CLICK, clickHandler );
            
            this.addChild( button );
            return button;
            
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="http://tools.ietf.org/html/rfc768" class="- topic/link "><linktext class="- topic/linktext ">RFC 768</linktext></link><link href="flash.net.xml#Socket" class="- topic/link "><linktext class="- topic/linktext ">Socket 类</linktext></link><link href="flash.net.xml#XMLSocket" class="- topic/link "><linktext class="- topic/linktext ">XMLSocket 类</linktext></link><link href="flash.net.xml#ServerSocket" class="- topic/link "><linktext class="- topic/linktext ">ServerSocket 类</linktext></link></related-links><adobeApiEvent id="flash.net:DatagramSocket_flash.events.IOErrorEvent.IOERROR_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><shortdesc class="- topic/shortdesc ">
 当此插口收到 I/O 错误时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.IOErrorEvent.IOERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">当此插口收到 I/O 错误时调度。
 </apiTipText></apiTipTexts></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当此插口收到 I/O 错误时调度。
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:DatagramSocket_flash.events.DatagramSocketDataEvent.DATA_data" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">data</apiName><shortdesc class="- topic/shortdesc ">
 在此套接字接收数据包时进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.DatagramSocketDataEvent.DATA</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.DatagramSocketDataEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在此套接字接收数据包时进行调度。
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:DatagramSocket_flash.events.Event.CLOSE_close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
 当操作系统关闭此套接字时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.CLOSE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当操作系统关闭此套接字时调度。
  
 <p class="- topic/p ">调用 DatagramSocket <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 方法时，不会调度 <codeph class="+ topic/ph pr-d/codeph ">close</codeph> 事件。</p>
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:DatagramSocket:DatagramSocket" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">DatagramSocket</apiName><shortdesc class="- topic/shortdesc ">
     创建一个 DatagramSocket 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 AIR 应用程序安全沙箱外的内容尝试创建 DatagramSocket 对象。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建一个 DatagramSocket 对象。
     
     </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.net:DatagramSocket:bind" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">bind</apiName><shortdesc class="- topic/shortdesc ">
     将此套接字绑定到指定的本地地址和端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 <codeph class="+ topic/ph pr-d/codeph ">localPort</codeph> 小于 0 或大于 65535 时，会发生此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 <codeph class="+ topic/ph pr-d/codeph ">localAddress</codeph> 在语法形式上是格式不正确的 IP 地址时，将发生此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法绑定套接字时会发生此错误，例如在以下情况下：
     <ol class="- topic/ol "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">localPort</codeph> 已由另一套接字使用。</li><li class="- topic/li ">应用程序正在其下运行的用户帐户没有足够的系统权限来绑定到指定的端口。（当 <codeph class="+ topic/ph pr-d/codeph ">localPort &lt; 1024</codeph> 时，通常会出现权限问题。）</li><li class="- topic/li ">此 DatagramSocket 对象已绑定。</li><li class="- topic/li ">此 DatagramSocket 对象已关闭。</li></ol>
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 <codeph class="+ topic/ph pr-d/codeph ">localAddress</codeph> 是无效的本地地址时，将发生此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">localPort</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">绑定到本地计算机的端口数量。如果将 <codeph class="+ topic/ph pr-d/codeph ">localPort</codeph> 设置为 0（默认值），则绑定下一个可用的系统端口。连接到 1024 以下的端口号的权限受系统安全策略的限制。例如，在 Mac 和 Linux 系统中，应用程序必须拥有连接到 1024 以下的端口的根权限才能运行。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">localAddress</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0.0.0.0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要绑定到的本地计算机上的 IP 地址。此地址可以是 IPv4 地址，也可以是 IPv6 地址。如果将 <codeph class="+ topic/ph pr-d/codeph ">localAddress</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">0.0.0.0</codeph>（默认值），该套接字将侦听所有可用的 IPv4 地址。要侦听所有可用的 IPv6 地址，则必须将“::”指定为 <codeph class="+ topic/ph pr-d/codeph ">localAddress</codeph> 参数。要使用 IPv6 地址，计算机和网络必须都配置为支持 IPv6。此外，绑定到 IPv4 地址的套接字无法连接到使用 IPv6 地址的套接字。同样，绑定到 IPv6 地址的套接字无法连接到使用 IPv4 地址的套接字。地址类型必须匹配。 
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将此套接字绑定到指定的本地地址和端口。
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">bind()</codeph> 方法同步执行。绑定操作完成后再执行下一行代码。</p>
     
	 </apiDesc><example conref="examples\DatagramSocket.bind.1.as" class="- topic/example "> 下面的示例说明了绑定 DatagramSocket 对象的各种方法：
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">

udpSocket.bind(); //bind to any available port, listen on all IPv4 addresses
udpSocket.bind( 0, "0.0.0.0" ); //same as above
udpSocket.bind( 0, "127.0.0.1" ); //any available port on the localhost address
udpSocket.bind( 8989, "192.168.0.1" ); //port 8989 on a particular IPv4 address
udpSocket.bind( 0, "::" ); //any available port on all IPv6 address
udpSocket.bind( 8989, "::1" ); //port 8989 on the IPv6 localhost address
udpSocket.bind( 8989, "2001:1890:110b:1e19:f06b:72db:7026:3d7a" ); //port 8989 on a particular IPv6 address
</codeblock></example></apiOperationDetail></apiOperation><apiOperation id="flash.net:DatagramSocket:close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     关闭套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果无法关闭套接字（由于内部、网络或操作系统错误）或如果套接字未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     关闭套接字。 
     
     <p class="- topic/p ">此套接字从远程计算机断开并从本地计算机解除绑定。不能重复使用关闭的套接字。</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:DatagramSocket:connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
     将套接字连接到指定的远程地址和端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 <codeph class="+ topic/ph pr-d/codeph ">localPort</codeph> 小于 1 或大于 65535 时，会发生此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 <codeph class="+ topic/ph pr-d/codeph ">localAddress</codeph> 在语法上不是有效地址时，会发生此错误。或当默认的路由地址（“0.0.0.0”或“::”）正在使用。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法连接套接字时会发生此错误，例如，在调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 之前尚未调用 <codeph class="+ topic/ph pr-d/codeph ">bind()</codeph> 并且无法实现到远程地址系列的默认绑定。 
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">remoteAddress</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">建立连接所用的远程计算机的 IP 地址。此地址可以是 IPv4 地址，也可以是 IPv6 地址。如果尚未调用 <codeph class="+ topic/ph pr-d/codeph ">bind()</codeph>，则调用默认 <codeph class="+ topic/ph pr-d/codeph ">bind()</codeph> 时使用 <codeph class="+ topic/ph pr-d/codeph ">remoteAddress</codeph>、IPv4 或 IPv6 地址系列。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">remotePort</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">用于建立连接的远程计算机上的端口号。 
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将套接字连接到指定的远程地址和端口。 
     
     <p class="- topic/p ">当数据报套接字“已连接”时，仅可与指定目标相互发送和接收数据报数据包。忽略来自其他源的数据包。不要求连接数据报套接字。建立连接可以免除从其他源筛选无关数据包的必要。但是，UDP 套接字连接不是永久网络连接（因为它用于 TCP 连接）。套接字的远端甚至可能不存在。</p>
     
     <p class="- topic/p ">如果尚未调用 <codeph class="+ topic/ph pr-d/codeph ">bind()</codeph> 方法，该套接字自动绑定到默认本地地址和端口。</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:DatagramSocket:receive" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">receive</apiName><shortdesc class="- topic/shortdesc ">
     启用此 DatagramSocket 对象可接收绑定 IP 地址和端口上的传入数据包。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     启用此 DatagramSocket 对象可接收绑定 IP 地址和端口上的传入数据包。
     
     <p class="- topic/p ">该函数立即返回。DatagramSocket 在收到数据包时会立即调度 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 事件。</p>
     
     </apiDesc></apiOperationDetail><adobeApiEvent id="flash.net:DatagramSocket:receive_data" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">data</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:DatagramSocketDataEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">收到 UDP 数据包时。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">收到 UDP 数据包时。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:DatagramSocket:send" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">send</apiName><shortdesc class="- topic/shortdesc ">
     使用 UDP 发送包含 ByteArray 中字节的数据包。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 <codeph class="+ topic/ph pr-d/codeph ">port</codeph> 小于 1 或大于 65535 时，会发生此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果套接字未连接且 <codeph class="+ topic/ph pr-d/codeph ">address</codeph> 是格式不正确的 IP 地址。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在以下情况下会发生此错误：
     <ol class="- topic/ol "><li class="- topic/li ">如果尚未调用 <codeph class="+ topic/ph pr-d/codeph ">bind()</codeph>，并且不能将绑定默认设置到目标地址系列。</li><li class="- topic/li ">在某些操作系统上，从目标主机接收到 ICMP“未到达目标”消息后，如果调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法，则将引发 IOError。（因此，该错误是在第二次尝试发送数据失败时引发的，而不是在第一次引发。）其他操作系统（例如 Windows）会忽略这些 ICMP 消息，因此不会引发错误。</li></ol>
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 <codeph class="+ topic/ph pr-d/codeph ">bytes</codeph> 参数为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 时。 
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 大于 <codeph class="+ topic/ph pr-d/codeph ">bytes</codeph> 指定的 ByteArray 长度；如果指定的要根据 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 加上 <codeph class="+ topic/ph pr-d/codeph ">length</codeph> 写入的数据量超出可用数据。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果在连接套接字后指定 <codeph class="+ topic/ph pr-d/codeph ">address</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">port</codeph> 参数。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">bytes</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.utils:ByteArray</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">包含数据包数据的 ByteArray。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">offset</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc "><codeph class="+ topic/ph pr-d/codeph ">bytes</codeph> ByteArray 对象中从零开始的偏移量，数据包由此处开始。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">length</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">数据包中的字节数。默认值 0 导致从由 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 参数指定的值开始发送整个 ByteArray。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">address</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">远程计算机的 IPv4 地址或 IPv6 地址。如果未使用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法指定一个参数，则需要一个地址。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">port</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">远程计算机上的端口号。如果未使用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法指定端口，则需要一个大于 0 小于 65536 的值。
     
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     使用 UDP 发送包含 ByteArray 中字节的数据包。 
     
     <p class="- topic/p ">如果套接字已连接，则会将数据包发送到使用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法指定的远程地址和端口，而且可能不会指定任何目标 IP 地址和端口。如果套接字没有连接，则会将数据包发送到指定的地址和端口，且必须为 <codeph class="+ topic/ph pr-d/codeph ">address</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">port</codeph> 提供有效的值。如果尚未调用 <codeph class="+ topic/ph pr-d/codeph ">bind()</codeph> 方法，该套接字自动绑定到默认本地地址和端口。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>不支持将数据发送到广播地址。</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:DatagramSocket:bound:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bound</apiName><shortdesc class="- topic/shortdesc ">
     表示此 Socket 对象当前是否绑定到本地地址和端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示此 Socket 对象当前是否绑定到本地地址和端口。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#DatagramSocket/bind()" class="- topic/link "><linktext class="- topic/linktext ">bind()</linktext></link></related-links></apiValue><apiValue id="flash.net:DatagramSocket:connected:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">connected</apiName><shortdesc class="- topic/shortdesc ">
     表示此 Socket 对象当前是否连接到远程地址和端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示此 Socket 对象当前是否连接到远程地址和端口。
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b><codeph class="+ topic/ph pr-d/codeph ">true</codeph> 值不意味着远程计算机正在侦听连接的地址和端口，它仅表示此 DataGramSocket 对象仅将数据发送到该地址和端口或只从其接收数据。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#DatagramSocket/connect()" class="- topic/link "><linktext class="- topic/linktext ">connect()</linktext></link></related-links></apiValue><apiValue id="flash.net:DatagramSocket:isSupported:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">isSupported</apiName><shortdesc class="- topic/shortdesc ">
     表示运行时环境是否支持 DatagramSocket 功能。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示运行时环境是否支持 DatagramSocket 功能。
     
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:DatagramSocket:localAddress:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">localAddress</apiName><shortdesc class="- topic/shortdesc ">
     本地计算机上此套接字绑定到的 IP 地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     本地计算机上此套接字绑定到的 IP 地址。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#DatagramSocket/bind()" class="- topic/link "><linktext class="- topic/linktext ">bind()</linktext></link></related-links></apiValue><apiValue id="flash.net:DatagramSocket:localPort:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">localPort</apiName><shortdesc class="- topic/shortdesc ">
     本地计算机上此套接字绑定到的端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     本地计算机上此套接字绑定到的端口。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#DatagramSocket/bind()" class="- topic/link "><linktext class="- topic/linktext ">bind()</linktext></link></related-links></apiValue><apiValue id="flash.net:DatagramSocket:remoteAddress:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">remoteAddress</apiName><shortdesc class="- topic/shortdesc ">
     此套接字连接到的远程计算机的 IP 地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此套接字连接到的远程计算机的 IP 地址。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#DatagramSocket/connect()" class="- topic/link "><linktext class="- topic/linktext ">connect()</linktext></link></related-links></apiValue><apiValue id="flash.net:DatagramSocket:remotePort:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">remotePort</apiName><shortdesc class="- topic/shortdesc ">
     此套接字连接到的远程计算机的端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此套接字连接到的远程计算机的端口。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#DatagramSocket/connect()" class="- topic/link "><linktext class="- topic/linktext ">connect()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetGroupSendResult" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetGroupSendResult</apiName><shortdesc class="- topic/shortdesc ">
NetGroupSendResult 类是在返回与 NetGroup 实例关联的定向路由方法的值时使用的常量值的枚举。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
NetGroupSendResult 类是在返回与 NetGroup 实例关联的定向路由方法的值时使用的常量值的枚举。

</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNearest()</linktext></link><link href="flash.net.xml#NetGroup/sendToNeighbor()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNeighbor()</linktext></link><link href="flash.net.xml#NetGroup/sendToAllNeighbors()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToAllNeighbors()</linktext></link></related-links><apiValue id="flash.net:NetGroupSendResult:ERROR" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">ERROR</apiName><shortdesc class="- topic/shortdesc "> 
    表示在使用定向路由方法时出现错误（例如，无权限）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">error</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
    表示在使用定向路由方法时出现错误（例如，无权限）。
    
    </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetGroupSendResult:NO_ROUTE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">NO_ROUTE</apiName><shortdesc class="- topic/shortdesc "> 
    表示未找到任何可用来将消息路由到其请求目标的邻居。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">no route</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
    表示未找到任何可用来将消息路由到其请求目标的邻居。
    
    </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetGroupSendResult:SENT" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">SENT</apiName><shortdesc class="- topic/shortdesc "> 
    表示为消息找到路由并转发到其目标。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">sent</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
    表示为消息找到路由并转发到其目标。
    
    </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:URLRequestDefaults" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">URLRequestDefaults</apiName><shortdesc class="- topic/shortdesc ">
 URLRequestDefaults 类包含一些静态属性，可以设置这些属性以便为 URLRequest 类的属性定义默认值。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 URLRequestDefaults 类包含一些静态属性，可以设置这些属性以便为 URLRequest 类的属性定义默认值。该类还包括一个静态方法 <codeph class="+ topic/ph pr-d/codeph ">URLRequestDefaults.setLoginCredentialsForHost()</codeph>，使用该方法可以定义请求的默认身份验证凭据。URLRequest 类定义要在 HTTP 请求中使用的信息。 
 
 <p class="- topic/p ">URLRequest 对象中设置的任何属性都会覆盖为 URLRequestDefaults 类设置的那些静态属性。</p>
 
 <p class="- topic/p ">URLRequestDefault 设置仅适用于调用方应用程序域中的内容，但有一个例外：通过调用 <codeph class="+ topic/ph pr-d/codeph ">URLRequestDefaults.setLoginCredentialsForHost()</codeph> 进行的设置适用于当前正在运行的应用程序中的所有应用程序域。</p>
 
 <p class="- topic/p ">只有在应用程序安全沙箱中运行的 Adobe<sup class="+ topic/ph hi-d/sup ">®</sup> AIR<sup class="+ topic/ph hi-d/sup ">®</sup> 内容才能使用 URLRequestDefaults 类。访问此类的成员或属性时，其他内容会导致引发 SecurityError。</p>
 
 </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequest" class="- topic/link "><linktext class="- topic/linktext ">URLRequest</linktext></link></related-links><apiOperation id="flash.net:URLRequestDefaults:setLoginCredentialsForHost" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">setLoginCredentialsForHost</apiName><shortdesc class="- topic/shortdesc ">
	为选定的主机设置默认用户和密码凭据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
	
	</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="any" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">hostname</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">应用用户名和密码的主机名称。此名称可以是域，如 <codeph class="+ topic/ph pr-d/codeph ">"www.example.com"</codeph>；也可以是域和端口号，如 <codeph class="+ topic/ph pr-d/codeph ">"www.example.com:80"</codeph>。请注意，<codeph class="+ topic/ph pr-d/codeph ">"example.com"</codeph>、<codeph class="+ topic/ph pr-d/codeph ">"www.example.com"</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">"sales.example.com"</codeph>均视为唯一的主机。 
	
	</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">user</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要在针对指定主机进行的请求身份验证中使用的默认用户名。
	
	</apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">password</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要在针对指定主机进行的请求身份验证中使用的默认密码。
	
	</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	为选定的主机设置默认用户和密码凭据。这些设置适用于应用程序的所有应用程序域中的 URLRequest 对象，而不仅仅适用于调用此方法的对象的应用程序域中的 URLRequest 对象（但 URLRequest 类的静态属性只适用于调用方的应用程序域）。当应用程序的另一部分登录时，这可以让整个应用程序的内容登录（不管该内容位于哪个应用程序域）。
	
	<p class="- topic/p "><i class="+ topic/ph hi-d/i ">注意在 Mac OS 中运行的应用程序：</i>在 Mac OS 中调用此方法时，应用程序将对指定主机使用这些凭据，直到应用程序关闭为止，即使随后对同一主机调用 <codeph class="+ topic/ph pr-d/codeph ">URLRequestDefaults.setLoginCredentialsForHost()</codeph> 也是如此。但如果服务器拒绝此方法指定的凭据，则将识别随后对 <codeph class="+ topic/ph pr-d/codeph ">URLRequestDefaults.setLoginCredentialsForHost()</codeph> 方法（对于同一主机）的调用。</p>
	
	<p class="- topic/p "><i class="+ topic/ph hi-d/i ">注意：</i>此方法不适用于文件上载或 RTMP 请求中使用的 URLRequest 对象。</p>
	
	</apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:URLRequestDefaults:authenticate:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">authenticate</apiName><shortdesc class="- topic/shortdesc ">
	URLRequest 对象的 authenticate 属性的默认设置。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
	
	</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">authenticate</codeph> 属性的默认设置。在 URLRequest 对象中设置 <codeph class="+ topic/ph pr-d/codeph ">authenticate</codeph> 属性将覆盖此默认设置。
	
	<p class="- topic/p "><i class="+ topic/ph hi-d/i ">注意：</i>此设置不适用于文件上载或 RTMP 请求中使用的 URLRequest 对象。</p>
	
	</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequest/authenticate" class="- topic/link "><linktext class="- topic/linktext ">URLRequest.authenticate</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:cacheResponse:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">cacheResponse</apiName><shortdesc class="- topic/shortdesc ">
	URLRequest 对象的 cacheResponse 属性的默认设置。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
	
	</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">cacheResponse</codeph> 属性的默认设置。在 URLRequest 对象中设置 <codeph class="+ topic/ph pr-d/codeph ">cacheResponse</codeph> 属性将覆盖此默认设置。设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 时，AIR 应用程序的默认行为是使用操作系统的 HTTP 缓存。此设置不适用于文件上载或 RTMP 请求中使用的 URLRequest 对象。
	
	</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequest/cacheResponse" class="- topic/link "><linktext class="- topic/linktext ">URLRequest.cacheResponse</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:followRedirects:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">followRedirects</apiName><shortdesc class="- topic/shortdesc ">
	URLRequest 对象的 followRedirects 属性的默认设置。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
	
	</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">followRedirects</codeph> 属性的默认设置。在 URLRequest 对象中设置 <codeph class="+ topic/ph pr-d/codeph ">followRedirects</codeph> 属性将覆盖此默认设置。此设置不适用于文件上载或 RTMP 请求中使用的 URLRequest 对象。
	
	</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequest/followRedirects" class="- topic/link "><linktext class="- topic/linktext ">URLRequest.followRedirects</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:idleTimeout:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">idleTimeout</apiName><shortdesc class="- topic/shortdesc ">
	URLRequest 对象和 HTMLLoader 对象的 idleTimeout 属性的默认设置。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
	</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">idleTimeout 值为负。
	
	</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiDefaultValue>0
	
	</apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	URLRequest 对象和 HTMLLoader 对象的 <codeph class="+ topic/ph pr-d/codeph ">idleTimeout</codeph> 属性的默认设置。
	
	<p class="- topic/p ">空闲超时是指客户端在建立连接之后、放弃请求之前等待服务器响应的时间（以毫秒为单位）。</p>
	
	<p class="- topic/p ">它定义 URLRequest 或 HTMLLoader 对象使用的默认空闲超时。设置 URLRequest 对象或 HTMLLoader 对象中的 <codeph class="+ topic/ph pr-d/codeph ">idleTimeout</codeph> 属性将此覆盖默认设置。</p>
	
	<p class="- topic/p ">当此属性设置为 0（默认值）时，运行时使用操作系统定义的默认空闲超时值。默认空闲超时值随操作系统（如 Mac OS、Linux 或 Windows）和操作系统版本而变化。</p>
	
	<p class="- topic/p ">此设置不适用于文件上载或 RTMP 请求中使用的 URLRequest 对象。</p>
	
	</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="../../flash/html/HTMLLoader.html#idleTimeout" class="- topic/link "><linktext class="- topic/linktext ">HTMLLoader.idleTimeout</linktext></link><link href="flash.net.xml#URLRequest/idleTimeout" class="- topic/link "><linktext class="- topic/linktext ">URLRequest.idleTimeout</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:manageCookies:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">manageCookies</apiName><shortdesc class="- topic/shortdesc ">
	URLRequest 对象的 manageCookies 属性的默认设置。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
	
	</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">manageCookies</codeph> 属性的默认设置。在 URLRequest 对象中设置 <codeph class="+ topic/ph pr-d/codeph ">manageCookies</codeph> 属性将覆盖此默认设置。
	
	<p class="- topic/p "><i class="+ topic/ph hi-d/i ">注意：</i>此设置不适用于文件上载或 RTMP 请求中使用的 URLRequest 对象。</p>
	
	</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequest/manageCookies" class="- topic/link "><linktext class="- topic/linktext ">URLRequest.manageCookies</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:useCache:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">useCache</apiName><shortdesc class="- topic/shortdesc ">
	URLRequest 对象的 useCache 属性的默认设置。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
	
	</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
	
	</apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">useCache</codeph> 属性的默认设置。在 URLRequest 对象中设置 <codeph class="+ topic/ph pr-d/codeph ">useCache</codeph> 属性将覆盖此默认设置。此设置不适用于文件上载或 RTMP 请求中使用的 URLRequest 对象。
	
	</apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequest/useCache" class="- topic/link "><linktext class="- topic/linktext ">URLRequest.useCache</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequestDefaults:userAgent:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">userAgent</apiName><shortdesc class="- topic/shortdesc ">
	URLRequest 对象的 userAgent 属性的默认设置。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
	
	</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">userAgent</codeph> 属性的默认设置。在 URLRequest 对象中设置 <codeph class="+ topic/ph pr-d/codeph ">userAgent</codeph> 属性将覆盖此默认设置。
	
	<p class="- topic/p ">这也是用于所有 HTMLLoader 对象（调用 HTMLLoader 对象的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法时使用）的默认用户代理字符串。设置 HTMLLoader 对象的 <codeph class="+ topic/ph pr-d/codeph ">userAgent</codeph> 属性将覆盖 <codeph class="+ topic/ph pr-d/codeph ">URLRequestDefaults.userAgent</codeph> 设置。</p>
	
	<p class="- topic/p ">此默认值随着运行时操作系统（如 Mac OS、Linux 或 Windows）、运行时语言和运行时版本而变化，如下面的示例所示：</p>
	
	<ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"Mozilla/5.0 (Windows; U; en) AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5"</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/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 class="- topic/related-links "><link href="flash.net.xml#URLRequest/userAgent" class="- topic/link "><linktext class="- topic/linktext ">flash.net.URLRequest.userAgent</linktext></link><link href="../../flash/html/HTMLLoader.html#userAgent" class="- topic/link "><linktext class="- topic/linktext ">flash.html.HTMLLoader.userAgent</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetGroup" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetGroup</apiName><shortdesc class="- topic/shortdesc ">
NetGroup 类的实例表示 RTMFP 组中的成员资格。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
NetGroup 类的实例表示 RTMFP 组中的成员资格。使用此类执行以下操作：

<ul class="- topic/ul "><li class="- topic/li "><b class="+ topic/ph hi-d/b ">监视服务质量</b><codeph class="+ topic/ph pr-d/codeph ">info</codeph> 属性包含一个 NetGroupInfo 对象，该对象的属性为此组提供 QOS 统计数据。</li><li class="- topic/li "><b class="+ topic/ph hi-d/b ">发布</b>。调用 <codeph class="+ topic/ph pr-d/codeph ">post()</codeph> 以为组中的所有成员广播 ActionScript 消息。</li><li class="- topic/li "><b class="+ topic/ph hi-d/b ">直接路由</b>。调用 <codeph class="+ topic/ph pr-d/codeph ">sendToNearest()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">sendToNeighbor()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">sendToAllNeighbors()</codeph> 以将短数据消息发送给对等组中的特定成员。源和目标不需要进行直接连接。</li><li class="- topic/li "><b class="+ topic/ph hi-d/b ">对象复制</b>。调用 <codeph class="+ topic/ph pr-d/codeph ">addHaveObjects()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">removeHaveObjects()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">addWantObjects()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">removeWantObjects()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">writeRequestedObject()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">denyRequestedObject()</codeph> 以将大型数据分解成数据片段，然后将其复制到对等组中的所有节点。</li></ul>

<p class="- topic/p ">在客户端 NetGroup 类中，NetConnection 会调度以下事件：</p>

<ul class="- topic/ul "><li class="- topic/li ">NetGroup.Connect.Success</li><li class="- topic/li ">NetGroup.Connect.Failed</li><li class="- topic/li ">NetGroup.Connect.Rejected</li></ul>

<p class="- topic/p ">该事件对象的 <codeph class="+ topic/ph pr-d/codeph ">info.group</codeph> 属性包含对事件源 (NetGroup) 的引用。NetGroup 会调度所有其他事件。在服务器端 NetGroup 类中，NetGroup 会调度所有事件。</p>

<p class="- topic/p ">有关对等协助网络的信息，请参阅 Adobe 技术布道者 Tom Krcha 编写的 <xref href="http://www.flashrealtime.com/basics-of-p2p-in-flash/" scope="external" class="- topic/xref ">Flash 中的 P2P 基本知识</xref>。有关使用组合对等协助网络的信息，请参阅同样由 Tom Krcha 编写的 <xref href="http://tv.adobe.com/watch/max-2009-develop/social-media-experiences-with-flash-media-and-rtmfp/" scope="external" class="- topic/xref ">Flash Media 和 RTMFP 的社会媒体体验</xref>。</p>

<p class="- topic/p ">有关对等协助网络的技术细节的信息，请参阅 Adobe 计算机科学家 Matthew Kaufman 编写的<xref href="http://tv.adobe.com/watch/max-2009-develop/p2p-on-the-flash-platform-with-rtmfp" scope="external" class="- topic/xref "> Flash Platform 上的 P2P 与 RTMFP</xref>。</p>

</apiDesc><example conref="examples\NetGroupExample.as" class="- topic/example "> 这是一个使用对等网络的简单视频聊天应用程序。应用程序通过 RTMFP 连接到 Flash Media Server。服务器保留客户端应用程序的指纹并在客户端连接时管理对等组。但是，所有数据都是在客户端（对等机）之间发送的 -- 数据并不发送回服务器。
 <p class="- topic/p ">运行应用程序时，可以在文本输入字段中输入任何组名称。GroupSpecifier 类使用该名称（以及您设置的所有 GroupSpecifier 属性）来创建字符串，该字符串为该组的终身唯一名称。要将另一个客户端连接到该组，该客户端必须使用相同的组名称。例如，如果客户端 A 使用组名称“firstmesh”，要与客户端 A 通讯的其他客户端也必须使用组名称“firstmesh”。如果客户端 B 使用组名称“kite”，它将成功连接，但会创建一个新组，并将无法与“firstmesh”组中的客户端 A 或任何人进行通讯。</p>

 <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">


&lt;?xml version="1.0" encoding="utf-8"?>
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%" applicationComplete="OnApplicationComplete()">
    &lt;mx:Script>
        &lt;![CDATA[
            private var netConnection:NetConnection = null;
            private var netStream:NetStream = null;
            private var netGroup:NetGroup = null;
            private var video:Video = null;
            private var sequenceNumber:uint = 0;
            private var resizeTimer:Timer = null;

            private const SERVER:String = "rtmfp://fms.example.com/someapp";

            [Bindable] private var connected:Boolean = false;
            [Bindable] private var joinedGroup:Boolean = false;

            private function OnApplicationComplete():void
            {
                userName.text = "user " + int(Math.random() * 65536);

                groupName.text = "channel" + (int(Math.random() * 899) + 101);

                resizeTimer = new Timer(2000.0);
                resizeTimer.addEventListener(TimerEvent.TIMER, DoResizeVideo);
                resizeTimer.start();
            }

            private function StatusMessage(msg:Object):void
            {
                statusLog.text += msg;
                statusLog.verticalScrollPosition = statusLog.textHeight;
                statusLog.validateNow();
            }

            private function NetStatusHandler(e:NetStatusEvent):void
            {
                StatusMessage(e.info.code);
                switch(e.info.code)
                {
                case "NetConnection.Connect.Success":
                    OnConnect();
                    break;

                case "NetConnection.Connect.Closed":
                case "NetConnection.Connect.Failed":
                case "NetConnection.Connect.Rejected":
                case "NetConnection.Connect.AppShutdown":
                case "NetConnection.Connect.InvalidApp":
                    OnDisconnect();
                    break;

                case "NetStream.Connect.Success": // e.info.stream
                    OnNetStreamConnect();
                    break;

                case "NetStream.Connect.Rejected": // e.info.stream
                case "NetStream.Connect.Failed": // e.info.stream
                    DoDisconnect();
                    break;

                case "NetGroup.Connect.Success": // e.info.group
                    OnNetGroupConnect();
                    break;

                case "NetGroup.Connect.Rejected": // e.info.group
                case "NetGroup.Connect.Failed": // e.info.group
                    DoDisconnect();
                    break;

                case "NetGroup.Posting.Notify": // e.info.message, e.info.messageID
                    OnPosting(e.info.message);
                    break;


                case "NetStream.MulticastStream.Reset":
                case "NetStream.Buffer.Full":
                    DoResizeVideo();
                    break;

                case "NetGroup.SendTo.Notify": // e.info.message, e.info.from, e.info.fromLocal
                case "NetGroup.LocalCoverage.Notify": //
                case "NetGroup.Neighbor.Connect": // e.info.neighbor
                case "NetGroup.Neighbor.Disconnect": // e.info.neighbor
                case "NetGroup.MulticastStream.PublishNotify": // e.info.name
                case "NetGroup.MulticastStream.UnpublishNotify": // e.info.name
                case "NetGroup.Replication.Fetch.SendNotify": // e.info.index
                case "NetGroup.Replication.Fetch.Failed": // e.info.index
                case "NetGroup.Replication.Fetch.Result": // e.info.index, e.info.object
                case "NetGroup.Replication.Request": // e.info.index, e.info.requestID
                default:
                    break;
                }
            }

            private function DoConnect():void
            {
                StatusMessage("Connecting to \"" + SERVER + "\" ...\n");
                netConnection = new NetConnection();
                netConnection.addEventListener(NetStatusEvent.NET_STATUS, NetStatusHandler);
                netConnection.connect(SERVER);
            }

            private function OnConnect():void
            {
                var groupSpecifier:GroupSpecifier;

                StatusMessage("Connected\n");
                connected = true;

                groupSpecifier = new GroupSpecifier("max2009lab/" + groupName.text);
                groupSpecifier.multicastEnabled = true;
                groupSpecifier.postingEnabled = true;
                groupSpecifier.serverChannelEnabled = true;

                netStream = new NetStream(netConnection, groupSpecifier.groupspecWithAuthorizations());
                netStream.addEventListener(NetStatusEvent.NET_STATUS, NetStatusHandler);

                netGroup = new NetGroup(netConnection, groupSpecifier.groupspecWithAuthorizations());
                netGroup.addEventListener(NetStatusEvent.NET_STATUS, NetStatusHandler);

                StatusMessage("Join \"" + groupSpecifier.groupspecWithAuthorizations() + "\"\n");
            }

            private function OnNetStreamConnect():void
            {
                netStream.client = this;

                var mic:Microphone = Microphone.getMicrophone();
                if(mic)
                {
                    mic.codec = SoundCodec.SPEEX;
                    mic.setSilenceLevel(0);

                    netStream.attachAudio(mic);

                    StatusMessage("got microphone\n");
                }

                var camera:Camera = Camera.getCamera();
                if(camera)
                {
                    camera.setMode(320, 240, 10);
                    camera.setQuality(30000, 0);
                    camera.setKeyFrameInterval(15);

                    videoDisplay.attachCamera(camera);
                    videoDisplay.maintainAspectRatio = true;

                    netStream.attachCamera(camera);

                    StatusMessage("got camera\n");
                }

                netStream.publish("stream");
            }

            private function OnNetGroupConnect():void
            {
                joinedGroup = true;
            }

            private function DoDisconnect():void
            {
                if(netConnection)
                    netConnection.close();
                videoDisplay.attachCamera(null);
            }

            private function OnDisconnect():void
            {
                StatusMessage("Disconnected\n");
                netConnection = null;
                netStream = null;
                netGroup = null;
                connected = false;
                joinedGroup = false;
            }

            private function ClearChatText():void
            {
                chatText.text = "";
            }

            private function DoPost():void
            {
                var message:Object = new Object;

                message.user = userName.text;
                message.text = chatText.text;
                message.sequence = sequenceNumber++;
                message.sender = netConnection.nearID;

                netGroup.post(message);

                StatusMessage("==> " + chatText.text + "\n");

                chatText.callLater(ClearChatText);
            }

            private function OnPosting(message:Object):void
            {
                StatusMessage("&lt;" + message.user + "> " + message.text + "\n");
            }

            private function DoResizeVideo(ignored:* = null):void
            {
                if(video)
                {
                    if( (0 == video.videoHeight)
                     || (0 == video.videoWidth)
                    )
                    {
                        video.height = videoDisplay.height;
                        video.width = videoDisplay.width;
                        video.x = 0;
                        video.y = 0;
                    }
                    else
                    {
                        var videoAspect:Number = Number(video.videoWidth) / Number(video.videoHeight);
                        var displayAspect:Number = Number(videoDisplay.width) / Number(videoDisplay.height);
                        var adjustFactor:Number;

                        if(videoAspect >= displayAspect) // video is wider than display
                        {
                            adjustFactor = Number(video.videoWidth) / Number(videoDisplay.width);
                            video.width = videoDisplay.width;
                            video.height = int(Number(video.videoHeight) / adjustFactor);
                            video.x = 0;
                            video.y = int((videoDisplay.height - video.height) / 2);
                        }
                        else
                        {
                            adjustFactor = Number(video.videoHeight) / Number(videoDisplay.height);
                            video.height = videoDisplay.height;
                            video.width = int(Number(video.videoWidth) / adjustFactor);
                            video.x = int((videoDisplay.width - video.width) / 2);
                            video.y = 0;
                        }
                    }
                }
            }

            public function onPlayStatus(info:Object):void {}
            public function onMetaData(info:Object):void {}
            public function onCuePoint(info:Object):void {}
            public function onTextData(info:Object):void {}

            public function ValidateConnectAllowed(isConnected:Boolean, groupNameText:String):Boolean
            {
                return (!isConnected) &amp;&amp; (groupNameText.length > 0);
            }
        ]]&gt;
    &lt;/mx:Script>

    &lt;mx:VBox top="10" right="10" left="10" bottom="10" verticalGap="6">
        &lt;mx:HBox width="100%">
            &lt;mx:Text text="Group:"/>
            &lt;mx:TextInput id="groupName" width="100%" text="default" enabled="{!connected}"/>
            &lt;mx:Button label="Connect" click="DoConnect()" enabled="{ValidateConnectAllowed(connected, groupName.text)}" />
            &lt;mx:Button label="Disconnect" click="DoDisconnect()" enabled="{connected}" />
        &lt;/mx:HBox>
        &lt;mx:VideoDisplay id="videoDisplay" width="320" height="240" resize="DoResizeVideo()"/>
        &lt;mx:TextArea id="statusLog" width="100%" height="100%"/>
        &lt;mx:HBox width="100%">
            &lt;mx:TextInput id="userName" width="160" />
            &lt;mx:TextInput id="chatText" width="100%" enabled="{joinedGroup}" enter="DoPost()"/>
        &lt;/mx:HBox>
    &lt;/mx:VBox>

&lt;/mx:Application>
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier" class="- topic/link "><linktext class="- topic/linktext ">flash.net.GroupSpecifier</linktext></link><link href="flash.net.xml#NetStream" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream</linktext></link><link href="flash.events.xml#NetStatusEvent/info" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent info.code 值以“NetGroup”开始。</linktext></link></related-links><adobeApiEvent id="flash.net:NetGroup_flash.events.NetStatusEvent.NET_STATUS_netStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">netStatus</apiName><shortdesc class="- topic/shortdesc ">
 在 NetGroup 对象报告其状态或错误条件时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.NetStatusEvent.NET_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.NetStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 NetGroup 对象报告其状态或错误条件时调度。<codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件包含一个 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 属性。<codeph class="+ topic/ph pr-d/codeph ">info</codeph> 属性是一个对象，该对象包含有关该事件的信息，例如，连接尝试成功还是失败。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.events.xml#NetStatusEvent/info" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info</linktext></link></related-links></adobeApiEvent><apiConstructor id="flash.net:NetGroup:NetGroup" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">NetGroup</apiName><shortdesc class="- topic/shortdesc ">
     在指定的 NetConnection 对象上构造一个 NetGroup 并将其加入到 groupspec 指定的组。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetGroup, constructor
     </keyword></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">未连接 NetConnection 实例。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">此 groupspec 无效。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">connection</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:NetConnection</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 NetConnection 对象。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">groupspec</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定要加入的 RTMFP 对等组的字符串，包括其名称、该成员的能力、限制和授权。
     
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     new NetGroup(myConnection, myGroupSpecifier.groupspecWithAuthorizations());
     </codeblock>
     
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">在指定的 NetConnection 对象上构造一个 NetGroup 并将其加入到指定的组。
     
     </apiTipText></apiTipTexts></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在指定的 NetConnection 对象上构造一个 NetGroup 并将其加入到 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 指定的组。
     
     <p class="- topic/p ">大多数情况下，<codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 有可能使用本地系统上的网络上行链路。当使用 groupspec 构造 NetStream 或 NetGroup 对象时，Flash Player 将显示一个“隐私”对话框。该对话框询问 Flash Player 是否可以使用连接与用户的同级共享数据。如果用户单击“允许此域”，则用户下一次连接到此应用程序时将不显示该对话框。如果用户不允许对等协助网络，则将禁用组中的所有对等功能（发布、定向路由、对象复制和多播）。如果允许此权限，则会使用 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 对象的 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性中的 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Connect.Success</codeph> 将 NetStatusEvent 发送到 NetConnection 的事件侦听器。如果拒绝此权限，<codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性是 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Connect.Rejected</codeph>。在接收到 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Connect.Success</codeph> 事件之前，如果您尝试调用 NetGroup 对象的任何方法，将引发异常。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>当客户端订阅本机 IP 多播流时，不显示安全对话框。</p>
     
     </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Connect_Success" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Connect.Success"</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Connect_Rejected" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Connect.Rejected"</linktext></link><link href="flash.net.xml#NetConnection" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection</linktext></link><link href="flash.net.xml#GroupSpecifier" class="- topic/link "><linktext class="- topic/linktext ">flash.net.GroupSpecifier</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:NetGroup:addHaveObjects" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">addHaveObjects</apiName><shortdesc class="- topic/shortdesc ">
     将从 startIndex 到 endIndex 的对象添加到对象集，此节点将对象集作为要完成其请求的对象向邻居播发。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">传递给此方法的数字小于 0 或大于 9007199254740992。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">startIndex</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要添加到 Have 集的对象索引的起始范围。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">endIndex</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要添加到 Have 集的对象索引的结束范围。
     
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">将对象添加到对象集，此节点将对象集作为要完成其请求的对象向邻居播发。
     
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将从 <codeph class="+ topic/ph pr-d/codeph ">startIndex</codeph> 到 <codeph class="+ topic/ph pr-d/codeph ">endIndex</codeph> 的对象添加到对象集，此节点将对象集作为要完成其请求的对象向邻居播发。默认情况下，Have 集为空。索引必须是介于 0 和 9007199254740992 之间的整数。
     
     <p class="- topic/p ">有关对象复制的详细信息，请参阅<i class="+ topic/ph hi-d/i ">《Flash Media Server 开发人员指南》</i>中的<xref href="http://www.adobe.com/go/learn_fms_replicate_en" class="- topic/xref ">“在组内复制对象”</xref>。</p>
     
     <p class="- topic/p ">此方法使用 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 对象的 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性中的 <codeph class="+ topic/ph pr-d/codeph ">"NetGroup.Replication.Request"</codeph> 将 NetStatusEvent 发送到 NetGroup 的事件侦听器。 </p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在调用此方法之前对 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件进行测试。</p> 
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/removeHaveObjects()" class="- topic/link "><linktext class="- topic/linktext ">removeHaveObjects()</linktext></link><link href="flash.net.xml#NetGroup/writeRequestedObject()" class="- topic/link "><linktext class="- topic/linktext ">writeRequestedObject()</linktext></link><link href="flash.net.xml#NetGroup/denyRequestedObject()" class="- topic/link "><linktext class="- topic/linktext ">denyRequestedObject()</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Replication_Request" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Replication.Request"</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:addMemberHint" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">addMemberHint</apiName><shortdesc class="- topic/shortdesc ">
     手动添加一个记录以指定 peerID 为组成员。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若成功，则为 TRUE；若失败，则为 FALSE。
     
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">peerID</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要添加到潜在邻居的 peerID。
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">手动添加一个记录以指定 peerID 为组成员，但不必立即连接。
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     手动添加一个记录以指定 <codeph class="+ topic/ph pr-d/codeph ">peerID</codeph> 为组成员。仅当拓扑需要此记录时才尝试立即连接该记录。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addNeighbor()" class="- topic/link "><linktext class="- topic/linktext ">addNeighbor()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:addNeighbor" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">addNeighbor</apiName><shortdesc class="- topic/shortdesc ">
     通过立即直接连接到指定的 peerID 手动添加邻居，该 peerID 必须位于此组中。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若成功，则为 TRUE；若失败，则为 FALSE。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">peerID</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要立即连接的 peerID。
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">通过立即直接连接到指定的 peerID 手动添加邻居。
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     通过立即直接连接到指定的 <codeph class="+ topic/ph pr-d/codeph ">peerID</codeph> 手动添加邻居，该 peerID 必须位于此组中。如果拓扑不需要该直接连接，该直接连接可能稍后将删除。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addMemberHint()" class="- topic/link "><linktext class="- topic/linktext ">addMemberHint()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:addWantObjects" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">addWantObjects</apiName><shortdesc class="- topic/shortdesc ">
     将从 startIndex 到 endIndex 的对象添加到要检索的对象集。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">传递给此方法的数字小于 0 或大于 9007199254740992。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">startIndex</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要添加到 Want 集的对象索引的起始范围。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">endIndex</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要添加到 Want 集的对象索引的结束范围。
     
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">将对象添加到一组对象以检索。
     
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将从 <codeph class="+ topic/ph pr-d/codeph ">startIndex</codeph> 到 <codeph class="+ topic/ph pr-d/codeph ">endIndex</codeph> 的对象添加到要检索的对象集。索引必须是介于 0 和 9007199254740992 之间的整数。默认情况下，Want 集为空。
     
     <p class="- topic/p ">有关对象复制的详细信息，请参阅<i class="+ topic/ph hi-d/i ">《Flash Media Server 开发人员指南》</i>中的<xref href="http://www.adobe.com/go/learn_fms_replicate_en" class="- topic/xref ">“在组内复制对象”</xref>。</p>
     
     <p class="- topic/p ">此方法使用 <codeph class="+ topic/ph pr-d/codeph ">info.code</codeph> 属性中的 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Replication.Fetch.SendNotify</codeph> 将 NetStatusEvent 发送到 NetGroup 的事件侦听器。此事件后跟 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Replication.Fetch.Failed</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Replication.Fetch.Result</codeph> 事件。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在调用此方法之前对 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件进行测试。</p> 
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/removeWantObjects()" class="- topic/link "><linktext class="- topic/linktext ">removeWantObjects()</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Replication_Fetch_SendNotify" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Replication.Fetch.SendNotify"</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Replication_Fetch_Failed" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Replication.Fetch.Failed"</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Replication_Fetch_Result" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Replication.Fetch.Result"</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     断开与组的连接，然后关闭此 NetGroup。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     断开与组的连接，然后关闭此 NetGroup。此 NetGroup 在调用此方法后不可用。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetGroup:convertPeerIDToGroupAddress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">convertPeerIDToGroupAddress</apiName><shortdesc class="- topic/shortdesc ">
     将 peerID 转换为适合与 sendToNearest() 方法一起使用的组地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">peerID 的组地址。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">peerID</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要转换的 peerID。
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">将 peerID 转换为适合与 sendToNearest() 方法一起使用的组地址。
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将 peerID 转换为适合与 <codeph class="+ topic/ph pr-d/codeph ">sendToNearest()</codeph> 方法一起使用的组地址。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection/farID" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection.farID</linktext></link><link href="flash.net.xml#NetConnection/nearID" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection.nearID</linktext></link><link href="flash.net.xml#NetStream/farID" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.farID</linktext></link><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">sendToNearest()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:denyRequestedObject" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">denyRequestedObject</apiName><shortdesc class="- topic/shortdesc ">
     拒绝 NetStatusEvent NetGroup.Replication.Request 中收到的针对先前使用 addHaveObjects() 播发的对象的请求。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">requestID</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Replication.Request</codeph> 事件中给定的请求标识符。
     
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">拒绝对先前播发的对象的请求。
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     拒绝 NetStatusEvent <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Replication.Request</codeph> 中收到的针对先前使用 <codeph class="+ topic/ph pr-d/codeph ">addHaveObjects()</codeph> 播发的对象的请求。请求者可能再次请求此对象，除非或直到它从 Have 集撤出。
     
     <p class="- topic/p ">有关对象复制的详细信息，请参阅<i class="+ topic/ph hi-d/i ">《Flash Media Server 开发人员指南》</i>中的<xref href="http://www.adobe.com/go/learn_fms_replicate_en" class="- topic/xref ">“在组内复制对象”</xref>。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在调用此方法之前对 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件进行测试。</p> 
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addHaveObjects()" class="- topic/link "><linktext class="- topic/linktext ">addHaveObjects()</linktext></link><link href="flash.net.xml#NetGroup/writeRequestedObject()" class="- topic/link "><linktext class="- topic/linktext ">writeRequestedObject()</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Replication_Request" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Replication.Request"</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:post" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">post</apiName><shortdesc class="- topic/shortdesc ">
     将消息发送给组中的所有成员。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果发送，则为消息的 messageID；若出现错误，则为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。messageID 是消息的序列化的原始字节的十六进制 SHA256。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">message</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Object</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要发送给组中的所有其他成员的消息。
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将消息发送给组中的所有成员。要调用此方法，则 <codeph class="+ topic/ph pr-d/codeph ">GroupSpecifier.postingEnabled</codeph> 属性在已传递给 NetGroup 构造函数的 groupspec 中必须为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。有关详细信息，请参阅<i class="+ topic/ph hi-d/i ">《Flash Media Server 开发人员指南》</i>中的<xref href="http://www.adobe.com/go/learn_fms_post_en" class="- topic/xref ">“向组发布消息”</xref>。
     
     <p class="- topic/p ">所有消息都必须是唯一的；与早期发送的某一消息相同的消息可能不会传播。使用序列号使消息是唯一的。</p>
     
     <p class="- topic/p ">消息传送没有顺序。无法保证消息传送。</p>
     
     <p class="- topic/p ">消息在 AMF 中进行序列化。消息可以是下列类型之一：对象、整数、数字或字符串。消息不能是 MovieClip。</p>
     
     <p class="- topic/p ">此方法使用 <codeph class="+ topic/ph pr-d/codeph ">info.code</codeph> 属性中的 <codeph class="+ topic/ph pr-d/codeph ">"NetGroup.Posting.Notify"</codeph> 将 NetStatusEvent 发送到 NetGroup 的事件侦听器。<codeph class="+ topic/ph pr-d/codeph ">"NetGroup.Posting.Notify"</codeph> 事件被调度到客户端和服务器上的 NetGroup。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在调用此方法之前对 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件进行测试。</p> 
     
     </apiDesc><example conref="examples\NetGroupPostExample.as" class="- topic/example "> 这是一个使用对等网络的简单文本聊天应用程序。应用程序通过 RTMFP 连接到 Flash Media Server。服务器保留客户端应用程序的指纹并在客户端连接时管理对等组。但是，所有数据都是在客户端（对等机）之间发送的 -- 数据并不发送回服务器。
 <p class="- topic/p ">运行应用程序时，可以在文本输入字段中输入任何组名称。GroupSpecifier 类使用该名称（以及您设置的所有 GroupSpecifier 属性）来创建字符串，该字符串为该组的终身唯一名称。要将另一个客户端连接到该组，该客户端必须使用相同的组名称。例如，如果客户端 A 使用组名称“firstmesh”，要与客户端 A 通讯的其他客户端也必须使用组名称“firstmesh”。如果客户端 B 使用组名称“kite”，它将成功连接，但会创建一个新组，并将无法与“firstmesh”组中的客户端 A 或任何人进行通讯。</p>
 <p class="- topic/p ">要运行此示例，将 Button、Label、TextInput 和 TextArea 组件添加到 Flash Pro 中的库。</p>
 
 <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">



package  {

    import flash.display.Sprite;
    import flash.events.TextEvent;
    import flash.events.MouseEvent;
    import flash.events.NetStatusEvent;
    import fl.events.ComponentEvent;
    import fl.controls.Label;
    import fl.controls.Button;
    import fl.controls.TextInput;
    import fl.controls.TextArea;
    import flash.text.TextFieldAutoSize;
    import flash.net.*;

    public class NetGroupPostExample extends Sprite{

        private var connectButton:Button;
        private var disconnectButton:Button;
        private var groupNameText:TextInput;
        private var userNameText:TextInput;
        private var chatText:TextInput;
        private var statusLog:TextArea;
        private var groupLabel:Label;
        private var userLabel:Label;

        private var netConnection:NetConnection = null;
        private var netGroup:NetGroup = null;
        private var sequenceNumber:uint = 0;
        private var connected:Boolean = false;
        private var joinedGroup:Boolean = false;

        private const SERVER:String = "rtmfp://fms.example.com/someapp";

        public function NetGroupPostExample() {
            DoUI();
        }

        // Writes messages to the TextArea.
        private function StatusMessage(msg:Object):void{
            statusLog.text += msg;
            statusLog.verticalScrollPosition = statusLog.textHeight;
            statusLog.validateNow();
        }

        // Handles all NetStatusEvents for the NetConnection and the NetGroup.
        // This code includes cases it doesn't handle so you can see the cases
        // and their info objects for learning purposes.
        private function NetStatusHandler(e:NetStatusEvent):void{
            StatusMessage(e.info.code + "\n");
            switch(e.info.code){
                case "NetConnection.Connect.Success":
                    connectButton.enabled = false;
                    disconnectButton.enabled = true;
                    OnConnect();
                    break;

                case "NetConnection.Connect.Closed":
                    OnDisconnect();
                    break;

                case "NetGroup.Connect.Success": // e.info.group
                    OnNetGroupConnect();
                    break;

                case "NetGroup.Connect.Rejected": // e.info.group
                case "NetGroup.Connect.Failed": // e.info.group
                    break;

                case "NetGroup.Posting.Notify": // e.info.message, e.info.messageID
                    OnPosting(e.info.message);
                    break;

                case "NetStream.MulticastStream.Reset":
                case "NetStream.Buffer.Full":
                    break;

                case "NetGroup.SendTo.Notify": // e.info.message, e.info.from, e.info.fromLocal
                case "NetGroup.LocalCoverage.Notify": //
                case "NetGroup.Neighbor.Connect": // e.info.neighbor
                case "NetGroup.Neighbor.Disconnect": // e.info.neighbor
                case "NetGroup.MulticastStream.PublishNotify": // e.info.name
                case "NetGroup.MulticastStream.UnpublishNotify": // e.info.name
                case "NetGroup.Replication.Fetch.SendNotify": // e.info.index
                case "NetGroup.Replication.Fetch.Failed": // e.info.index
                case "NetGroup.Replication.Fetch.Result": // e.info.index, e.info.object
                case "NetGroup.Replication.Request": // e.info.index, e.info.requestID
                default:
                    break;
                }
            }
        // Creates a NetConnection to Flash Media Server if the app isn't already connected
        // and if there's a group name in the TextInput field.
        private function DoConnect(e:MouseEvent):void{
            if(!connected &amp;&amp; (groupNameText.length > 0)){
                StatusMessage("Connecting to \"" + SERVER + "\" ...\n");
                netConnection = new NetConnection();
                netConnection.addEventListener(NetStatusEvent.NET_STATUS, NetStatusHandler);
                // To connect to Flash Media Server, pass the server name.
                netConnection.connect(SERVER);
            }
            else
            {
                StatusMessage("Enter a group name");
            }
        }

        // Called in the "NetConnection.Connect.Success" case in the NetStatusEvent handler.
        private function OnConnect():void{

            StatusMessage("Connected\n");
            connected = true;

            // Create a GroupSpecifier object to pass to the NetGroup constructor.
            // The GroupSpecifier determines the properties of the group
            var groupSpecifier:GroupSpecifier;
            groupSpecifier = new GroupSpecifier("aslrexample/" + groupNameText.text);
            groupSpecifier.postingEnabled = true;
            groupSpecifier.serverChannelEnabled = true;

            netGroup = new NetGroup(netConnection, groupSpecifier.groupspecWithAuthorizations());
            netGroup.addEventListener(NetStatusEvent.NET_STATUS, NetStatusHandler);

            StatusMessage("Join \"" + groupSpecifier.groupspecWithAuthorizations() + "\"\n");

        }

        private function OnNetGroupConnect():void{
            joinedGroup = true;
        }

        private function DoDisconnect(e:MouseEvent):void{
            if(netConnection){
                netConnection.close();
            }
        }

        private function OnDisconnect():void{
            StatusMessage("Disconnected\n");
            netConnection = null;
            netGroup = null;
            connected = false;
            joinedGroup = false;
            connectButton.enabled = true;
            disconnectButton.enabled = false;
        }

        private function ClearChatText():void{
            chatText.text = "";
        }

        // Called when you the chatText field has focus and you press Enter.
        private function DoPost(e:ComponentEvent):void{
            if(joinedGroup){
                var message:Object = new Object;
                message.user = userNameText.text;
                message.text = chatText.text;
                message.sequence = sequenceNumber++;
                message.sender = netConnection.nearID;

                netGroup.post(message);
                StatusMessage("==> " + chatText.text + "\n");
            } else {
                StatusMessage("Click Connect before sending a chat message");
            }
            ClearChatText();
        }

        private function OnPosting(message:Object):void{
            StatusMessage("&lt;" + message.user + "> " + message.text + "\n");
        }

        private function DoUI():void {

            groupLabel = new Label();
            groupLabel.move(20, 10);
            groupLabel.autoSize = TextFieldAutoSize.LEFT
            groupLabel.text = "Group name:"
            addChild(groupLabel);

            groupNameText = new TextInput();
            groupNameText.move(90, 10);
            groupNameText.text = "channel" + (int(Math.random() * 899) + 101);
            addChild(groupNameText);

            connectButton = new Button();
            connectButton.addEventListener(MouseEvent.CLICK, DoConnect);
            connectButton.move(205, 10);
            connectButton.label = "Connect";
            addChild(connectButton);

            disconnectButton = new Button();
            disconnectButton.addEventListener(MouseEvent.CLICK, DoDisconnect);
            disconnectButton.move(310, 10);
            disconnectButton.label = "Disconnect";
            disconnectButton.enabled = false;
            addChild(disconnectButton);

            statusLog = new TextArea();
            statusLog.move(30, 38);
            statusLog.width = 360;
            statusLog.height = 215;
            statusLog.editable = false;
            addChild(statusLog);

            userLabel = new Label();
            userLabel.move(20, 270);
            userLabel.autoSize = TextFieldAutoSize.LEFT
            userLabel.text = "User name:"
            addChild(userLabel);

            userNameText = new TextInput();
            userNameText.move(80, 270);
            userNameText.text = "user " + int(Math.random() * 65536);
            addChild(userNameText);

            chatText = new TextInput();
            chatText.addEventListener(ComponentEvent.ENTER, DoPost);
            chatText.move(185, 270);
            chatText.maxChars = 255;
            chatText.width = 215;
            addChild(chatText);

        }

        public function onPlayStatus(info:Object):void {}
        public function onMetaData(info:Object):void {}
        public function onCuePoint(info:Object):void {}
        public function onTextData(info:Object):void {}

    }

}




</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Posting_Notify" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Posting.Notify"</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:removeHaveObjects" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">removeHaveObjects</apiName><shortdesc class="- topic/shortdesc ">
     将从 startIndex 到 endIndex 的对象从对象集中删除，此节点将对象集作为其完成请求的对象播发到邻居。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">传递给此方法的数字小于 0 或大于 9007199254740992。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">startIndex</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要从 Have 集删除的对象索引的起始范围。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">endIndex</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要从 Have 集删除的对象索引的结束范围。
     
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">将对象从对象集中删除，此节点将对象集作为其完成请求的对象播发到邻居。
     
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将从 <codeph class="+ topic/ph pr-d/codeph ">startIndex</codeph> 到 <codeph class="+ topic/ph pr-d/codeph ">endIndex</codeph> 的对象从对象集中删除，此节点将对象集作为其完成请求的对象播发到邻居。索引必须是介于 0 和 9007199254740992 之间的整数。
     
     <p class="- topic/p ">有关对象复制的详细信息，请参阅<i class="+ topic/ph hi-d/i ">《Flash Media Server 开发人员指南》</i>中的<xref href="http://www.adobe.com/go/learn_fms_replicate_en" class="- topic/xref ">“在组内复制对象”</xref>。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在调用此方法之前对 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件进行测试。</p> 
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addHaveObjects()" class="- topic/link "><linktext class="- topic/linktext ">addHaveObjects()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:removeWantObjects" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">removeWantObjects</apiName><shortdesc class="- topic/shortdesc ">
     从要检索的对象集中删除从 startIndex 到 endIndex 的对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">传递给此方法的数字小于 0 或大于 9007199254740992。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">startIndex</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">从 Want 集删除的对象索引的起始范围。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">endIndex</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">从 Want 集删除的对象索引的结束范围。
     
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">从一组要检索的对象删除对象。
     
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从要检索的对象集中删除从 <codeph class="+ topic/ph pr-d/codeph ">startIndex</codeph> 到 <codeph class="+ topic/ph pr-d/codeph ">endIndex</codeph> 的对象。索引必须是介于 0 和 9007199254740992 之间的整数。
     
     <p class="- topic/p ">有关对象复制的详细信息，请参阅<i class="+ topic/ph hi-d/i ">《Flash Media Server 开发人员指南》</i>中的<xref href="http://www.adobe.com/go/learn_fms_replicate_en" class="- topic/xref ">“在组内复制对象”</xref>。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在调用此方法之前对 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件进行测试。</p> 
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addWantObjects()" class="- topic/link "><linktext class="- topic/linktext ">addWantObjects()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:sendToAllNeighbors" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">sendToAllNeighbors</apiName><shortdesc class="- topic/shortdesc ">
     将消息发送给所有邻居。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">枚举类 NetGroupSendResult 的属性表示发送成功或失败。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">message</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Object</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要发送的消息。
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将消息发送给所有邻居。如果选择了至少一个邻居，则返回 <codeph class="+ topic/ph pr-d/codeph ">NetGroupSendResult.SENT</codeph>。
     
     <p class="- topic/p ">有关路由消息的详细信息，请参阅<i class="+ topic/ph hi-d/i ">《Flash Media Server 开发人员指南》</i>中的<xref href="http://www.adobe.com/go/learn_fms_direct_routing_en" class="- topic/xref ">“将消息直接路由到同级”</xref>。</p>
     
     <p class="- topic/p ">当节点接收消息时，NetStatusEvent 将发送到 NetGroup 的事件侦听器，其中 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 对象的 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.SendTo.Notify</codeph>。 </p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在调用此方法之前对 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件进行测试。</p> 
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/sendToNeighbor()" class="- topic/link "><linktext class="- topic/linktext ">sendToNeighbor()</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_SendTo_Notify" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.SendTo.Notify"</linktext></link><link href="flash.net.xml#NetGroupSendResult" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroupSendResult</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:sendToNearest" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">sendToNearest</apiName><shortdesc class="- topic/shortdesc ">
     将消息发送给最接近指定的组地址的邻居（或本地节点）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">枚举类 NetGroupSendResult 的属性表示发送成功或失败。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">message</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Object</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要发送的消息。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">groupAddress</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">向其路由消息的组地址。
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将消息发送给最接近指定的组地址的邻居（或本地节点）。考虑整个环上的邻居。如果消息成功发送到其目标，则返回 <codeph class="+ topic/ph pr-d/codeph ">NetGroupSendResult.SENT</codeph>。 
     
     <p class="- topic/p ">有关路由消息的详细信息，请参阅<i class="+ topic/ph hi-d/i ">《Flash Media Server 开发人员指南》</i>中的<xref href="http://www.adobe.com/go/learn_fms_direct_routing_en" class="- topic/xref ">“将消息直接路由到同级”</xref>。</p>
     
     <p class="- topic/p ">当节点接收消息时，NetStatusEvent 将发送到 NetGroup 的事件侦听器，其中 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 对象的 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.SendTo.Notify</codeph>。 </p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在调用此方法之前对 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件进行测试。</p> 
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/convertPeerIDToGroupAddress()" class="- topic/link "><linktext class="- topic/linktext ">convertPeerIDToGroupAddress()</linktext></link><link href="flash.net.xml#NetGroup/receiveMode" class="- topic/link "><linktext class="- topic/linktext ">receiveMode</linktext></link><link href="flash.net.xml#NetGroupSendResult" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroupSendResult</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_SendTo_Notify" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.SendTo.Notify"</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:sendToNeighbor" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">sendToNeighbor</apiName><shortdesc class="- topic/shortdesc ">
     将消息发送到由 sendMode 参数指定的邻居。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">枚举类 NetGroupSendResult 的属性表示发送成功或失败。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">message</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Object</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要发送的消息。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">sendMode</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">枚举类 NetGroupSendMode 的属性指定向其发送消息的邻居。
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">将消息发送到 sendMode 参数指定的邻居。
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将消息发送到 <codeph class="+ topic/ph pr-d/codeph ">sendMode</codeph> 参数指定的邻居。如果消息成功发送到其请求目标，则返回 <codeph class="+ topic/ph pr-d/codeph ">NetGroupSendResult.SENT</codeph>。
     
     <p class="- topic/p ">有关路由消息的详细信息，请参阅<i class="+ topic/ph hi-d/i ">《Flash Media Server 开发人员指南》</i>中的<xref href="http://www.adobe.com/go/learn_fms_direct_routing_en" class="- topic/xref ">“将消息直接路由到同级”</xref>。</p>
     
     <p class="- topic/p ">当节点接收消息时，NetStatusEvent 将发送到 NetGroup 的事件侦听器，其中 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 对象的 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.SendTo.Notify</codeph>。 </p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在调用此方法之前对 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件进行测试。</p> 
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/sendToAllNeighbors()" class="- topic/link "><linktext class="- topic/linktext ">sendToAllNeighbors()</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_SendTo_Notify" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.SendTo.Notify"</linktext></link><link href="flash.net.xml#NetGroupSendMode" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroupSendMode</linktext></link><link href="flash.net.xml#NetGroupSendResult" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroupSendResult</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetGroup:writeRequestedObject" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">writeRequestedObject</apiName><shortdesc class="- topic/shortdesc ">
     当 NetStatusEvent NetGroup.Replication.Request 收到针对先前使用 addHaveObjects() 方法播发的对象的请求时，满足请求。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">requestID</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Replication.Request</codeph> 事件中给定的请求标识符。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">object</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Object</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">与 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Replication.Request</codeph> 事件中给定的索引对应的对象。
     
     </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">满足针对先前播发的对象的请求。
     
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     当 NetStatusEvent <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Replication.Request</codeph> 收到针对先前使用 <codeph class="+ topic/ph pr-d/codeph ">addHaveObjects()</codeph> 方法播发的对象的请求时，满足请求。<codeph class="+ topic/ph pr-d/codeph ">object</codeph> 可以是下列任何类型：对象、整数、数字和字符串。<codeph class="+ topic/ph pr-d/codeph ">object</codeph> 不能是 MovieClip。
     
     <p class="- topic/p ">有关对象复制的详细信息，请参阅<i class="+ topic/ph hi-d/i ">《Flash Media Server 开发人员指南》</i>中的<xref href="http://www.adobe.com/go/learn_fms_replicate_en" class="- topic/xref ">“在组内复制对象”</xref>。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在调用此方法之前对 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件进行测试。</p> 
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addHaveObjects()" class="- topic/link "><linktext class="- topic/linktext ">addHaveObjects()</linktext></link><link href="flash.net.xml#NetGroup/denyRequestedObject()" class="- topic/link "><linktext class="- topic/linktext ">denyRequestedObject()</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Replication_Request" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Replication.Request"</linktext></link></related-links></apiOperation><apiValue id="flash.net:NetGroup:estimatedMemberCount:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">estimatedMemberCount</apiName><shortdesc class="- topic/shortdesc ">
     根据本地邻点的密度并假设组地址均匀分布来指定估计的组成员数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Q for dev: why would someone use this instead of neighborcount? --brs
     </internal></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">指定估计的组成员数。
     
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     根据本地邻点的密度并假设组地址均匀分布来指定估计的组成员数。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/neighborCount" class="- topic/link "><linktext class="- topic/linktext ">neighborCount</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroup:info:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">info</apiName><shortdesc class="- topic/shortdesc ">
     返回一个 NetGroupInfo 对象，其属性提供有关此 NetGroup 的 RTMFP 对等数据传输的服务质量统计信息。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.net:NetGroupInfo</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">返回一个 NetGroupInfo 对象，其属性提供服务质量统计数据。
     
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回一个 NetGroupInfo 对象，其属性提供有关此 NetGroup 的 RTMFP 对等数据传输的服务质量统计信息。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroupInfo" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroupInfo</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroup:localCoverageFrom:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">localCoverageFrom</apiName><shortdesc class="- topic/shortdesc ">
     指定此节点距离“最近”并对其负责的组地址的开始范围。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定此节点距离“最近”并对其负责的组地址的开始范围。在沿组地址的环路报文 2<sup class="+ topic/ph hi-d/sup ">256</sup> 增长的方向上指定范围。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/localCoverageTo" class="- topic/link "><linktext class="- topic/linktext ">localCoverageTo</linktext></link><link href="flash.net.xml#NetGroup/receiveMode" class="- topic/link "><linktext class="- topic/linktext ">receiveMode</linktext></link><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">sendToNearest()</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_LocalCoverage_Notify" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.LocalCoverage.Notify"</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroup:localCoverageTo:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">localCoverageTo</apiName><shortdesc class="- topic/shortdesc ">
     指定此节点距离“最近”并对其负责的组地址的结尾范围。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定此节点距离“最近”并对其负责的组地址的结尾范围。在沿组地址的环路报文 2<sup class="+ topic/ph hi-d/sup ">256</sup> 增长的方向上指定范围。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/localCoverageFrom" class="- topic/link "><linktext class="- topic/linktext ">localCoverageFrom</linktext></link><link href="flash.net.xml#NetGroup/receiveMode" class="- topic/link "><linktext class="- topic/linktext ">receiveMode</linktext></link><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">sendToNearest()</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_LocalCoverage_Notify" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.LocalCoverage.Notify"</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroup:neighborCount:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">neighborCount</apiName><shortdesc class="- topic/shortdesc ">
     指定与此节点直接连接的组成员数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">指定与此节点直接连接的组成员数。
     
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定与此节点直接连接的组成员数。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addNeighbor()" class="- topic/link "><linktext class="- topic/linktext ">addNeighbor()</linktext></link><link href="flash.net.xml#NetGroup/estimatedMemberCount" class="- topic/link "><linktext class="- topic/linktext ">estimatedMemberCount</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Neighbor_Connect" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Neighbor.Connect"</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetGroup_Neighbor_Disconnect" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code="NetGroup.Neighbor.Disconnect"</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroup:receiveMode:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">receiveMode</apiName><shortdesc class="- topic/shortdesc ">
     指定此节点的路由接收模式作为 NetGroupReceiveMode enum 类中的一个值。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定此节点的路由接收模式作为 NetGroupReceiveMode enum 类中的一个值。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/localCoverageFrom" class="- topic/link "><linktext class="- topic/linktext ">localCoverageFrom</linktext></link><link href="flash.net.xml#NetGroup/localCoverageTo" class="- topic/link "><linktext class="- topic/linktext ">localCoverageTo</linktext></link><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">sendToNearest()</linktext></link><link href="flash.net.xml#NetGroupReceiveMode" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroupReceiveMode</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroup:replicationStrategy:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">replicationStrategy</apiName><shortdesc class="- topic/shortdesc ">
     指定对象复制获取策略。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定对象复制获取策略。此值是 NetGroupReplicationStrategy 类中的枚举值之一。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroupReplicationStrategy" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroupReplicationStrategy</linktext></link></related-links></apiValue></apiClassifier><apiOperation id="globalOperation:flash.net:getClassByAlias" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">getClassByAlias</apiName><shortdesc class="- topic/shortdesc ">
     查找一个类，这个类先前具有一个通过调用 registerClassAlias() 方法进行注册的别名。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>includeExample examples\GetClassByAliasExample.as -noswf
      
      </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">未注册别名。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ReferenceError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ReferenceError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">与给定别名相关联的类。如果未找到，将引发异常。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Class</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">aliasName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要查找的别名。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     查找一个类，这个类先前具有一个通过调用 <codeph class="+ topic/ph pr-d/codeph ">registerClassAlias()</codeph> 方法进行注册的别名。
     <p class="- topic/p ">此方法不与 <codeph class="+ topic/ph pr-d/codeph ">flash.utils.getDefinitionByName()</codeph> 方法进行交互。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#/registerClassAlias()" class="- topic/link "><linktext class="- topic/linktext ">registerClassAlias()</linktext></link></related-links></apiOperation><apiOperation id="globalOperation:flash.net:navigateToURL" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">navigateToURL</apiName><shortdesc class="- topic/shortdesc ">
     在包含 Flash Player 容器的应用程序（通常是一个浏览器）中，打开或替换一个窗口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>throws IOError The "digest" and "importToSandbox" properties of URLRequest
     are not supported by URLLoader.navigate.
     
     </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><codeph class="+ topic/ph pr-d/codeph ">request</codeph> 对象的 <codeph class="+ topic/ph pr-d/codeph ">digest</codeph> 属性不是 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。如果在加载 SWZ 文件（一个 Adobe 平台组件）时调用 <codeph class="+ topic/ph pr-d/codeph ">URLLoader.load()</codeph> 方法，仅应设置 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">digest</codeph> 属性。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在 Flash Player（和 Adobe AIR 中的非应用程序沙箱内容）中，以下情况将引发此错误：
     <ul class="- topic/ul "><li class="- topic/li ">本地不受信任的 SWF 文件可能无法与 Internet 进行通信。要避免这种情况，可将此 SWF 文件重新分类为只能与远程内容交互或受信任。</li><li class="- topic/li ">导航操作试图评估伪 URL 的脚本编写，但包含文档（通常是浏览器中的一个 HTML 文档）来自您不具有访问权限的沙箱。要避免这种情况，可以在包含文档中指定 <codeph class="+ topic/ph pr-d/codeph ">allowScriptAccess="always"</codeph>。</li><li class="- topic/li ">如果 SWF 文件包含在已将 <codeph class="+ topic/ph pr-d/codeph ">allowScriptAccess</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">"none"</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">"sameDomain"</codeph> 的 HTML 页中，而此 HTML 文件与 SWF 文件的域不匹配，将无法导航特殊窗口 <codeph class="+ topic/ph pr-d/codeph ">"_self"</codeph>、<codeph class="+ topic/ph pr-d/codeph ">"_top"</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">"_parent"</codeph>。</li><li class="- topic/li ">不能导航具有非默认名称的窗口，非默认名称来自位于 local-with-filesystem 沙箱中的 SWF 文件。</li><li class="- topic/li ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。</li></ul>
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">为了响应用户动作（如鼠标事件或按键事件），将不会调用此方法。此要求仅适用于 Flash Player 中的内容和 Adobe AIR 中的非应用程序沙箱内容。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">request</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:URLRequest</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">URLRequest 对象，指定要导航到哪个 URL。
     
     <p class="- topic/p "><ph class="- topic/ph ">对于在 Adobe AIR 中运行的内容，当</ph>使用 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL()</codeph> 函数时，运行时将使用 POST 方法的 URLRequest（其 <codeph class="+ topic/ph pr-d/codeph ">method</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph>）视为使用 GET 方法。</p>
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">window</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">浏览器窗口或 HTML 帧，其中显示 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> 参数表示的文档。可以输入某个特定窗口的名称，或使用以下值之一：
     <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"_self"</codeph> 指定当前窗口中的当前帧。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"_blank"</codeph> 指定一个新窗口。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"_parent"</codeph> 指定当前帧的父级。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"_top"</codeph> 指定当前窗口中的顶级帧。</li></ul>
     <p class="- topic/p ">如果没有为此参数指定值，将创建一个新的空窗口。在独立播放器中，可以指定新的 (<codeph class="+ topic/ph pr-d/codeph ">"_blank"</codeph>) 窗口，也可以指定已命名的窗口。其他值不适用。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果在只能与本地文件系统内容交互的沙箱中运行的 SWF 文件中的代码调用 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL()</codeph> 函数，并为 <codeph class="+ topic/ph pr-d/codeph ">window</codeph> 参数指定一个自定义窗口名称，该窗口名称将转换为一个随机名称。该名称的格式为 <codeph class="+ topic/ph pr-d/codeph ">"_flashXXXXXXXX"</codeph>，其中每个 X 均代表一个随机的十六进制数字。在同一会话中（直到您关闭包含浏览器窗口），如果您再次调用该函数并为 <codeph class="+ topic/ph pr-d/codeph ">window</codeph> 参数指定同一名称，将使用同一个随机字符串。</p>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     <ph class="- topic/ph ">在包含 Flash Player 容器的应用程序（通常是一个浏览器）中，打开或替换一个窗口。在 Adobe AIR 中，该函数在默认的系统 web 浏览器中打开一个 URL</ph>
     
     
      <p class="- topic/p ">  <b class="+ topic/ph hi-d/b "><i class="+ topic/ph hi-d/i ">重要安全提示 </i></b> </p>
      <p class="- topic/p ">开发人员通常将获取自 FlashVars 等外部来源的 URL 值传递给 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL()</codeph> 函数。攻击者可能会尝试操纵这些外部来源，以进行跨站脚本等攻击。因此，开发人员应该验证所有 URL，然后才能将其传递给此函数。 </p>
      
     <p class="- topic/p ">良好的 URL 数据验证蕴含着许多不同的技术，具体取决于 URL 在整个应用程序中的用法。最常用的数据验证技术包括了验证 URL 的方案是否适当。例如，无意中允许 javascript: URL 可能会导致跨站脚本攻击。验证 URL 位于您的域内可以确保进行仿冒攻击的人无法使用 SWF 文件作为 open 请求的重定向器。如要增强安全性，还可以验证 URL 的路径，并验证 URL 符合 RFC 指导原则。</p>
     
     <p class="- topic/p ">例如，以下代码展示了一个执行数据验证的简单示例，其中拒绝不以 http:// 或 https:// 开头的任何 URL，并验证 URL 在您的域名范围内。此例可能并不适用于所有 Web 应用程序，因此您应该考虑是否需要针对 URL 进行其他检查。 </p>
     
      <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     // 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 >= 4096) {
          return (false);
        }
        return (true);
     }  
     
      </codeblock>
     <p class="- topic/p ">对于在浏览器中运行的<i class="+ topic/ph hi-d/i ">本地</i> 内容，只有在 SWF 文件和包含该文件的 Web 页（如果有）位于受信任的本地安全沙箱时，才允许调用指定 <codeph class="+ topic/ph pr-d/codeph ">"javascript:"</codeph> 伪协议（通过作为第一个参数传递的 <codeph class="+ topic/ph pr-d/codeph ">URLRequest</codeph> 对象）的 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL()</codeph> 方法。一些浏览器不支持通过 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL()</codeph> 方法使用 javascript 协议。而应考虑使用 <codeph class="+ topic/ph pr-d/codeph ">ExternalInterface</codeph> API 的 <codeph class="+ topic/ph pr-d/codeph ">call()</codeph> 方法在包含该内容的 HTML 页中调用 JavaScript 方法。</p>
     
      <p class="- topic/p ">在 Flash Player 和 Adobe AIR 中的非应用程序沙箱中，您无法连接常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。</p>
     
     <p class="- topic/p ">在浏览器中运行的 Flash Player 10 和更高版本中，以编程方式使用此方法打开弹出窗口可能不会成功。不同的浏览器（和浏览器配置）可能会随时阻止弹出窗口；不能保证可以显示任何弹出窗口。不过，为了尽可能成功，请仅在作为用户操作的直接结果执行的代码中使用此方法打开弹出窗口，例如，在鼠标单击或按键事件的事件处理函数中。</p>
     
     <p class="- topic/p "> 在 Flash Player 10 和更高版本中，如果使用包含上载（由 POST 体内的“content-disposition”标头中的“filename”参数表示）的 multipart Content-Type（例如“multipart/form-data”），则 POST 操作会受应用于上载的安全规则的约束：</p>
     <ul class="- topic/ul "><li class="- topic/li ">必须执行 POST 操作以响应用户启动的操作（如鼠标单击或按键）。</li><li class="- topic/li ">如果 POST 操作是跨域的（POST 目标与发送 POST 请求的 SWF 文件不在同一台服务器上），则目标服务器必须提供一个允许跨域访问的 URL 策略文件。</li></ul>
     <p class="- topic/p ">另外，对于任何 multipart Content-Type，语法必须有效（根据 RFC2046 标准）。如果语法无效，则 POST 操作受应用于上载的安全规则约束。</p>
     
     
     
     <p class="- topic/p ">在 AIR 中，移动平台上支持 sms: 和 tel: URI 方案。在 Android 上，支持 vipaccess:、connectpro: 和 market: URI 方案。URL 语法遵循平台约定。例如，在 Android 上，URI 方案必须小写。当您使用这些方案之一导航到 URL 时，运行时在用于处理此方案的默认应用程序中打开 URL。因此，导航到 <codeph class="+ topic/ph pr-d/codeph ">tel:+5555555555</codeph> 会打开电话拨号程序，其中已输入指定的号码。必须具有可处理 URL 用的单独应用程序或实用程序（例如电话拨号程序）。</p>
     
     <p class="- topic/p ">下面的代码展示了如何在 Android 上调用 VIP Access 和 Connect Pro 应用程序：</p>
     
      <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
       //Invoke the VIP Access Application.
       navigateToURL(new URLRequest("vipaccess://com.verisign.mvip.main?action=securitycode"));
     
       //Invoke the Connect Pro Application.
       navigateToURL(new URLRequest("connectpro://"));
     
      </codeblock>
     
     </apiDesc><example conref="examples\NavigateToURLExample.as" class="- topic/example "> 下例在一个新的浏览器窗口中打开 URL http://www.adobe.com，并将在 URLVariables 对象中所捕获的用户会话数据传递给 Web 服务器。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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><example conref="examples\URLRequest_example.as" class="- topic/example "> 以下示例显示如何从使用 navigateToURL() 方法的 Flash Player 打开新浏览器窗口。<xref href="http://actionscriptexamples.com/2008/12/08/opening-urls-in-new-browser-windows-using-actionscript-30-and-actionscript-20/" scope="_mmexternal" class="- topic/xref ">ActionScriptExamples.com</xref> 提供的示例。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
// Requires
// - Button symbol on Stage (or a display object, such as a MovieClip) with instance name "buttonSymbol"
//
buttonSymbol.addEventListener(MouseEvent.CLICK, buttonSymbol_click);
 
function buttonSymbol_click(evt:MouseEvent):void {
    var req:URLRequest = new URLRequest("http://www.adobe.com/");
    navigateToURL(req, "_blank");
}
</codeblock></example><example conref="examples\NavigateToURL.tel.1.as" class="- topic/example "> 下例说明了使用指定号码启动设备电话拨号程序的语法。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var request:URLRequest = new URLRequest( "tel:+5555555555" );
navigateToURL( request );
</codeblock></example><example conref="examples\NavigateToURL.sms.1.as" class="- topic/example "> 下例说明了使用指定收件人启动设备文本消息应用程序的语法。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var request:URLRequest = new URLRequest( "sms:+5555555555" );
navigateToURL( request );
</codeblock></example><example conref="examples\NavigateToURL.market.1.as" class="- topic/example "> 下例说明了启动 Android Market 应用程序的语法。设置搜索参数是为了查找 Flash Player 应用程序。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var request:URLRequest = new URLRequest( "market://search?q=pname:com.adobe.flashplayer" );
navigateToURL( request );
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.external.xml#ExternalInterface/call()" class="- topic/link "><linktext class="- topic/linktext ">flash.external.ExternalInterface.call()</linktext></link></related-links></apiOperation><apiOperation id="globalOperation:flash.net:registerClassAlias" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">registerClassAlias</apiName><shortdesc class="- topic/shortdesc ">
     当以 Action Message Format (AMF) 对一个对象进行编码时，保留该对象的类（类型）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果任一个参数为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">TypeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">TypeError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">aliasName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要使用的别名。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">classObject</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Class</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">与给定别名相关联的类。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     当以 Action Message Format (AMF) 对一个对象进行编码时，保留该对象的类（类型）。将对象编码为 AMF 时，该函数将保存该对象的类的别名，以便在解码对象时可以恢复该类。如果编码上下文没有为对象的类注册别名，该对象将被编码为一个匿名对象。同样，如果解码上下文注册了不同的别名，将为解码后的数据创建一个匿名对象。
     
     <p class="- topic/p ">LocalConnection、ByteArray、SharedObject、NetConnection 及 NetStream 均为将对象编码为 AMF 的类的示例。</p>
     
     <p class="- topic/p ">编码和解码上下文不必对别名使用相同的类。它们可以主动地改变类，条件是目标类包含源类序列化的所有成员。</p>
     
     </apiDesc><example conref="examples\RegisterClassAliasExample.as" class="- topic/example "> 此示例使用 <codeph class="+ topic/ph pr-d/codeph ">registerClassAlias()</codeph> 函数为 ExampleClass 注册一个别名 ( <codeph class="+ topic/ph pr-d/codeph ">com.example.eg</codeph> )。由于为类注册了别名，因此可以将对象作为 ExampleClass 的实例反序列化，且代码将输出 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。如果删除 <codeph class="+ topic/ph pr-d/codeph ">registerClassAlias()</codeph> 调用，则代码将输出 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#ObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding 类</linktext></link></related-links></apiOperation><apiOperation id="globalOperation:flash.net:sendToURL" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">sendToURL</apiName><shortdesc class="- topic/shortdesc ">
     向服务器发送一个 URL 请求，但忽略任何响应。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>throws IOError The "digest" and "importToSandbox" properties of URLRequest
     are not supported by URLLoader.send.
     
     </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">本地不受信任的 SWF 文件无法与 Internet 通信。要避免这种情况，可将此 SWF 文件重新分类为只能与远程内容交互或受信任。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。
      
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">request</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:URLRequest</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">URLRequest 对象，指定要将数据发送到哪个 URL。
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     向服务器发送一个 URL 请求，但忽略任何响应。
     <p class="- topic/p ">要检查服务器响应，请改为使用 <codeph class="+ topic/ph pr-d/codeph ">URLLoader.load()</codeph> 方法。</p>
     
     <p class="- topic/p ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。</p>
     
     <p class="- topic/p ">可以在包含 SWF 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数，防止 SWF 文件使用此方法。</p>
     
     <p class="- topic/p "> 在 Flash Player 10 和更高版本中，如果使用包含上载（由 POST 体内的“content-disposition”标头中的“filename”参数表示）的 multipart Content-Type（例如“multipart/form-data”），则 POST 操作会受应用于上载的安全规则的约束：</p>
     <ul class="- topic/ul "><li class="- topic/li ">必须执行 POST 操作以响应用户启动的操作（如鼠标单击或按键）。</li><li class="- topic/li ">如果 POST 操作是跨域的（POST 目标与发送 POST 请求的 SWF 文件不在同一台服务器上），则目标服务器必须提供一个允许跨域访问的 URL 策略文件。</li></ul>
     <p class="- topic/p ">另外，对于任何 multipart Content-Type，语法必须有效（根据 RFC2046 标准）。如果语法无效，则 POST 操作受应用于上载的安全规则约束。</p>
     
     <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
     
     </apiDesc><example conref="examples\SendToURLExample.as" class="- topic/example "> 下面的示例将在 URLVariables 对象中捕获的用户会话数据传递到位于 http://www.yourDomain.com/application.jsp 的应用程序。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 languages="" id="flash.net:NetGroupReceiveMode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetGroupReceiveMode</apiName><shortdesc class="- topic/shortdesc ">
NetGroupReceiveMode 类是用于 NetGroup 类的 receiveMode 属性的常量值的枚举。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">用于 NetGroup 类的 receiveMode 属性的常量值的枚举。

</apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
NetGroupReceiveMode 类是用于 NetGroup 类的 <codeph class="+ topic/ph pr-d/codeph ">receiveMode</codeph> 属性的常量值的枚举。

</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/receiveMode" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.receiveMode</linktext></link><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNearest()</linktext></link></related-links><apiValue id="flash.net:NetGroupReceiveMode:EXACT" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">EXACT</apiName><shortdesc class="- topic/shortdesc "> 
    指定仅当邻居使用的地址与此节点的地址精确匹配时，此节点接受来自邻居的本地消息。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">exact</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
    指定仅当邻居使用的地址与此节点的地址精确匹配时，此节点接受来自邻居的本地消息。即，仅当传递到 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.sendToNearest()</codeph> 的 <codeph class="+ topic/ph pr-d/codeph ">groupAddress</codeph> 参数与此节点的组地址精确匹配时，此节点认为自己离任何 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.sendToNearest()</codeph> 调用最近。此值是默认设置。 
    
    <p class="- topic/p ">如果要启用分发路由行为，请将此值设置为 <codeph class="+ topic/ph pr-d/codeph ">NetGroupReceiveMode.NEAREST</codeph>。如果设置此值，节点在参与定向路由网格之前要等待其连接稳定。</p>
    
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNearest()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroupReceiveMode:NEAREST" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">NEAREST</apiName><shortdesc class="- topic/shortdesc "> 
    指定此节点接受来自邻居的本地消息，此邻居将消息发送到与此节点的地址非精确匹配的组地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">nearest</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
    指定此节点接受来自邻居的本地消息，此邻居将消息发送到与此节点的地址非精确匹配的组地址。当此节点在接收模式为 <codeph class="+ topic/ph pr-d/codeph ">NetGroupReceiveMode.NEAREST</codeph> 的所有邻居中最近时，接收消息。测量环路报文 2<sup class="+ topic/ph hi-d/sup ">256</sup> 上的地址之间的距离。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNearest()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:Responder" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Responder</apiName><shortdesc class="- topic/shortdesc ">
 Responder 类提供了一个对象，该对象在 NetConnection.call() 中使用以处理来自与特定操作成功或失败相关的服务器的返回值。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 Responder 类提供了一个对象，该对象在 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.call()</codeph> 中使用以处理来自与特定操作成功或失败相关的服务器的返回值。在使用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.call()</codeph> 时，您可能会遇到特定于当前操作的网络操作错误或与当前连接状态有关的错误。操作错误以 Responder 对象（而不是 NetConnection 对象）为目标，便于进行错误处理。
 
 
 </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection/call()" class="- topic/link "><linktext class="- topic/linktext ">NetConnection.call()</linktext></link></related-links><apiConstructor id="flash.net:Responder:Responder" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">Responder</apiName><shortdesc class="- topic/shortdesc ">
	 创建一个新的 Responder 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">result</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Function</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果对服务器的调用成功并返回结果，则此函数被调用。
	 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">status</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Function</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果服务器返回一个错误，则此函数被调用。
	 </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 创建一个新的 Responder 对象。可以将 Responder 对象传递给 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.call()</codeph>，以处理来自服务器的返回值。可以为两个参数之一或两个参数都传递 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
	 
	 </apiDesc></apiConstructorDetail></apiConstructor></apiClassifier><apiClassifier languages="" id="flash.net:URLRequestHeader" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">URLRequestHeader</apiName><shortdesc class="- topic/shortdesc ">
 URLRequestHeader 对象封装了一个 HTTP 请求标头并由一个名称/值对组成。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 URLRequestHeader 对象封装了一个 HTTP 请求标头并由一个名称/值对组成。URLRequestHeader 对象在 URLRequest 类的 <codeph class="+ topic/ph pr-d/codeph ">requestHeaders</codeph> 属性中使用。
 
 <p class="- topic/p ">在 Adobe<sup class="+ topic/ph hi-d/sup ">®</sup> AIR<sup class="+ topic/ph hi-d/sup ">®</sup> 中，应用程序安全沙箱中的内容（例如使用 AIR 应用程序安装的内容）可以使用任何请求标头，不会出错。不过，对于在 Adobe AIR 中运行的不同安全沙箱中的内容，<ph class="- topic/ph ">或对于在 Flash<sup class="+ topic/ph hi-d/sup ">®</sup> Player 中运行的内容，</ph>使用以下请求标头将会引发运行时错误，且限制的术语不区分大小写（例如，<codeph class="+ topic/ph pr-d/codeph ">Get</codeph>、<codeph class="+ topic/ph pr-d/codeph ">get</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 均不得使用）： </p>
 
 <p class="- topic/p ">在应用程序安全沙箱以外的 Flash Player 和 Adobe AIR 内容中，不能使用以下请求标头，且限制的术语不区分大小写（例如，<codeph class="+ topic/ph pr-d/codeph ">Get</codeph>、<codeph class="+ topic/ph pr-d/codeph ">get</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 均不得使用）。另外，如果使用下划线字符，这也适用于带连字符的词（例如，不允许使用 <codeph class="+ topic/ph pr-d/codeph ">Content-Length</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">Content_Length</codeph>）： </p>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">Accept-Charset</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Accept-Encoding</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Accept-Ranges</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Age</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Allow</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Allowed</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Authorization</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Charge-To</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Connect</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Connection</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Content-Length</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Content-Location</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Content-Range</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Cookie</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Date</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Delete</codeph>、<codeph class="+ topic/ph pr-d/codeph ">ETag</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Expect</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Get</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Head</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Host</codeph>、<codeph class="+ topic/ph pr-d/codeph ">If-Modified-Since</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Keep-Alive</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Last-Modified</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Location</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Max-Forwards</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Options</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Origin</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Post</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Proxy-Authenticate</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Proxy-Authorization</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Proxy-Connection</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Public</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Put</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Range</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Referer</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Request-Range</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Retry-After</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Server</codeph>、<codeph class="+ topic/ph pr-d/codeph ">TE</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Trace</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Trailer</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Transfer-Encoding</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Upgrade</codeph>、<codeph class="+ topic/ph pr-d/codeph ">URI</codeph>、<codeph class="+ topic/ph pr-d/codeph ">User-Agent</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Vary</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Via</codeph>、<codeph class="+ topic/ph pr-d/codeph ">Warning</codeph>、<codeph class="+ topic/ph pr-d/codeph ">WWW-Authenticate</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">x-flash-version。</codeph></p>
 
 <p class="- topic/p ">URLRequestHeader 对象的长度是受限制的。如果 URLRequestHeader 对象的累计长度（<codeph class="+ topic/ph pr-d/codeph ">name</codeph> 属性的长度加 <codeph class="+ topic/ph pr-d/codeph ">value</codeph> 属性的长度）或 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.requestHeaders</codeph> 属性中使用的 URLRequestHeader 对象数组超过可接受的长度，则应用程序将引发异常。</p>
 
 <p class="- topic/p ">除非为 URLRequest 类的 <codeph class="+ topic/ph pr-d/codeph ">requestHeaders</codeph> 属性中的 <codeph class="+ topic/ph pr-d/codeph ">ACCEPT</codeph> 标头指定设置，否则，在 Adobe AIR 中运行的内容会将 <codeph class="+ topic/ph pr-d/codeph ">ACCEPT</codeph> 标头设置为以下值：</p>
 
 <codeph class="+ topic/ph pr-d/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 class="- topic/p ">并非所有接受 URLRequest 参数的方法都支持 <codeph class="+ topic/ph pr-d/codeph ">requestHeaders</codeph> 属性，请参阅有关调用的方法的文档。例如，<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法不支持 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.requestHeaders</codeph> 属性。</p>
 <p class="- topic/p ">由于存在浏览器限制，因此仅对 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 请求支持自定义 HTTP 请求标头，而对 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 请求不提供相应支持。</p>  
 
 </apiDesc><example conref="examples\URLRequestHeaderExample.as" class="- topic/example "> 下例将 HTTP 请求标头 <codeph class="+ topic/ph pr-d/codeph ">header</codeph> 添加到 <codeph class="+ topic/ph pr-d/codeph ">requestHeaders</codeph> 属性的数组中。该标头指出，即使应用程序具有所请求内容的缓存副本，也应当将请求转发给原始服务器。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#URLRequest" class="- topic/link "><linktext class="- topic/linktext ">URLRequest</linktext></link><link href="flash.net.xml#URLLoader" class="- topic/link "><linktext class="- topic/linktext ">URLLoader</linktext></link></related-links><apiConstructor id="flash.net:URLRequestHeader:URLRequestHeader" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">URLRequestHeader</apiName><shortdesc class="- topic/shortdesc ">
	 创建一个封装单个 HTTP 请求标头的新 URLRequestHeader 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">name</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">HTTP 请求标头名称（如 <codeph class="+ topic/ph pr-d/codeph ">Content-Type</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">SOAPAction</codeph>）。
	 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">与 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 属性相关联的值（如 <codeph class="+ topic/ph pr-d/codeph ">text/plain</codeph>）。
	 </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 创建一个封装单个 HTTP 请求标头的新 URLRequestHeader 对象。URLRequestHeader 对象在 URLRequest 类的 <codeph class="+ topic/ph pr-d/codeph ">requestHeaders</codeph> 属性中使用。
     
	 </apiDesc></apiConstructorDetail></apiConstructor><apiValue id="flash.net:URLRequestHeader:name" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">name</apiName><shortdesc class="- topic/shortdesc ">
	 HTTP 请求标头名称（例如 Content-Type 或 SOAPAction）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 HTTP 请求标头名称（如 <codeph class="+ topic/ph pr-d/codeph ">Content-Type</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">SOAPAction</codeph>）。
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestHeader:value" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">value</apiName><shortdesc class="- topic/shortdesc ">
	 与 name 属性相关联的值（如 text/plain）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 与 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 属性相关联的值（如 <codeph class="+ topic/ph pr-d/codeph ">text/plain</codeph>）。
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:URLRequestMethod" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">URLRequestMethod</apiName><shortdesc class="- topic/shortdesc ">
 URLRequestMethod 类提供了一些值，这些值可指定在将数据发送到服务器时，URLRequest 对象应使用 POST 方法还是 GET 方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 URLRequestMethod 类提供了一些值，这些值可指定在将数据发送到服务器时，URLRequest 对象应使用 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 方法还是 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 方法。
 
 </apiDesc><example conref="examples\URLRequestMethodExample.as" class="- topic/example "> 下例加载并显示在本地文本文件中找到的数据。它还会跟踪事件处理信息。
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>要运行此示例，请将名为 example.txt 的文件与 SWF 文件放在同一目录下。该文件应当是一个包含几个词或几行文字的简单文本文件。
 </p>
 <p class="- topic/p ">该示例代码执行以下操作：</p>
 <ol class="- topic/ol "><li class="- topic/li ">构造函数创建了一个名为 <codeph class="+ topic/ph pr-d/codeph ">loader</codeph>。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">loader</codeph> 对象被传递给 <codeph class="+ topic/ph pr-d/codeph ">configureListeners()</codeph> 方法，该方法可为每个受支持的 URLLoader 事件添加侦听器。</li><li class="- topic/li ">创建了一个名为 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> 的 URLRequest 实例，这指定了要加载文件的名称。</li><li class="- topic/li ">请求的 <codeph class="+ topic/ph pr-d/codeph ">method</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph>。</li><li class="- topic/li ">然后，<codeph class="+ topic/ph pr-d/codeph ">request</codeph> 对象被传递给 <codeph class="+ topic/ph pr-d/codeph ">loader.load()</codeph>，该方法可加载文本文件。</li><li class="- topic/li ">当 URLLoader 完成文本文件的加载时，将引发 <codeph class="+ topic/ph pr-d/codeph ">Event.COMPLETE</codeph> 事件，同时触发 <codeph class="+ topic/ph pr-d/codeph ">completeHandler()</codeph> 方法。<codeph class="+ topic/ph pr-d/codeph ">completeHandler()</codeph> 方法只跟踪 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性，即文本文件的内容。</li></ol>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#URLRequest" class="- topic/link "><linktext class="- topic/linktext ">URLRequest</linktext></link><link href="flash.net.xml#URLVariables" class="- topic/link "><linktext class="- topic/linktext ">URLVariables</linktext></link></related-links><apiValue id="flash.net:URLRequestMethod:DELETE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">DELETE</apiName><shortdesc class="- topic/shortdesc ">
	 指定 URLRequest 对象为 DELETE。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">DELETE</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">指定 URLRequest 对象为 DELETE。
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定 URLRequest 对象为 <codeph class="+ topic/ph pr-d/codeph ">DELETE</codeph>。
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestMethod:GET" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">GET</apiName><shortdesc class="- topic/shortdesc ">
	 指定 URLRequest 对象为 GET。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">GET</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">指定 URLRequest 对象为 GET。
	 
	 </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 表示 URLRequest 对象是一个 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph>。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestMethod:HEAD" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">HEAD</apiName><shortdesc class="- topic/shortdesc ">
	 指定 URLRequest 对象为 HEAD。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">HEAD</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">指定 URLRequest 对象为 HEAD。
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定 URLRequest 对象为 <codeph class="+ topic/ph pr-d/codeph ">HEAD</codeph>。
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestMethod:OPTIONS" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">OPTIONS</apiName><shortdesc class="- topic/shortdesc ">
	 指定 URLRequest 对象为 OPTIONS。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">OPTIONS</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">指定 URLRequest 对象为 OPTIONS。
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定 URLRequest 对象为 <codeph class="+ topic/ph pr-d/codeph ">OPTIONS</codeph>。
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestMethod:POST" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">POST</apiName><shortdesc class="- topic/shortdesc ">
	 指定 URLRequest 对象为 POST。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">POST</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">指定 URLRequest 对象为 POST。
	 
	 </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 表示 URLRequest 对象是一个 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph>。
	 
	 <p class="- topic/p "><i class="+ topic/ph hi-d/i ">注意：</i><ph class="- topic/ph ">对于在 Adobe AIR 中运行的内容，当</ph>使用 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL()</codeph> 函数时，运行时将使用 POST 方法的 URLRequest（其 <codeph class="+ topic/ph pr-d/codeph ">method</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph>）视为使用 GET 方法。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLRequestMethod:PUT" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">PUT</apiName><shortdesc class="- topic/shortdesc ">
	 指定 URLRequest 对象为 PUT。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">PUT</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">指定 URLRequest 对象为 PUT。
     
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定 URLRequest 对象为 <codeph class="+ topic/ph pr-d/codeph ">PUT</codeph>。
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:FileReference" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">FileReference</apiName><shortdesc class="- topic/shortdesc ">
  FileReference 类提供了在用户计算机和服务器之间上载和下载文件的方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">FileReference, FileReference.browse, FileReference.download, FileReference.create, browse, download, create
  </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  FileReference 类提供了在用户计算机和服务器之间上载和下载文件的方法。操作系统对话框会提示用户选择要上载的文件或用于下载的位置。每个 FileReference 对象都引用用户磁盘上的一个文件并且具有一些属性，这些属性包含有关文件大小、类型、名称、创建日期、修改日期和创建者类型（仅限 Macintosh）的信息。 
  
  <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在 Adobe AIR 中，File 类（用于扩展 FileReference 类）提供了更多的功能，并具有比 FileReference 类更少的安全性限制。</p>
  
  <p class="- topic/p ">FileReference 实例的创建方式如下：</p>
  <ul class="- topic/ul "><li class="- topic/li ">当将 <codeph class="+ topic/ph pr-d/codeph ">new</codeph> 运算符与 FileReference 构造函数一起使用时：<codeph class="+ topic/ph pr-d/codeph ">var myFileReference = new FileReference();</codeph></li><li class="- topic/li ">当调用 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 方法时，该方法将创建一个 FileReference 对象数组。</li></ul>
  
  <p class="- topic/p ">在上载操作期间，FileReference 对象的所有属性通过调用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 方法来填充。在下载操作期间，<codeph class="+ topic/ph pr-d/codeph ">name</codeph> 属性在调度 <codeph class="+ topic/ph pr-d/codeph ">select</codeph> 事件时得到填充，所有其他属性在调度 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件时得到填充。</p>
  
  <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 方法打开一个操作系统对话框，提示用户选择要上载的文件。<codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph> 方法允许用户选择一个文件；<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 方法允许用户选择多个文件。成功调用 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 方法后，调用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 方法以每次上载一个文件。<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法提示用户提供文件的保存位置并开始从远程 URL 进行下载。</p>
  
  <p class="- topic/p ">FileReference 类和 FileReferenceList 类不允许为 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">download()</codeph> 生成的对话框设置默认文件位置。对话框中显示的默认位置是最近浏览过的文件夹（如果可以确定该位置）或桌面。这些类不允许对已传输的文件进行读取或写入。它们也不允许启动上载或下载的 SWF 文件访问已上载或下载的文件或用户磁盘上文件的位置。</p>
  
  <p class="- topic/p ">FileReference 类和 FileReferenceList 类也不提供用于身份验证的方法。通过要求身份验证的服务器，您可以使用 Flash <sup class="+ topic/ph hi-d/sup ">®</sup> Player 浏览器插件下载文件，但上载（在所有播放器上）和下载（在独立播放器或外部播放器上）将失败。对 FileReference 事件进行侦听可确定操作是否成功完成，并进行错误处理。</p>
  
  <p class="- topic/p ">对于<ph class="- topic/ph ">在 Flash Player 中运行的内容或</ph>在 Adobe AIR 中的应用程序安全沙箱以外的区域运行的内容，上载和下载操作只能访问所在域和 URL 策略文件指定的任何域中的文件。如果启动上载或下载的内容与文件服务器不在相同的域中，则需要将策略文件放到文件服务器上。</p>
  
  <p class="- topic/p ">请注意，由于已向 Flash Player 中添加了新功能，因此当发布到 Flash Player 10 时，一次只可以激活下列操作中的一个操作：<codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.load()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.save()</codeph>。否则，Flash Player 会引发运行时错误（代码 2174）。使用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.cancel()</codeph> 可停止正在进行的操作。此限制仅适用于 Flash Player 10。早期版本的 Flash Player 在同时进行多个操作时不会受到此限制的影响。</p>
  
  <p class="- topic/p ">调用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法的过程中，对于 Linux 和 Mac OS X 10.1 及早期版本，将暂停 Flash Player 的独立和外部版本中以及 AIR 中的 SWF 文件播放</p>
  
  <p class="- topic/p ">如果未指定任何参数，则 Flash Player 会向服务器端脚本发送以下范例 HTTP <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 请求：
  </p>
  
  <pre xml:space="preserve" class="- topic/pre ">
  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 class="- topic/p ">如果用户指定参数 <codeph class="+ topic/ph pr-d/codeph ">"api_sig"</codeph>、<codeph class="+ topic/ph pr-d/codeph ">"api_key"</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">"auth_token"</codeph>，Flash Player 将发送以下 HTTP <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 请求：
  </p>
  
  <pre xml:space="preserve" class="- topic/pre ">
  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" class="- topic/example "> 下例显示在运行时加载的文件的数据格式和状态信息。  
 <p class="- topic/p "> <b class="+ topic/ph hi-d/b ">注意：</b>要运行此示例，请更改 uploadURL.url 属性以指向实际的 URL，而不是示例中虚拟的地址。URL 应指向名为 <codeph class="+ topic/ph pr-d/codeph ">yourUploadHandlerScript.cfm</codeph> 的文件，该文件位于指定 URL 的根 Web 目录下。根据您的配置，您可能还需要编译 SWF 文件，将“本地播放安全性”设置为“只访问网络”，或更新 Flash Player 的安全设置，以允许此文件网络访问。
 </p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#FileReferenceList" class="- topic/link "><linktext class="- topic/linktext ">flash.net.FileReferenceList</linktext></link><link href="flash.filesystem.xml#File" class="- topic/link "><linktext class="- topic/linktext ">flash.filesystem.File</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference_flash.events.DataEvent.UPLOAD_COMPLETE_DATA_uploadCompleteData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">uploadCompleteData</apiName><shortdesc class="- topic/shortdesc ">
    成功上载并从服务器接收数据之后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9.0.28.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.DataEvent.UPLOAD_COMPLETE_DATA</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.DataEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    成功上载并从服务器接收数据之后调度。如果未从服务器返回数据，则不调度此事件。
    </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS_httpResponseStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpResponseStatus</apiName><shortdesc class="- topic/shortdesc ">
     在 upload() 或 uploadUnencoded() 方法调用尝试通过 HTTP 访问数据，并且 Adobe AIR 可以检测并返回请求的状态代码时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在 <codeph class="+ topic/ph pr-d/codeph ">upload()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">uploadUnencoded()</codeph> 方法调用尝试通过 HTTP 访问数据，并且 Adobe AIR 可以检测并返回请求的状态代码时调度。 
     
     </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">upload()</linktext></link><link href="flash.net.xml#FileReference/uploadUnencoded()" class="- topic/link "><linktext class="- topic/linktext ">uploadUnencoded()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.HTTPStatusEvent.HTTP_STATUS_httpStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpStatus</apiName><shortdesc class="- topic/shortdesc ">
     当上载失败并且存在可用来描述失败的 HTTP 状态代码时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.HTTPStatusEvent.HTTP_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     当上载失败并且存在可用来描述失败的 HTTP 状态代码时调度。调度 <codeph class="+ topic/ph pr-d/codeph ">httpStatus</codeph> 事件之后，将调度 <codeph class="+ topic/ph pr-d/codeph ">ioError</codeph> 事件。
     
     <p class="- topic/p ">仅在上载失败时才调度 <codeph class="+ topic/ph pr-d/codeph ">httpStatus</codeph> 事件。对于在 Flash Player 中运行的内容，此事件不适用于下载失败。如果下载由于 HTTP 错误而失败，则将错误报告为 I/O 错误。</p>
     
     </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.Event.SELECT_select" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">select</apiName><shortdesc class="- topic/shortdesc ">
    当用户从文件浏览对话框选择要上载或下载的文件时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
    </helpid></asCustoms></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.SELECT</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    当用户从文件浏览对话框选择要上载或下载的文件时调度。（调用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法时将打开此对话框。） 当用户选择文件并确认操作（例如，通过单击“确定”）时，会填充 FileReference 对象的属性。
    
    <p class="- topic/p ">对于在 <ph class="- topic/ph ">Flash Player 内运行的内容或</ph>在 <ph class="- topic/ph ">Adobe AIR 运行时中、但在应用程序安全沙箱以外运行的内容</ph>，<codeph class="+ topic/ph pr-d/codeph ">select</codeph> 事件的行为方式略有不同，具体取决于调用该事件的方法。在调用 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 后调度 <codeph class="+ topic/ph pr-d/codeph ">select</codeph> 事件时，<ph class="- topic/ph ">Flash Player 或</ph> AIR 应用程序能够读取 FileReference 对象的所有属性，因为用户所选的文件位于本地文件系统上。在调用 <codeph class="+ topic/ph pr-d/codeph ">download()</codeph> 后发生 <codeph class="+ topic/ph pr-d/codeph ">select</codeph> 事件时，<ph class="- topic/ph ">Flash Player 或</ph> AIR 应用程序只能读取 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 属性，因为在调度 <codeph class="+ topic/ph pr-d/codeph ">select</codeph> 事件时，文件尚未下载到本地文件系统。如果已下载了文件，则调度 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件时，<ph class="- topic/ph ">Flash Player 或</ph> AIR 应用程序可以读取 FileReference 对象的所有其他属性。</p>
    
    </apiDesc><example conref="examples\FileReference_event_select.as" class="- topic/example "> 下面的示例演示 <codeph class="+ topic/ph pr-d/codeph ">select</codeph> 事件对象的用法。要运行此示例，请将 <codeph class="+ topic/ph pr-d/codeph ">uploadURL.url</codeph> 属性更改为指向一个实际的域和文件，而不是虚拟的 http://www.[yourDomain].com/SomeFile.pdf。您可能还需要编译 SWF 文件，将“本地播放安全性”设置为“只访问网络”，或更新 Flash Player 的安全设置，以允许此文件网络访问。要想可以从桌面运行这个示例，您的服务器还需要发送 crossdomain.xml 文件。如果触发了 <codeph class="+ topic/ph pr-d/codeph ">ioErrorHandler()</codeph> 函数，可能需要使用一个有效的 URL 来更新提供的 <codeph class="+ topic/ph pr-d/codeph ">uploadURL</codeph>，此有效的 URL 被配置成接收上载。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><shortdesc class="- topic/shortdesc ">
     当对 FileReference.upload() 或 FileReference.download() 方法的调用尝试将文件上载到调用方安全沙箱外部的服务器，或是从调用方安全沙箱外部的服务器上下载文件时进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
     
     </helpid></asCustoms></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     当对 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法的调用尝试将文件上载到服务器，或是从调用方安全沙箱外部的服务器上下载文件时进行调度。用于描述发生的特定错误的文本属性的值通常为 <codeph class="+ topic/ph pr-d/codeph ">"securitySandboxError"</codeph>。执行调用的 SWF 可能已经尝试访问其域外部的 SWF 文件，但却无权这样做。您可以通过使用 URL 策略文件来尝试纠正此错误。
     
     <p class="- topic/p ">在 Adobe AIR 中，这些安全限制不适用于应用程序安全沙箱中的内容。</p>
     
     <p class="- topic/p ">在 Adobe AIR 中，这些安全限制不适用于应用程序安全沙箱中的内容。</p>
     
     </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/download()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.download()</linktext></link><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.ProgressEvent.PROGRESS_progress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">progress</apiName><shortdesc class="- topic/shortdesc ">
    在文件上载或下载操作期间定期调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
    </helpid></asCustoms></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.ProgressEvent.PROGRESS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    在文件上载或下载操作期间定期调度。<codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 事件在 Flash Player 将字节传输到服务器时调度，即使传输最终没有成功，也会在传输期间定期调度。要确定文件传输是否真正成功和完成以及何时真正成功和完成，需要侦听 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件。
    
    <p class="- topic/p ">在某些情况下，接收不到 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 事件。例如，当所传输的文件非常小或者上载或下载速度非常快时，可能就不会调度 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 事件。</p>
    
    <p class="- topic/p ">在低于 OS X 10.3 版本的 Macintosh 平台上不能确定文件上载进度。<codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 事件在上载操作期间调用，但 progress 事件的 <codeph class="+ topic/ph pr-d/codeph ">bytesLoaded</codeph> 属性值为 -1，表示不能确定进度。</p>
    
    </apiDesc><example conref="examples\FileReference_event_progress.as" class="- topic/example "> 下面的示例演示 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 事件的用法。要运行此示例，请将 <codeph class="+ topic/ph pr-d/codeph ">downloadURL.url</codeph> 属性更改为指向一个实际的域和文件，而不是虚拟的 http://www.[yourDomain].com/SomeFile.pdf。您可能还需要编译 SWF 文件，将“本地播放安全性”设置为“只访问网络”，或更新 Flash Player 的安全设置，以允许此文件网络访问。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#FileReference/event:complete" class="- topic/link "><linktext class="- topic/linktext ">FileReference.complete</linktext></link><link href="flash.events.xml#ProgressEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.ProgressEvent</linktext></link><link href="flash.net.xml#FileReference/download()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.download()</linktext></link><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.Event.OPEN_open" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><shortdesc class="- topic/shortdesc ">
    当上载或下载操作开始时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.OPEN</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    当上载或下载操作开始时调度。
    
    
    </apiDesc><example conref="examples\FileReference_download.as" class="- topic/example "> 下面的示例演示 <codeph class="+ topic/ph pr-d/codeph ">download</codeph> 事件对象的用法。要运行此示例，请将 <codeph class="+ topic/ph pr-d/codeph ">downloadURL.url</codeph> 属性更改为指向一个实际的域和文件，而不是虚拟的 http://www.[yourDomain].com/SomeFile.pdf。您可能还需要编译 SWF 文件，将“本地播放安全性”设置为“只访问网络”，或更新 Flash Player 的安全设置，以允许此文件网络访问。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#FileReference/download()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.download()</linktext></link><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.IOErrorEvent.IO_ERROR_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><shortdesc class="- topic/shortdesc ">
    当上载或下载失败时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    当上载或下载失败时调度。文件传输会失败的原因有：
    
    <ul class="- topic/ul "><li class="- topic/li ">当播放器正在读取、写入或传输文件时发生输入/输出错误。</li><li class="- topic/li "><ph class="- topic/ph ">SWF 文件</ph>尝试将文件上载到要求身份验证（如用户名和密码）的服务器。在上载期间，<ph class="- topic/ph ">Flash Player 或</ph> Adobe AIR 不为用户提供输入密码的方法。<ph class="- topic/ph ">如果 SWF 文件</ph>尝试将文件上载到要求身份验证的服务器，上载将失败。</li><li class="- topic/li "><ph class="- topic/ph ">SWF 文件</ph>尝试在独立或外部播放器中从要求身份验证的服务器下载文件。在下载期间，独立播放器和外部播放器不提供用户用于输入密码的方法。<ph class="- topic/ph ">如果这些播放器中的 SWF 文件尝试从要求身份验证的服务器下载文件，则下载会失败。</ph><ph class="- topic/ph ">文件下载只能在 ActiveX 控件、浏览器插件播放器和 Adobe AIR 运行时中成功。</ph></li><li class="- topic/li ">传递到 <codeph class="+ topic/ph pr-d/codeph ">upload()</codeph> 方法中的 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 参数的值包含无效协议。有效协议包括 HTTP 和 HTTPS。</li></ul>
    
    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">重要说明：</b>只有在浏览器中运行的应用程序（即，使用浏览器插件或 ActiveX 控件的应用程序）和在 Adobe AIR 中运行的内容才可以提供对话框来提示用户输入用户名和密码以进行身份验证，并且只适用于下载。对于使用插件或 ActiveX 控件版本的 Flash Player 进行的上载操作，以及使用独立播放器或外部播放器进行的上载或下载操作，文件传输将失败。</p>
    
    </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/download()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.download()</linktext></link><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.Event.COMPLETE_complete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">complete</apiName><shortdesc class="- topic/shortdesc ">
    当下载操作完成或上载操作生成 HTTP 状态代码 200 时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.COMPLETE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    当下载操作完成或上载操作生成 HTTP 状态代码 200 时调度。对于文件下载操作，在 <ph class="- topic/ph ">Flash Player 或</ph> Adobe AIR 将整个文件下载到磁盘上时调度此事件。对于文件上载操作，在 <ph class="- topic/ph ">Flash Player 或</ph> Adobe AIR 接收到 HTTP 状态代码 200（来自接收传输的服务器）之后调度此事件。
    
    </apiDesc><example conref="examples\FileReference_event_complete.as" class="- topic/example "> 下面的示例演示 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件对象的用法。要运行此示例，请将 <codeph class="+ topic/ph pr-d/codeph ">downloadURL.url</codeph> 属性更改为指向一个实际的域和文件，而不是虚拟的 http://www.[yourDomain].com/SomeFile.pdf。您可能还需要编译 SWF 文件，将“本地播放安全性”设置为“只访问网络”，或更新 Flash Player 的安全设置，以允许此文件网络访问。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#FileReference/download()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.download()</linktext></link><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.upload()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReference_flash.events.Event.CANCEL_cancel" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">cancel</apiName><shortdesc class="- topic/shortdesc ">
    当用户通过文件浏览对话框取消文件上载或下载时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.CANCEL</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    当用户通过文件浏览对话框取消文件上载或下载时调度。如果用户通过其他方式（关闭浏览器或停止当前应用程序）取消上载或下载，则 Flash Player 不会调度该事件。
    
    </apiDesc><example conref="examples\FileReference_event_cancel.as" class="- topic/example "> 下面的示例演示 <codeph class="+ topic/ph pr-d/codeph ">cancel</codeph> 事件对象的用法。要运行此示例，请将 <codeph class="+ topic/ph pr-d/codeph ">downloadURL.url</codeph> 属性更改为指向一个实际的域和文件，而不是虚拟的 http://www.[yourDomain].com/SomeFile.pdf。您可能还需要编译 SWF 文件，将“本地播放安全性”设置为“只访问网络”，或更新 Flash Player 的安全设置，以允许此文件网络访问。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">FileReference</apiName><shortdesc class="- topic/shortdesc ">
    创建新的 FileReference 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    创建新的 FileReference 对象。在填充后，FileReference 对象表示用户本地磁盘上的文件。
    
    </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:FileReference:browse" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">browse</apiName><shortdesc class="- topic/shortdesc ">
    显示一个文件浏览对话框，让用户选择要上载的文件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">browse, FileReference.browse
  </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在以下情况下引发：1) 另一个 FileReference 或 FileReferenceList 浏览会话正在进行中；每次仅能执行一个文件浏览会话。2) 用户 mms.cfg 文件中的某个设置禁止此操作。
  
  </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">typeFilter</codeph> 数组包含格式不正确的 FileFilter 对象，将引发异常。有关 FileFilter 对象正确格式的信息，请参阅 <xref href="FileFilter.html" class="- topic/xref ">FileFilter</xref> 类。
  
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">为了响应用户动作（如鼠标事件或按键事件），将不会调用此方法。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果参数有效并且打开了文件浏览对话框，则返回 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。  
  
  </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">typeFilter</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Array</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 FileFilter 实例数组，用于过滤在对话框中显示的文件。如果省略此参数，则显示所有文件。有关详细信息，请参阅 <xref href="FileFilter.html" class="- topic/xref ">FileFilter</xref> 类。
    
    
    </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    显示一个文件浏览对话框，让用户选择要上载的文件。该对话框对于用户的操作系统来说是本机的。用户可以选择本地计算机上的文件，也可以选择其他系统上的文件，例如，通过 Windows 上的 UNC 路径选择文件。
    
    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>可在 Adobe AIR 中使用的 File 类包括用于访问更具体的系统文件选择对话框的方法。这些方法是 <codeph class="+ topic/ph pr-d/codeph ">File.browseForDirectory()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">File.browseForOpen()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">File.browseForOpenMultiple()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">File.browseForSave()</codeph>。</p>
    
    <p class="- topic/p ">当调用此方法并且用户成功选择文件时，会使用该文件的属性填充此 FileReference 对象的属性。以后每次调用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph> 方法时，FileReference 对象的属性都重置为用户在对话框中选择的文件。每次只能执行一个 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">download()</codeph> 会话（因为每次只能调用一个对话框）。</p>
    
    <p class="- topic/p ">使用 <codeph class="+ topic/ph pr-d/codeph ">typeFilter</codeph> 参数，可决定对话框显示哪些文件。</p>
    
    <p class="- topic/p ">在 Flash Player 10 和 Flash Player 9 Update 5 中，只有响应用户事件（例如，在鼠标单击或按键事件的事件处理函数中）才能成功调用此方法。否则，调用此方法将导致 Flash Player 引发 Error 异常。</p>
    
    <p class="- topic/p ">请注意，由于已向 Flash Player 中添加了新功能，因此当发布到 Flash Player 10 时，一次只可以激活下列操作中的一个操作：<codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.load()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.save()</codeph>。否则，Flash Player 会引发运行时错误（代码 2174）。使用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.cancel()</codeph> 可停止正在进行的操作。此限制仅适用于 Flash Player 10。早期版本的 Flash Player 在同时进行多个操作时不会受到此限制的影响。</p> 
 	
	<p class="- topic/p ">在 Adobe AIR 中，文件浏览对话框并不始终显示在由另一个窗口（具有非空 <codeph class="+ topic/ph pr-d/codeph ">owner</codeph> 属性的窗口）拥有的窗口的前面。要避免窗口顺序问题，请在调用此方法之前隐藏所拥有的窗口。</p>
	
  	</apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReferenceList/event:select" class="- topic/link "><linktext class="- topic/linktext ">select 事件</linktext></link><link href="flash.net.xml#FileReference/event:cancel" class="- topic/link "><linktext class="- topic/linktext ">cancel 事件</linktext></link><link href="flash.net.xml#FileReference/download()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.download()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.browse()</linktext></link><link href="" invalidHref="flash.filesystem.File.browseForDirectory().xml" class="- topic/link "><linktext class="- topic/linktext ">File.browseForDirectory()</linktext></link><link href="" invalidHref="flash.filesystem.File.browseForOpen().xml" class="- topic/link "><linktext class="- topic/linktext ">File.browseForOpen()</linktext></link><link href="" invalidHref="flash.filesystem.File.browseForOpenMultiple().xml" class="- topic/link "><linktext class="- topic/linktext ">File.browseForOpenMultiple()</linktext></link><link href="" invalidHref="flash.filesystem.File.browseForSave().xml" class="- topic/link "><linktext class="- topic/linktext ">File.browseForSave()</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:browse_select" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">select</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当用户从浏览文件选择器成功选择了项目时调度。
  </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当用户从浏览文件选择器成功选择了项目时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:browse_cancel" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">cancel</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当用户取消文件上载浏览窗口时调度。
  
  </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当用户取消文件上载浏览窗口时调度。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:FileReference:cancel" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">cancel</apiName><shortdesc class="- topic/shortdesc ">
  取消正在对该 FileReference 对象执行的任何上载或下载操作。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">cancel, FileReference.cancel
  </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">取消正在进行的任何上载或下载操作。
  </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  取消正在对该 FileReference 对象执行的任何上载或下载操作。调用此方法并不会调度 <codeph class="+ topic/ph pr-d/codeph ">cancel</codeph> 事件。仅在用户通过退出文件上载或下载对话框来取消操作时，才会调度该事件。
  
    </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:FileReference:download" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">download</apiName><shortdesc class="- topic/shortdesc ">
    打开对话框，以允许用户从远程服务器下载文件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在以下情况下引发：1) 另一个浏览会话正在进行中；每次仅能执行一个文件浏览会话。2) 传递给 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> 的值不包含有效的路径或协议。3) 要下载的文件的名称中包含禁止使用的字符。4) 用户 mms.cfg 文件中的某个设置禁止此操作。
    
        </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">本地不受信任的内容可能无法与 Internet 进行通信。要避免这种情况，请将此 SWF 文件重新分类为只能与远程内容交互或受信任。引发此异常时会显示一条消息，指明由于本地文件安全性限制而不允许访问的文件名和 URL。
    
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">url.data</codeph> 为 ByteArray 类型，将引发异常。当与 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法一起使用时，<codeph class="+ topic/ph pr-d/codeph ">url.data</codeph> 只能为 URLVariables 或 String 类型。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">发生此错误的原因有：1) Flash Player 无法将 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.data</codeph> 参数从 UTF8 转换为 MBCS。如果传递给 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法的 URLRequest 对象设置为执行 GET 操作并且 <codeph class="+ topic/ph pr-d/codeph ">System.useCodePage</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，将发生该错误。2) Flash Player 无法为 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 数据分配内存。如果传递给 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法的 URLRequest 对象设置为执行 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 操作，将发生该错误。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">MemoryError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:MemoryError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">为了响应用户动作（如鼠标事件或按键事件），将不会调用此方法。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">request</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:URLRequest</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">URLRequest 对象。URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性应包含要下载到本地计算机的文件的 URL。若此参数为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，将引发异常。URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">requestHeaders</codeph> 属性将被省略；上载或下载时不支持自定义 HTTP 请求标头。要向服务器发送 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 或 GET 参数，请将 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.data</codeph> 的值设置为您的参数，并将 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.method</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.GET</codeph>。
    
        <p class="- topic/p ">在某些浏览器上，URL 字符串长度受限。在某些浏览器或服务器上，长度超过 256 个字符的字符串可能失败。</p>
    
    </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">defaultFileName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对话框中显示的要下载文件的默认文件名。此字符串不能包含以下字符：/ \ : * ? " &lt; > | %
    <p class="- topic/p ">如果省略此参数，将分析出远程 URL 的文件名并用作默认文件名。 </p>
    
    </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    打开对话框，以允许用户从远程服务器下载文件。<ph class="- topic/ph ">虽然 Flash Player 没有限制可上载或下载的文件的大小，但是播放器正式支持的上载或下载文件大小最大为 100 MB。</ph>
    
    <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">download()</codeph> 方法首先打开一个操作系统对话框，让用户输入文件名并在本地计算机上选择用于保存文件的位置。用户选择了位置并确认下载操作时（例如，单击“保存”）后，开始从远程服务器下载。侦听器接收事件来表示下载的进度、成功或失败。为了在调用 <codeph class="+ topic/ph pr-d/codeph ">download()</codeph> 后确定对话框和下载操作的状态， 代码必须对 <codeph class="+ topic/ph pr-d/codeph ">cancel</codeph>、<codeph class="+ topic/ph pr-d/codeph ">open</codeph>、<codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 等事件进行侦听。
    </p>
    
    <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 函数是非阻塞式的。这些函数在调用它们之后即返回，而不会等待文件传输完成。此外，若 FileReference 对象离开作用域，则对该对象尚未完成的上载或下载操作将在它离开作用域后被取消。只要希望上载或下载操作继续，就应确保将 FileReference 对象保留在作用域中。</p>
    
    <p class="- topic/p ">成功下载文件之后，将使用本地文件的属性填充 FileReference 对象的属性。如果下载成功，将调度 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件。</p>
    
    <p class="- topic/p ">每次只能执行一个 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">download()</codeph> 会话（因为每次只能调用一个对话框）。</p>
    
    <p class="- topic/p ">此方法支持使用 HTTP 或 HTTPS 下载任何文件类型。</p>
    
    <p class="- topic/p ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。</p>
    
    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：如果服务器要求用户身份验证，则只有在浏览器中运行的 SWF 文件（即使用浏览器插件或 ActiveX 控件的文件）才可以提供对话框来提示用户输入用户名和密码以进行身份验证，并且只适用于下载。对于使用插件或 ActiveX 控件进行的上载操作，以及使用独立或外部播放器进行的上载和下载操作，文件传输会失败。</p>
    
    <p class="- topic/p ">使用此方法时，请考虑 <ph class="- topic/ph ">Flash Player</ph> 安全模型： </p>
    
    <ul class="- topic/ul "><li class="- topic/li ">如果执行调用的 SWF 文件在不受信任的本地沙箱中，则不允许进行加载操作。</li><li class="- topic/li ">默认行为是拒绝沙箱之间的访问。网站可通过添加 URL 策略文件来实现对资源的访问。</li><li class="- topic/li ">可以在包含 SWF 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数，防止 SWF 文件使用此方法。</li><li class="- topic/li ">在 Flash Player 10 和 Flash Player 9 Update 5 中，只有响应用户事件（例如，在鼠标单击或按键事件的事件处理函数中）才能成功调用此方法。否则，调用此方法将导致 Flash Player 引发 Error 异常。</li></ul>
    
    <p class="- topic/p ">但<ph class="- topic/ph ">在 Adobe AIR 中</ph>，<codeph class="+ topic/ph pr-d/codeph ">应用程序</codeph>安全沙箱中的内容（使用 AIR 应用程序安装的内容）不受这些安全限制的约束。</p>
    
    <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
    
    
    <p class="- topic/p ">使用此方法下载文件时，将其标记为在标记下载的文件的操作系统上下载：</p>
           
    <ul class="- topic/ul "><li class="- topic/li ">Windows XP Service Pack 2 和更高版本，在 Windows Vista 上</li><li class="- topic/li ">Mac OS 10.5 和更高版本</li></ul>
           
    <p class="- topic/p ">有些操作系统（例如 Linux）不标记下载的文件。</p>
    
    <p class="- topic/p ">请注意，由于已向 Flash Player 中添加了新功能，因此当发布到 Flash Player 10 时，一次只可以激活下列操作中的一个操作：<codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.load()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.save()</codeph>。否则，Flash Player 会引发运行时错误（代码 2174）。使用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.cancel()</codeph> 可停止正在进行的操作。此限制仅适用于 Flash Player 10。早期版本的 Flash Player 在同时进行多个操作时不会受到此限制的影响。</p> 
    
 	
	<p class="- topic/p ">在 Adobe AIR 中，下载对话框并不始终显示在由另一个窗口（具有非空 <codeph class="+ topic/ph pr-d/codeph ">owner</codeph> 属性的窗口）拥有的窗口的前面。 要避免窗口顺序问题，请在调用此方法之前隐藏所拥有的窗口。</p>
	 
    </apiDesc><example conref="examples\FileReference_download.as" class="- topic/example "> 下面的示例演示 <codeph class="+ topic/ph pr-d/codeph ">download</codeph> 事件对象的用法。要运行此示例，请将 <codeph class="+ topic/ph pr-d/codeph ">downloadURL.url</codeph> 属性更改为指向一个实际的域和文件，而不是虚拟的 http://www.[yourDomain].com/SomeFile.pdf。您可能还需要编译 SWF 文件，将“本地播放安全性”设置为“只访问网络”，或更新 Flash Player 的安全设置，以允许此文件网络访问。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="../../flash/filesystem/File.html#downloaded" class="- topic/link "><linktext class="- topic/linktext ">File.downloaded</linktext></link><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.browse()</linktext></link><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.upload()</linktext></link><link href="flash.net.xml#FileReference/save()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.save()</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:download_open" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当下载操作开始时调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当下载操作开始时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_progress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">progress</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在文件下载操作期间进行定期调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在文件下载操作期间进行定期调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_complete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">complete</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当文件下载操作成功完成时调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当文件下载操作成功完成时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_cancel" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">cancel</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当用户取消对话框时调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当用户取消对话框时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_select" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">select</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当用户从对话框中选择要下载的文件时调度。 
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当用户从对话框中选择要下载的文件时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当由于安全错误导致下载失败时调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当由于安全错误导致下载失败时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:download_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">由于下列任一原因进行调度：
    <ul class="- topic/ul "><li class="- topic/li ">读取或传输文件期间发生输入/输出错误。</li><li class="- topic/li ">在 Flash Player 的独立或外部版本中运行的 SWF 内容尝试从需要身份验证的服务器下载文件。在下载期间，独立播放器和外部播放器不为用户提供用于输入密码的方法。如果这些播放器中的 SWF 文件尝试从要求身份验证的服务器下载文件，则下载会失败。只有在 ActiveX 控件和浏览器插件播放器中，文件下载才有可能成功。</li></ul>
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">由于下列任一原因而调度：正在读取或传输文件时发生输入/输出错误。在 Flash Player 的独立或外部版本中运行的 SWF 内容尝试从需要身份验证的服务器下载文件。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:FileReference:load" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">load</apiName><shortdesc class="- topic/shortdesc ">
    开始加载用户选择的本地文件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">load, FileReference.load
	</keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在以下情况下引发：1) 另一个 FileReference 或 FileReferenceList 浏览会话正在进行中；每次仅能执行一个文件浏览会话。2) 用户 mms.cfg 文件中的某个设置禁止此操作。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果应用程序无法为文件分配内存，则可能会发生此错误。文件可能太大，或者可用的内存可能太小。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">MemoryError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:MemoryError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">开始加载本地文件。
    
    </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    开始加载用户选择的本地文件。<ph class="- topic/ph ">虽然 Flash Player 没有限制可上载、下载、加载或保存的文件的大小，但其正式支持的文件大小最大为 100 MB。对于 Flash Player 中运行的内容，必须先调用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 方法，然后再调用 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法。不过，应用程序沙箱中运行于 AIR 中的内容调用 File 对象的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法之前不必先调用 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 方法。（AIR File 类扩展了 FileReference 类。）</ph>
    
    <p class="- topic/p ">侦听器接收事件来表示加载的进度、成功或失败。尽管可以使用 FileReferenceList 对象让用户选择多个要加载的文件，但仍必须逐个加载这些文件。要逐个加载文件，请遍历 FileReference 对象的 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.fileList</codeph> 数组。</p>
    
    <p class="- topic/p ">Adobe AIR 还包括为读取文件提供更多选项的 FileStream 类。</p>
    
    <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.load()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">FileReference.save()</codeph> 函数均不分块。这些函数在调用它们之后即返回，而不会等待文件传输完成。此外，如果 FileReference 对象离开作用域，则该对象中尚未完成的任何事务将在离开作用域时被取消。只要希望上载、下载、加载或保存能继续，就应确保将 FileReference 对象保留在作用域中。</p>
    
    <p class="- topic/p ">如果文件成功完成加载，则其内容将作为字节数组存储在 FileReference 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性中。</p>
    
    <p class="- topic/p ">有以下安全事项需要注意：</p>
    
    <ul class="- topic/ul "><li class="- topic/li ">如果执行调用的 SWF 文件在不受信任的本地沙箱中，则不允许进行加载操作。</li><li class="- topic/li ">默认行为是拒绝沙箱之间的访问。网站可通过添加跨域策略文件来实现对资源的访问。</li><li class="- topic/li ">可以在包含 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数，防止 SWF 文件使用此方法。</li></ul>
    
    <p class="- topic/p ">不过，这些注意事项不适用于应用程序沙箱中的 AIR 内容。</p>
    
    <p class="- topic/p ">请注意，当发布到 Flash Player 10 或 AIR 1.5 时，一次只能激活以下操作中的一项：<codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.load()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.save()</codeph>。否则，应用程序将引发运行时错误（代码 2174）。使用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.cancel()</codeph> 可停止正在进行的操作。此限制仅适用于 Flash Player 10 和 AIR 1.5。早期版本的 Flash Player 或 AIR 在同时进行多个操作时不会受到此限制的影响。</p>
    
 	
	<p class="- topic/p ">在 Adobe AIR 中，文件浏览对话框并不始终显示在由另一个窗口（具有非空 <codeph class="+ topic/ph pr-d/codeph ">owner</codeph> 属性的窗口）拥有的窗口的前面。要避免窗口顺序问题，请在调用此方法之前隐藏所拥有的窗口。</p>
	
    </apiDesc><example conref="examples\FileFilter.as" class="- topic/example "> 下面的示例从本地文件系统向根显示对象（本例中为舞台）上载图像。示例由 <xref href="http://blog.andrevenancio.com/" scope="external" class="- topic/xref ">Andre Venancio</xref> 提供。
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var buttonShape:Shape = new Shape();
buttonShape.graphics.beginFill(0x336699);
buttonShape.graphics.drawCircle(50, 50, 25);
var button = new SimpleButton(buttonShape, buttonShape, buttonShape, buttonShape);
addChild(button);

var fileRef:FileReference= new FileReference();
button.addEventListener(MouseEvent.CLICK, onButtonClick);

function onButtonClick(e:MouseEvent):void {
fileRef.browse([new FileFilter("Images", "*.jpg;*.gif;*.png")]);
fileRef.addEventListener(Event.SELECT, onFileSelected);
}

function onFileSelected(e:Event):void {
fileRef.addEventListener(Event.COMPLETE, onFileLoaded);
fileRef.load();
}

function onFileLoaded(e:Event):void {
var loader:Loader = new Loader();
loader.loadBytes(e.target.data);
addChild(loader);
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.browse()</linktext></link><link href="flash.net.xml#FileReference/data" class="- topic/link "><linktext class="- topic/linktext ">FileReference.data</linktext></link><link href="flash.net.xml#FileReferenceList/fileList" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.fileList</linktext></link><link href="flash.net.xml#FileReference/save()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.save()</linktext></link><link href="flash.filesystem.xml#FileStream" class="- topic/link "><linktext class="- topic/linktext ">FileStream</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:load_open" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在加载操作开始时调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在加载操作开始时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:load_progress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">progress</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在文件加载操作期间定期调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在文件加载操作期间定期调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:load_complete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">complete</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在文件加载操作成功完成时调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在文件加载操作成功完成时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:load_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在应用程序读取或写入文件期间由于发生输入/输出错误而导致加载失败时调用。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在应用程序读取或写入文件期间由于发生输入/输出错误而导致加载失败时调用。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:FileReference:save" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">save</apiName><shortdesc class="- topic/shortdesc ">
    打开一个对话框，允许用户将文件保存到本地文件系统。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在以下情况下引发：1) 另一个浏览会话正在进行中；每次仅能执行一个文件浏览会话。2) 要下载的文件的名称中包含禁止使用的字符。3) 用户 mms.cfg 文件中的某个设置禁止此操作。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 的类型不是 ByteArray，并且不具有 <codeph class="+ topic/ph pr-d/codeph ">toString()</codeph> 方法，则将引发异常。如果 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 的类型不是 XML，并且不具有 <codeph class="+ topic/ph pr-d/codeph ">toXMLString()</codeph> 方法，则将引发异常。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">为了响应用户动作（如鼠标事件或按键事件），将不会调用此方法。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 Flash Player 无法为该文件分配内存，则可能会发生此错误。文件可能太大，或者可用的内存可能太小。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">MemoryError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:MemoryError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">data</apiItemName><apiType value="any" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要保存的数据。数据可以采用几种格式之一，并将进行适当处理：
    <ul class="- topic/ul "><li class="- topic/li ">如果值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则应用程序将引发 ArgumentError 异常。</li><li class="- topic/li ">如果值为 String，则将其保存为 UTF-8 文本文件。</li><li class="- topic/li ">如果值为 XML，则会以 XML 格式将其写入到文本文件，并保留所有格式设置。</li><li class="- topic/li ">如果值为 ByteArray 对象，则会将其逐字写入到数据文件。</li><li class="- topic/li ">如果值并非以上任何一种，则 <codeph class="+ topic/ph pr-d/codeph ">save()</codeph> 方法将调用对象的 <codeph class="+ topic/ph pr-d/codeph ">toString()</codeph> 方法，将数据转换为字符串，然后将数据保存为文本文件。如果该操作失败，则应用程序将引发 ArgumentError 异常。</li></ul>
    
    </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">defaultFileName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对话框中显示的要保存文件的默认文件名。此字符串不能包含以下字符：/ \ : * ? " &lt; > | %
    <p class="- topic/p ">
    如果 File 对象调用此方法，则文件名将为 File 对象所引用文件的名称。（AIR File 类扩展了 FileReference 类。）</p>
    
    </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    打开一个对话框，允许用户将文件保存到本地文件系统。<ph class="- topic/ph ">虽然 Flash Player 没有限制可上载、下载、加载或保存的文件的大小，但是播放器正式支持的文件大小最大为 100 MB。</ph>
    
    <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">save()</codeph> 方法首先打开一个操作系统对话框，让用户输入文件名并在本地计算机上选择用于保存文件的位置。当用户选择了位置并确认保存操作时（例如通过单击“保存”），保存过程即会开始。侦听器接收事件来表示保存操作的进度、成功或失败。为了在调用 <codeph class="+ topic/ph pr-d/codeph ">save()</codeph> 后确定对话框和保存操作的状态，代码必须对 <codeph class="+ topic/ph pr-d/codeph ">cancel</codeph>、<codeph class="+ topic/ph pr-d/codeph ">open</codeph>、<codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 等事件进行侦听。
    </p>
    
    <p class="- topic/p ">Adobe AIR 还包括为本地保存文件提供更多选项的 FileStream 类。</p>
    
    <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.load()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">FileReference.save()</codeph> 函数均不分块。这些函数在调用它们之后即返回，而不会等待文件传输完成。此外，如果 FileReference 对象离开作用域，则该对象中尚未完成的任何事务将在离开作用域时被取消。只要希望上载、下载、加载或保存能继续，就应确保将 FileReference 对象保留在作用域中。</p>
    
    <p class="- topic/p ">在成功保存文件之后，将使用本地文件的属性填充 FileReference 对象的属性。如果保存成功，将调度 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件。</p>
    
    <p class="- topic/p ">每次只能执行一个 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">save()</codeph> 会话（因为每次只能调用一个对话框）。</p>
    
    <p class="- topic/p ">在 Flash Player 中，只有在响应用户事件（例如，在鼠标单击或按键事件的事件处理函数中）时才能成功调用此方法。否则，调用此方法将导致 Flash Player 引发 Error 异常。此限制不适用于应用程序沙箱中的 AIR 内容。</p>
    
 	
	<p class="- topic/p ">在 Adobe AIR 中，保存对话框并不始终显示在由另一个窗口（具有非空 <codeph class="+ topic/ph pr-d/codeph ">owner</codeph> 属性的窗口）拥有的窗口的前面。 要避免窗口顺序问题，请在调用此方法之前隐藏所拥有的窗口。</p>
	
    </apiDesc><example conref="examples\FileReference_save.as" class="- topic/example "> 以下示例将键入到文本字段的内容保存到文件。该示例创建一个可编辑的文本字段 (<codeph class="+ topic/ph pr-d/codeph ">MyTextField</codeph>)，创建另一不可编辑的文本字段 (<codeph class="+ topic/ph pr-d/codeph ">MyButtonField</codeph>) 作为“按钮”以响应鼠标单击。用户可以编辑第一个文本字段并单击按钮，将文本字段内容保存到本地文件。鼠标单击事件处理函数 <codeph class="+ topic/ph pr-d/codeph ">clickhandler</codeph> 使用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.save()</codeph> 方法（针对名为 <codeph class="+ topic/ph pr-d/codeph ">MyFileReference</codeph> 的 FileReference 对象）打开用户当前操作系统中的对话框，因此用户可以将内容保存为本地文件，使用用户提供的名称作为文件名。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#FileReferenceList/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.browse()</linktext></link><link href="flash.net.xml#FileReference/load()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.load()</linktext></link><link href="flash.net.xml#FileReference/data" class="- topic/link "><linktext class="- topic/linktext ">FileReference.data</linktext></link><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.upload()</linktext></link><link href="flash.net.xml#FileReference/download()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.download()</linktext></link><link href="flash.filesystem.xml#FileStream" class="- topic/link "><linktext class="- topic/linktext ">FileStream</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:save_open" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当下载操作开始时调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当下载操作开始时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:save_progress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">progress</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在文件下载操作期间进行定期调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在文件下载操作期间进行定期调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:save_complete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">complete</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当文件下载操作成功完成时调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当文件下载操作成功完成时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:save_cancel" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">cancel</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当用户取消对话框时调度。
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当用户取消对话框时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:save_select" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">select</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当用户从对话框中选择要下载的文件时调度。 
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当用户从对话框中选择要下载的文件时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:save_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">读取或传输文件期间发生输入/输出错误时调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">读取或传输文件期间发生输入/输出错误时调度。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:FileReference:uploadUnencoded" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">uploadUnencoded</apiName><shortdesc class="- topic/shortdesc ">
    启动将文件上载到 URL 的操作，不进行任何编码。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">本地不受信任的 SWF 文件可能无法与 Internet 进行通信。要避免这种情况，请将此 SWF 文件重新分类为只能与远程内容交互或受信任。引发此异常时会附带一个消息，指明不允许访问的本地文件和 URL 的名称。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在以下情况下引发：1) 另一个 FileReference 或 FileReferenceList 浏览会话正在进行中；每次仅能执行一个文件浏览会话。2) URL 参数为无效的路径或协议。文件上载必须使用 HTTP。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">request</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:URLRequest</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">URLRequest 对象，URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性应包含特定服务器脚本的 URL，该服务器脚本被配置为通过 HTTP <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 调用处理上载。在某些浏览器上，URL 字符串长度受限。在某些浏览器或服务器上，长度超过 256 个字符的字符串可能失败。若此参数为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，将引发异常。  
     
    <p class="- topic/p ">该 URL 可以是 HTTP，或者为了安全地进行上载，也可以是 HTTPS。要使用 HTTPS，请在 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 参数中使用 HTTPS URL。如果在 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 参数中没有指定端口号，则默认情况下，将使用端口 80（对于 HTTP）或端口 443（对于 HTTPS）。</p>
    
    <p class="- topic/p ">要向服务器发送 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 参数，请将 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性设置为您的参数，并将 <codeph class="+ topic/ph pr-d/codeph ">method</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.GET</codeph>。</p>
    
    </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">开始将文件上载到远程服务器，而无需进行编码。 
    
    </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    启动将文件上载到 URL 的操作，不进行任何编码。由于 <codeph class="+ topic/ph pr-d/codeph ">upload()</codeph> 方法会在 form-data 封套中对文件进行编码，因此 <codeph class="+ topic/ph pr-d/codeph ">uploadUnencoded()</codeph> 方法会在 HTTP 请求正文中按原样传递文件内容。如果要发送的数据已编码为接收服务器能够理解的格式，请使用 uploadUnencoded() 方法。<codeph class="+ topic/ph pr-d/codeph ">uploadeUnencoded()</codeph> 方法通常与 <codeph class="+ topic/ph pr-d/codeph ">HTTP/WebDAV PUT</codeph> 方法一起使用。
    
    </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.browse()</linktext></link><link href="flash.net.xml#FileReference/download()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.download()</linktext></link><link href="flash.net.xml#FileReferenceList/fileList" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.fileList</linktext></link><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">upload()</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_open" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当上载操作开始时调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当上载操作开始时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_progress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">progress</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在文件上载操作期间进行定期调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在文件上载操作期间进行定期调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_complete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">complete</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当文件上载操作成功完成时调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当文件上载操作成功完成时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_uploadCompleteData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">uploadCompleteData</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:DataEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">成功上载文件并从服务器接收数据之后调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">成功上载文件并从服务器接收数据之后调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">由于安全错误导致上载失败时调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">由于安全错误导致上载失败时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_httpStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpStatus</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">由于 HTTP 错误导致上载失败时调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">由于 HTTP 错误导致上载失败时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_httpResponseStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpResponseStatus</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">上载操作成功完成，服务器返回响应 URL 和响应标头。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">上载操作成功完成，服务器返回响应 URL 和响应标头。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:uploadUnencoded_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在下列任一情形下调用：
    <ul class="- topic/ul "><li class="- topic/li ">由于 Adobe AIR 在读/写或传输文件期间发生输入/输出错误，导致上载失败。</li><li class="- topic/li ">由于试图将文件上载到要求身份验证（如用户名和密码）的服务器，上载失败。在上载过程中，没有为用户提供输入密码的方式。</li><li class="- topic/li ">由于 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 参数包含无效协议，导致上载失败。<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 必须使用 HTTP 或 HTTPS。</li></ul>
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在下列任一情况下调用：由于 Adobe AIR 在读取、写入或传输文件时出现输入/输出错误，上载失败。由于试图将文件上载到要求身份验证（如用户名和密码）的服务器而使上载失败。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:FileReference:upload" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">upload</apiName><shortdesc class="- topic/shortdesc ">
    开始将文件上载到远程服务器。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">upload, FileReference.upload
    </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">本地不受信任的 SWF 文件可能无法与 Internet 进行通信。要避免这种情况，请将此 SWF 文件重新分类为只能与远程内容交互或受信任。引发此异常时会附带一个消息，指明不允许访问的本地文件和 URL 的名称。
    
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。
     
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在以下情况下引发：1) 另一个 FileReference 或 FileReferenceList 浏览会话正在进行中；每次仅能执行一个文件浏览会话。2) URL 参数为无效的路径或协议。文件上载必须使用 HTTP 协议，文件下载则必须使用 FTP 或 HTTP 协议。3) <codeph class="+ topic/ph pr-d/codeph ">uploadDataFieldName</codeph> 参数设置为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。4) 用户 mms.cfg 文件中的某个设置禁止此操作。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在以下情况下引发：1) <codeph class="+ topic/ph pr-d/codeph ">uploadDataFieldName</codeph> 参数为空字符串。2) <codeph class="+ topic/ph pr-d/codeph ">url.data</codeph> 为 ByteArray 类型。当与 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法一起使用时，<codeph class="+ topic/ph pr-d/codeph ">url.data</codeph> 只能为 URLVariables 或 String 类型。3) 在 AIR 运行时中（在应用程序安全沙箱中），URLRequest 的方法不是 GET 和 POST（而是使用 <codeph class="+ topic/ph pr-d/codeph ">uploadEncoded()</codeph>）。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">发生此错误的原因有：1) Flash Player 无法将 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.data</codeph> 参数从 UTF8 转换为 MBCS。如果传递给 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 的 URLRequest 对象设置为执行 GET 操作并且 <codeph class="+ topic/ph pr-d/codeph ">System.useCodePage</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，将发生该错误。2) Flash Player 无法为 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 数据分配内存。如果传递给 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 的 URLRequest 对象设置为执行 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 操作，将发生该错误。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">MemoryError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:MemoryError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">request</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:URLRequest</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">URLRequest 对象，URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性应包含特定服务器脚本的 URL，该服务器脚本被配置为通过 HTTP <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 调用处理上载。在某些浏览器上，URL 字符串长度受限。在某些浏览器或服务器上，长度超过 256 个字符的字符串可能失败。若此参数为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，将引发异常。URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">requestHeaders</codeph> 属性将被省略；上载或下载时不支持自定义 HTTP 请求标头。
     
    <p class="- topic/p ">该 URL 可以是 HTTP，或者为了安全地进行上载，也可以是 HTTPS。要使用 HTTPS，请在 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 参数中使用 HTTPS URL。如果在 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 参数中没有指定端口号，则默认情况下，将使用端口 80（对于 HTTP）或端口 443（对于 HTTPS）。</p>
    
    <p class="- topic/p ">要向服务器发送 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 参数，请将 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性设置为您的参数，并将 <codeph class="+ topic/ph pr-d/codeph ">method</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.GET</codeph>。</p>
    
    
    </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">uploadDataFieldName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">Filedata</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在上载 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 操作中位于文件数据之前的字段名。<codeph class="+ topic/ph pr-d/codeph ">uploadDataFieldName</codeph> 值必须为非空字符串。默认情况下，<codeph class="+ topic/ph pr-d/codeph ">uploadDataFieldName</codeph> 的值为 <codeph class="+ topic/ph pr-d/codeph ">"Filedata"</codeph>，如下面的范例 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 请求所示：
    <pre xml:space="preserve" class="- topic/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 class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">testUpload</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">请求上载测试文件的设置。如果 <codeph class="+ topic/ph pr-d/codeph ">testUpload</codeph> 为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则对于大于 10 KB 的文件，Flash Player 将尝试进行内容长度为 0 的测试文件上载 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph>。测试上载将检查实际文件上载是否可能成功，以及服务器身份验证（如果需要）是否可能成功。测试上载仅适用于 Windows 播放器。
    
    
    </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">开始将文件上载到远程服务器。
    
    </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    开始将文件上载到远程服务器。<ph class="- topic/ph ">虽然 Flash Player 没有限制可上载或下载的文件的大小，但是播放器正式支持的上载或下载文件大小最大为 100 MB。</ph>调用此方法之前，必须先调用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 方法。
    
    <p class="- topic/p ">对于扩展 FileReference 类的 Adobe AIR File 类，可以使用 <codeph class="+ topic/ph pr-d/codeph ">upload()</codeph> 方法上载任何文件。对于在 Flash Player 中使用的 FileReference 类，用户必须首先选择一个文件。</p>
    
    <p class="- topic/p ">侦听器接收事件来表示上载的进度、成功或失败。尽管可以使用 FileReferenceList 对象让用户选择多个要上载的文件，但必须逐个上载文件。为此，需遍历由 FileReference 对象组成的 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.fileList</codeph> 数组。</p>
    
    <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 函数是非阻塞式的。这些函数在调用它们之后即返回，而不会等待文件传输完成。此外，若 FileReference 对象离开作用域，则对该对象尚未完成的上载或下载操作将在它离开作用域后被取消。只要希望上载或下载操作继续，就应确保将 FileReference 对象保留在作用域中。</p>
    
    <p class="- topic/p ">文件上载到在 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 参数中传递的 URL。该 URL 必须是配置为接受上载的服务器脚本。Flash Player 使用 HTTP <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 方法上载文件。处理上载的服务器脚本应收到包含下列元素的 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 请求：</p>
    <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">Content-Type</codeph> ，属于 <codeph class="+ topic/ph pr-d/codeph ">multipart/form-data</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">Content-Disposition</codeph>，其 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 属性默认情况下设置为 <codeph class="+ topic/ph pr-d/codeph ">"Filedata"</codeph>，<codeph class="+ topic/ph pr-d/codeph ">filename</codeph> 属性设置为原始文件的名称</li><li class="- topic/li ">文件的二进制内容</li></ul>
    
     <p class="- topic/p ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。</p>
     
    <p class="- topic/p ">对于范例 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 请求，请参阅有关 <codeph class="+ topic/ph pr-d/codeph ">uploadDataFieldName</codeph> 参数的描述。可以使用 <codeph class="+ topic/ph pr-d/codeph ">upload()</codeph> 方法向服务器发送 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 参数，请参阅有关 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> 参数的描述。</p>
    
    <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">testUpload</codeph> 参数为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，并且要上载的文件大于约 10 KB，则基于 Windows 的 Flash Player 在上载实际的文件之前，会先发送不带内容的测试上载 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 操作，以验证传输操作是否可能成功。之后，Flash Player 会再次发送 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 操作，这时其中将包含实际的文件内容。对于小于 10 KB 的文件，Flash Player 则仅执行一次上载 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 操作，其中包含要上载的实际文件内容。基于 Macintosh 的 Flash Player 不执行测试上载 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 操作。</p>
    
    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：如果服务器要求用户身份验证，则只有在浏览器中运行的 SWF 文件（即使用浏览器插件或 ActiveX 控件的文件）才可以提供对话框来提示用户输入用户名和密码以进行身份验证，并且只适用于下载。对于使用插件或 ActiveX 控件进行的上载操作，以及使用独立或外部播放器进行的上载和下载操作，文件传输会失败。</p>
    
    <p class="- topic/p ">使用此方法时，请考虑 <ph class="- topic/ph ">Flash Player</ph> 安全模型： </p>
    
    
    <ul class="- topic/ul "><li class="- topic/li ">如果执行调用的 SWF 文件在不受信任的本地沙箱中，则不允许进行加载操作。</li><li class="- topic/li ">默认行为是拒绝沙箱之间的访问。网站可通过添加 URL 策略文件来实现对资源的访问。</li><li class="- topic/li ">可以在包含 SWF 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数，防止 SWF 文件使用此方法。</li></ul>
    
    <p class="- topic/p ">但在 Adobe AIR 中，<codeph class="+ topic/ph pr-d/codeph ">application</codeph> 安全沙箱中的内容（使用 AIR 应用程序安装的内容）不受这些安全限制的约束。</p>
    
    <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
    
    <p class="- topic/p ">请注意，由于已向 Flash Player 中添加了新功能，因此当发布到 Flash Player 10 时，一次只可以激活下列操作中的一个操作：<codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.load()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.save()</codeph>。否则，Flash Player 会引发运行时错误（代码 2174）。使用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.cancel()</codeph> 可停止正在进行的操作。此限制仅适用于 Flash Player 10。早期版本的 Flash Player 在同时进行多个操作时不会受到此限制的影响。</p>
    
    </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.browse()</linktext></link><link href="flash.net.xml#FileReference/download()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.download()</linktext></link><link href="flash.net.xml#FileReferenceList/fileList" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.fileList</linktext></link><link href="flash.net.xml#FileReference/load()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.load()</linktext></link></related-links><adobeApiEvent id="flash.net:FileReference:upload_open" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当上载操作开始时调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当上载操作开始时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_progress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">progress</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在文件上载操作期间进行定期调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在文件上载操作期间进行定期调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_complete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">complete</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当文件上载操作成功完成时调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当文件上载操作成功完成时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_uploadCompleteData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">uploadCompleteData</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:DataEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">成功上载文件并从服务器接收数据之后调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">成功上载文件并从服务器接收数据之后调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">由于安全错误导致上载失败时调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">由于安全错误导致上载失败时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_httpStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpStatus</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">由于 HTTP 错误导致上载失败时调度。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">由于 HTTP 错误导致上载失败时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_httpResponseStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpResponseStatus</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">上载操作成功完成，服务器返回响应 URL 和响应标头。
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">上载操作成功完成，服务器返回响应 URL 和响应标头。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReference:upload_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在下列任一情形下调用：
    <ul class="- topic/ul "><li class="- topic/li ">由于 <ph class="- topic/ph ">Flash Player </ph>或 Adobe AIR 在读/写或传输文件期间发生输入/输出错误，导致上载失败。</li><li class="- topic/li ">由于试图将文件上载到要求身份验证（如用户名和密码）的服务器，上载失败。在上载过程中，没有为用户提供输入密码的方式。</li><li class="- topic/li ">由于 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 参数包含无效协议，导致上载失败。<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 必须使用 HTTP 或 HTTPS。</li></ul>
    
    </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在下列任一情况下调用：由于 Flash Player 或 Adobe AIR 在读取、写入或传输文件时出现输入/输出错误，上载失败。由于试图将文件上载到要求身份验证（如用户名和密码）的服务器而使上载失败。</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.net:FileReference:creationDate:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">creationDate</apiName><shortdesc class="- topic/shortdesc ">
    本地磁盘上文件的创建日期。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">creationDate, FileReference.creationDate
    
    </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Date</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法未能成功调用，将引发异常，同时显示一条信息，指出函数的调用顺序不正确或先前调用未成功。此时，<codeph class="+ topic/ph pr-d/codeph ">creationDate</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若不能访问文件信息，则会引发一个异常，同时显示一条信息，指出发生文件 I/O 错误。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">作为 Date 对象获取文件的创建日期。
    
    </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    本地磁盘上文件的创建日期。如果未填充对象，则为获取此属性的值而执行的调用将返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:creator:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">creator</apiName><shortdesc class="- topic/shortdesc ">
    文件的 Macintosh 创建者类型，此类型仅用于 Mac OS X 之前的 Mac OS 版本中。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">creator, FileReference.creator
    </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在 Macintosh 系统上，若 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法未能成功调用，将引发异常，同时显示一条信息，指出函数的调用顺序不正确或先前调用未成功。此时，<codeph class="+ topic/ph pr-d/codeph ">creator</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">Macintosh 创建者类型。
    </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    文件的 Macintosh 创建者类型，此类型仅用于 Mac OS X 之前的 Mac OS 版本中。在 Windows 或 Linux 中，此属性为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。如果未填充 FileReference 对象，则为获得此属性的值而执行的调用将返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link><link href="flash.net.xml#FileReference/extension" class="- topic/link "><linktext class="- topic/linktext ">FileReference.extension</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:data:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">data</apiName><shortdesc class="- topic/shortdesc ">
    成功调用 load() 方法之后代表所加载文件中的数据的 ByteArray 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><refpath>
    </refpath></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.utils:ByteArray</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法未能成功调用，则将引发异常，同时显示一条消息，表示函数的调用顺序不正确或先前调用未成功。在这种情况下，<codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若无法打开或读取文件，或者在访问文件时遇到类似错误，将引发异常，同时显示一条信息，指明发生文件 I/O 错误。在这种情况下，<codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">文件的已加载数据，用 ByteArray 表示。
    </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    成功调用 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法之后代表所加载文件中的数据的 ByteArray 对象。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link><link href="flash.net.xml#FileReference/load()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.load()</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:extension:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">extension</apiName><shortdesc class="- topic/shortdesc ">
     文件扩展名。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果未初始化引用。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     文件扩展名。
     
     <p class="- topic/p ">文件的扩展名是最后一个句点（“.”）后面的名称部分（不包括句点）。如果文件名中没有句点，则 extension 为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
     
     <p class="- topic/p "><i class="+ topic/ph hi-d/i ">注意：</i>应该使用 <codeph class="+ topic/ph pr-d/codeph ">extension</codeph> 属性来确定文件的类型，不要使用 <codeph class="+ topic/ph pr-d/codeph ">creator</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">type</codeph> 属性。应该将 <codeph class="+ topic/ph pr-d/codeph ">creator</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">type</codeph> 属性视为已不推荐使用。它们适用于 Mac OS 的早期版本。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:FileReference:modificationDate:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">modificationDate</apiName><shortdesc class="- topic/shortdesc ">
   本地磁盘上文件的上一次修改日期。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">modificationDate, FileReference.modificationDate
   
   </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Date</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法未能成功调用，将引发异常，同时显示一条信息，指出函数的调用顺序不正确或先前调用未成功。此时，<codeph class="+ topic/ph pr-d/codeph ">modificationDate</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
   
   </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若不能访问文件信息，则会引发一个异常，同时显示一条信息，指出发生文件 I/O 错误。
   
   </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">作为 Date 对象获取文件的修改日期。
   </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
   本地磁盘上文件的上一次修改日期。如果未填充 FileReference 对象，则为获得此属性的值而执行的调用将返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
   
   </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:name:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">name</apiName><shortdesc class="- topic/shortdesc ">
   本地磁盘上的文件的名称。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><refpath>
   </refpath></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法未能成功调用，将引发异常，同时显示一条信息，指出函数的调用顺序不正确或先前调用未成功。
   
   </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">作为 String 获取文件的名称。
   </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
   本地磁盘上的文件的名称。如果未填充 FileReference 对象（通过对 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph> 的有效调用），则在尝试获取此属性的值时，Flash Player 将引发错误。
   <p class="- topic/p ">FileReference 对象的所有属性都通过调用 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 方法进行填充。与其他 FileReference 属性不同，如果调用 <codeph class="+ topic/ph pr-d/codeph ">download()</codeph> 方法，则在调度 <codeph class="+ topic/ph pr-d/codeph ">select</codeph> 事件时将填充 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 属性。</p>
   
   </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:size:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">size</apiName><shortdesc class="- topic/shortdesc ">
  本地磁盘上文件的大小（以字节为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><refpath>
  </refpath></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法未能成功调用，将引发异常，同时显示一条信息，指出函数的调用顺序不正确或先前调用未成功。
  
  </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若无法打开或读取文件，或者在访问文件时遇到类似错误，将引发异常，同时显示一条信息，指明发生文件 I/O 错误。
  
  </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">文件的大小，以字节为单位。
  </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  本地磁盘上文件的大小（以字节为单位）。<ph class="- topic/ph ">如果 <codeph class="+ topic/ph pr-d/codeph ">size</codeph> 为 0，将引发异常。</ph>
  
  <p class="- topic/p "><i class="+ topic/ph hi-d/i ">注意：</i>在 ActionScript 3.0 的初始版本中，<codeph class="+ topic/ph pr-d/codeph ">size</codeph> 属性定义为 uint 对象，该对象支持大小达 4 GB 的文件。现在，它以 Number 对象的形式实现，以支持更大的文件。 </p>
  
  </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link></related-links></apiValue><apiValue id="flash.net:FileReference:type:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">type</apiName><shortdesc class="- topic/shortdesc ">
  文件类型。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">type, FileReference.type
  </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">若 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法未能成功调用，将引发异常，同时显示一条信息，指出函数的调用顺序不正确或先前调用未成功。此时，<codeph class="+ topic/ph pr-d/codeph ">type</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
  
  </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">获取文件的类型或扩展名。
  </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  文件类型。 
  
  <p class="- topic/p ">在 Windows 或 Linux 上，此属性是文件扩展名。在 Macintosh 上，此属性是由四个字符组成的文件类型，仅用于 Mac OS X 之前的 Mac OS 版本中。如果未填充 FileReference 对象，则为获取此属性的值而执行的调用将返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
    
    <p class="- topic/p ">对于 Windows、Linux 和 Mac OS X，文件扩展名 — <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 属性最后一个句点 (.) 字符后的部分character — 标识文件类型。</p>
    
  </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/extension" class="- topic/link "><linktext class="- topic/linktext ">FileReference.extension</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:FileReferenceList" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">FileReferenceList</apiName><shortdesc class="- topic/shortdesc ">
 FileReferenceList 类提供了让用户选择一个或多个要上载的文件的方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">FileReferenceList
 
 </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">提供上载一个或多个文件的方法。
 
 </apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 FileReferenceList 类提供了让用户选择一个或多个要上载的文件的方法。FileReferenceList 对象将用户磁盘上的一组本地文件（一个或多个文件）表示为 FileReference 对象的数组。有关详细信息以及有关 FileReference 对象和 FileReference 类（可与 FileReferenceList 一起使用）的重要注意事项，请参阅 FileReference 类。
 
 <p class="- topic/p ">使用 FileReferenceList 类：</p>
 <ul class="- topic/ul "><li class="- topic/li ">将该类实例化：<codeph class="+ topic/ph pr-d/codeph ">var myFileRef = new FileReferenceList();</codeph></li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 方法，该方法将打开一个对话框，让用户选择一个或多个要上载的文件：<codeph class="+ topic/ph pr-d/codeph ">myFileRef.browse();</codeph></li><li class="- topic/li ">在成功调用 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 方法之后，使用 FileReference 对象数组来填充 FileReferenceList 对象的 <codeph class="+ topic/ph pr-d/codeph ">fileList</codeph> 属性。</li><li class="- topic/li ">对 <codeph class="+ topic/ph pr-d/codeph ">fileList</codeph> 数组中的每个元素调用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>。</li></ul>
 
 <p class="- topic/p ">FileReferenceList 类包括 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 方法以及用于处理多个文件的 <codeph class="+ topic/ph pr-d/codeph ">fileList</codeph> 属性。调用 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 的过程中，对于 Linux 和 Mac OS X 10.1 及早期版本，将暂停 Flash Player 的独立和外部版本中以及 AIR 中的 SWF 文件播放。</p>
 
 </apiDesc><example conref="examples\FileReferenceListExample.as" class="- topic/example "> 下例说明如何使用事件来管理多个文件的上载。CustomFileReferenceList 类扩展了 FileReferenceList，它包含一个 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件，在上载 FileReferenceList 对象中的各个文件时将调度该事件。FileReferenceList 对象中的所有文件上载完毕后，将调度 FileReferenceListExample 类中的 <codeph class="+ topic/ph pr-d/codeph ">LIST_COMPLETE</codeph> 事件。
 
 <p class="- topic/p ">要运行该示例，请插入一个编写好以接受 http://www.[yourDomain].com/yourUploadHandlerScript.cfm 处的文件上载的脚本。根据 SWF 文件的位置及文件的上载位置，您可能还需要编译 SWF 文件，将“本地播放安全性”设置为“只访问网络”，或更新 Flash <sup class="+ topic/ph hi-d/sup ">®</sup> Player 的安全设置，以允许此文件网络访问。如果上载服务器为远程服务器，并且要从桌面计算机运行此示例，则服务器必须具有 crossdomain.xml 文件。</p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#FileReference" class="- topic/link "><linktext class="- topic/linktext ">FileReference</linktext></link></related-links><adobeApiEvent id="flash.net:FileReferenceList_flash.events.Event.SELECT_select" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">select</apiName><shortdesc class="- topic/shortdesc ">
 当用户从文件浏览对话框选择一个或多个要上载的文件时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.SELECT</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当用户从文件浏览对话框选择一个或多个要上载的文件时调度。（当调用 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法时显示此对话框。） 当用户选择文件并确认该操作（例如，通过单击“保存”）时，会使用表示用户选择的文件的 FileReference 对象填充 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList</codeph> 对象。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReferenceList/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.browse()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:FileReferenceList_flash.events.Event.CANCEL_cancel" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">cancel</apiName><shortdesc class="- topic/shortdesc ">
 当用户退出文件浏览对话框时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><helpid>
 </helpid></asCustoms></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.CANCEL</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当用户退出文件浏览对话框时调度。（当调用 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法时显示此对话框。）
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReferenceList/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.browse()</linktext></link></related-links></adobeApiEvent><apiConstructor id="flash.net:FileReferenceList:FileReferenceList" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">FileReferenceList</apiName><shortdesc class="- topic/shortdesc ">
 	 创建新的 FileReferenceList 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 	 创建新的 FileReferenceList 对象。在对 FileReferenceList 对象调用 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 方法且用户选择一个或多个文件之前，该对象不包含任何内容。当对 FileReference 对象调用 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 时，该对象的 <codeph class="+ topic/ph pr-d/codeph ">fileList</codeph> 属性用 <codeph class="+ topic/ph pr-d/codeph ">FileReference</codeph> 对象数组来填充。
	 
	 </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference" class="- topic/link "><linktext class="- topic/linktext ">FileReference</linktext></link><link href="flash.net.xml#FileReferenceList/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.browse()</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:FileReferenceList:browse" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">browse</apiName><shortdesc class="- topic/shortdesc ">
	 显示文件浏览对话框，让用户选择一个或多个要上载的本地文件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><oldexample><pre xml:space="preserve" class="- topic/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 class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在以下情况下引发：1) 另一个 FileReference 或 FileReferenceList 浏览会话正在进行中；每次仅能执行一个文件浏览会话。2) 用户 mms.cfg 文件中的某个设置禁止此操作。 
	 </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">typeFilter</codeph> 数组包含格式不正确的 FileFilter 对象，将引发异常。有关过滤器正确格式化的详细信息，请参阅 FileFilter 文档。
	 
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">为了响应用户动作（如鼠标事件或按键事件），将不会调用此方法。
     
	 </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果参数有效并且打开了文件浏览对话框，则返回 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。
	 
	 </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">typeFilter</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Array</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 FileFilter 实例数组，用于过滤在对话框中显示的文件。如果省略此参数，则显示所有文件。有关详细信息，请参阅 <xref href="FileFilter.html" class="- topic/xref ">FileFilter</xref> 类。 
	 
	 </apiDesc></apiParam><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">显示一个文件浏览对话框，让用户选择要上载的本地文件。
	 
	 </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 显示文件浏览对话框，让用户选择一个或多个要上载的本地文件。该对话框对于用户的操作系统来说是本机的。
	 
	 <p class="- topic/p ">在 Flash Player 10 和更高版本中，只有响应用户事件（例如，在鼠标单击或按键事件的事件处理函数中）才能成功调用此方法。否则，调用此方法将导致 Flash Player 引发错误。</p>
	 
	 <p class="- topic/p ">当调用此方法并且用户成功选择文件时，此 FileReferenceList 对象的 <codeph class="+ topic/ph pr-d/codeph ">fileList</codeph> 属性用 FileReference 对象数组来填充，数组中的每个对象表示一个用户选择的文件。以后每次调用 FileReferenceList.browse() 方法时，<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.fileList</codeph> 属性都重置为用户在对话框中选择的文件。</p>
	 
	 <p class="- topic/p ">使用 <codeph class="+ topic/ph pr-d/codeph ">typeFilter</codeph> 参数，可决定对话框显示哪些文件。</p>
	 
	 <p class="- topic/p ">每次只能对 FileReferenceList 对象执行一个 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 会话（因为每次只能打开一个对话框）。</p>
	 
	 </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.browse()</linktext></link><link href="flash.net.xml#FileReference" class="- topic/link "><linktext class="- topic/linktext ">FileReference 类</linktext></link><link href="flash.net.xml#FileFilter" class="- topic/link "><linktext class="- topic/linktext ">FileFilter 类</linktext></link></related-links><adobeApiEvent id="flash.net:FileReferenceList:browse_select" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">select</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当用户从对话框中成功选择了要上载的项时进行调用。
	 </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当用户从对话框中成功选择了要上载的项时进行调用。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:FileReferenceList:browse_cancel" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">cancel</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在用户通过单击“取消”或关闭对话框来取消对话框时调用。
	 
	 </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在用户通过单击“取消”或关闭对话框来取消对话框时调用。</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.net:FileReferenceList:fileList:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">fileList</apiName><shortdesc class="- topic/shortdesc ">
	 一个 FileReference 对象数组。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Array</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">一个 FileReference 对象数组。
	 
	 </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 一个 <codeph class="+ topic/ph pr-d/codeph ">FileReference</codeph> 对象数组。
	 
	 <p class="- topic/p ">当调用了 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 方法并且用户已从 <codeph class="+ topic/ph pr-d/codeph ">browse()</codeph> 方法打开的对话框中选择了一个或多个文件后，此属性用 FileReference 对象数组来填充，数组中的每个对象表示一个用户选择的文件。然后，您可以通过 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 方法使用此数组上载每个文件。必须一次上载一个文件。</p>
	 
	 <p class="- topic/p ">每次对该 FileReferenceList 对象调用 browse() 时都要重新填充 <codeph class="+ topic/ph pr-d/codeph ">fileList</codeph> 属性。</p>
	 
	 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">FileReference</codeph> 对象的属性在 FileReference 类文档中介绍。</p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#FileReference" class="- topic/link "><linktext class="- topic/linktext ">FileReference</linktext></link><link href="flash.net.xml#FileReference/upload()" class="- topic/link "><linktext class="- topic/linktext ">FileReference.upload()</linktext></link><link href="flash.net.xml#FileReferenceList/browse()" class="- topic/link "><linktext class="- topic/linktext ">FileReferenceList.browse()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetworkInterface" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetworkInterface</apiName><shortdesc class="- topic/shortdesc ">
 NetworkInterface 类描述网络接口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 NetworkInterface 类描述网络接口。
 
 <p class="- topic/p ">可通过调用 NetworkInfo 对象的 <codeph class="+ topic/ph pr-d/codeph ">findInterfaces()</codeph> 方法获取网络接口列表。</p>
 
 </apiDesc><example conref="examples\NetworkInterfaceExample.as" class="- topic/example "/></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetworkInfo" class="- topic/link "><linktext class="- topic/linktext ">NetworkInfo</linktext></link><link href="flash.net.xml#InterfaceAddress" class="- topic/link "><linktext class="- topic/linktext ">InterfaceAddress</linktext></link></related-links><apiValue id="flash.net:NetworkInterface:active:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">active</apiName><shortdesc class="- topic/shortdesc ">
     报告此接口是否处于活动状态。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     报告此接口是否处于活动状态。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetworkInterface:addresses:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">addresses</apiName><shortdesc class="- topic/shortdesc ">
     绑定到此网络接口的地址的列表。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiType value="Vector$flash.net:InterfaceAddress" name="type" class="- topic/state reference/state apiRef/apiType "/></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     绑定到此网络接口的地址的列表。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetworkInterface:displayName:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">displayName</apiName><shortdesc class="- topic/shortdesc ">
     此网络接口的显示名称。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此网络接口的显示名称。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetworkInterface:hardwareAddress:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">hardwareAddress</apiName><shortdesc class="- topic/shortdesc ">
     此网络接口的硬件地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此网络接口的硬件地址。
     
     <p class="- topic/p ">硬件地址通常是网路适配器或接口卡的媒体访问控制 (MAC) 地址。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetworkInterface:mtu:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">mtu</apiName><shortdesc class="- topic/shortdesc ">
     此网络接口的最大传输单元 (MTU)。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此网络接口的最大传输单元 (MTU)。 
     
     <p class="- topic/p ">如果将 <codeph class="+ topic/ph pr-d/codeph ">mtu</codeph> 值报告为 <codeph class="+ topic/ph pr-d/codeph ">-1</codeph>，则实际 MTU 未知。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetworkInterface:name:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">name</apiName><shortdesc class="- topic/shortdesc ">
     此网络接口的名称。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此网络接口的名称。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetworkInterface:parent:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">parent</apiName><shortdesc class="- topic/shortdesc ">
     表示父级接口的 NetworkInterface 对象（如果此接口包含父级）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.net:NetworkInterface</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示父级接口的 NetworkInterface 对象（如果此接口包含父级）。
     
     <p class="- topic/p ">如果它是子接口，此接口可以有父项。如果此接口没有父项，则 <codeph class="+ topic/ph pr-d/codeph ">parent</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetworkInterface:subInterfaces:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">subInterfaces</apiName><shortdesc class="- topic/shortdesc ">
     附加到此网络接口的子接口的列表。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiType value="Vector$flash.net:NetworkInterface" name="type" class="- topic/state reference/state apiRef/apiType "/></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     附加到此网络接口的子接口的列表。
     
     <p class="- topic/p ">子接口通常为虚拟接口。如果此接口没有子接口，则 <codeph class="+ topic/ph pr-d/codeph ">subInterfaces</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:SharedObjectFlushStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">SharedObjectFlushStatus</apiName><shortdesc class="- topic/shortdesc ">
 SharedObjectFlushStatus 类为通过调用 SharedObject.flush() 方法而返回的代码提供了值。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 SharedObjectFlushStatus 类为通过调用 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.flush()</codeph> 方法而返回的代码提供了值。
 
 </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/flush()" class="- topic/link "><linktext class="- topic/linktext ">SharedObject.flush()</linktext></link></related-links><apiValue id="flash.net:SharedObjectFlushStatus:FLUSHED" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">FLUSHED</apiName><shortdesc class="- topic/shortdesc ">
 表示成功完成了刷新。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">flushed</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 表示成功完成了刷新。
 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/flush()" class="- topic/link "><linktext class="- topic/linktext ">SharedObject.flush()</linktext></link></related-links></apiValue><apiValue id="flash.net:SharedObjectFlushStatus:PENDING" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">PENDING</apiName><shortdesc class="- topic/shortdesc ">
 表示在可以刷新之前，提示用户增加共享对象的磁盘空间。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">pending</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 表示在可以刷新之前，提示用户增加共享对象的磁盘空间。
 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/flush()" class="- topic/link "><linktext class="- topic/linktext ">SharedObject.flush()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:SecureSocket" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">SecureSocket</apiName><shortdesc class="- topic/shortdesc ">
 SecureSocket 类使代码能使用安全套接字层 (SSL) 协议和传输层安全 (TLS) 协议进行套接字连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.net:Socket</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 SecureSocket 类使代码能使用安全套接字层 (SSL) 协议和传输层安全 (TLS) 协议进行套接字连接。 
 
 <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>所有桌面操作系统均支持此功能，但不是所有用于电视的 AIR 设备都支持此功能。移动设备不支持此功能。您可以使用 <codeph class="+ topic/ph pr-d/codeph ">SecureSocket.isSupported</codeph> 属性在运行时测试是否受支持。有关在多个配置文件之间支持 API 的详细信息，请参阅 <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">AIR 配置文件支持</xref>。</p>
 
 <p class="- topic/p ">SSL/TLS 协议提供了一种可以通过主机的证书对其身份进行身份验证的机制，并提供套接字上的加密通信。支持 SSLv3 和 TLSv1。对服务器证书的验证是使用客户端平台的信任存储和证书验证支持执行的。</p> 
 
 <p class="- topic/p ">SecureSocket 类将仅连接到具有有效的受信任证书的服务器。您无法选择连接到证书存在问题的服务器。例如，无法连接到具有过期的证书或与受信任的根证书没有联系的证书（尽管该证书可能是有效的）的服务器。</p>
 
 <p class="- topic/p ">SecureSocket 类在执行与受信任服务器的加密通信时很有用。在其他方面，SecureSocket 对象与常规 Socket 对象相同。</p>
 
 <p class="- topic/p ">要使用 SecureSocket 类的方法，请首先使用构造函数 <codeph class="+ topic/ph pr-d/codeph ">new SecureSocket()</codeph> 创建一个 SecureSocket 对象。当连接到服务器时，验证服务器证书。如果该证书有效且受信任，则建立连接且 Socket 将调度 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件。如果证书没有通过验证，则 Socket 将调度 <codeph class="+ topic/ph pr-d/codeph ">IOError</codeph> 事件。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">重要信息：</b>并非所有操作系统都支持联机证书状态协议 (OCSP)。用户也可以在各计算机上禁用 OCSP 检查。如果不支持或已禁用 OCSP，并且证书中不包含使用证书吊销列表 (CRL) 来检查吊销的必要信息，将不检查证书吊销。否则，将接受有效的证书。这可能允许服务器使用吊销的证书。</p>
 
 </apiDesc><example conref="examples\SecureSocketExample.as" class="- topic/example "> 下面的示例说明了如何创建和连接 SecureSocket 对象。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">package
{
    import flash.display.Sprite;
    import flash.errors.IOError;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.net.SecureSocket;
    
    public class SecureSocketExample extends Sprite
    {
        private var secureSocket:SecureSocket = new SecureSocket();
        
        public function SecureSocketExample()
        {
            secureSocket.addEventListener( Event.CONNECT, onConnect )
            secureSocket.addEventListener( IOErrorEvent.IO_ERROR, onError );
            
            try
            {
                secureSocket.connect( "208.77.188.166", 443 );
            }
            catch ( error:Error )
            {
                trace ( error.toString() );
            }
        }
        
        private function onConnect( event:Event ):void
        {
            trace("Connected.");
        }
        
        private function onError( error:IOErrorEvent ):void
        {
            trace( error.text + ", " + secureSocket.serverCertificateStatus );
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Socket" class="- topic/link "><linktext class="- topic/linktext ">Socket 类</linktext></link></related-links><adobeApiEvent id="flash.net:SecureSocket_flash.events.ProgressEvent.SOCKET_DATA_socketData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">socketData</apiName><shortdesc class="- topic/shortdesc ">
 在套接字接收到数据后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.ProgressEvent.SOCKET_DATA</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在套接字接收到数据后调度。<codeph class="+ topic/ph pr-d/codeph ">socketData</codeph> 类型的事件不使用 <codeph class="+ topic/ph pr-d/codeph ">ProgressEvent.bytesTotal</codeph> 属性。 
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:SecureSocket_flash.events.IOErrorEvent.IO_ERROR_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><shortdesc class="- topic/shortdesc ">
 当发生导致发送或接收操作失败的输入或输出错误时进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当发生导致发送或接收操作失败的输入或输出错误时进行调度。
 
 <p class="- topic/p ">无法验证服务器证书时，调度的错误事件是 IOError。在这种情况下，可以检查 <codeph class="+ topic/ph pr-d/codeph ">serverCertificateStatus</codeph> 属性来确定问题的原因。</p>
  
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:SecureSocket_flash.events.Event.CONNECT_connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
 在建立网络连接后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.CONNECT</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在建立网络连接后调度。 
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:SecureSocket_flash.events.Event.CLOSE_close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
 在服务器关闭套接字连接时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.CLOSE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在服务器关闭套接字连接时调度。 
 
 <p class="- topic/p ">仅当服务器关闭连接时调度 <codeph class="+ topic/ph pr-d/codeph ">close</codeph> 事件；在调用 <codeph class="+ topic/ph pr-d/codeph ">SecureSocket.close()</codeph> 方法时不调度该事件。</p>
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:SecureSocket:SecureSocket" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">SecureSocket</apiName><shortdesc class="- topic/shortdesc ">
    创建新的 SecureSocket 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">此错误发生在 SSLv3 或 TLSv1 支持不可用时。
	
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IllegalOperationError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IllegalOperationError</apiOperationClassifier></apiException></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    创建新的 SecureSocket 对象。
	
	<p class="- topic/p ">在创建 SecureSocket 实例之前检查 <codeph class="+ topic/ph pr-d/codeph ">SecureSocket.isSupported</codeph>。如果不支持 SSLv3 或 TLSv1 套接字，运行时将引发 IllegalOperationError。</p>
    
	</apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.net:SecureSocket:connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
     使用 SSL 或 TLS 将套接字连接到指定的主机和端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>BRS compare this entire description with XMLSocket.connect() and make consistent
     </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiIsOverride class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiIsOverride "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">未指定任何主机，而且连接失败。
	 
	 </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果指定低于零或高于 65535 的套接字端口，将发生此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">host</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要连接到的主机的名称或 IP 地址。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">port</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要连接到的端口号。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     使用 SSL 或 TLS 将套接字连接到指定的主机和端口。
     
     <p class="- topic/p ">当调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法时，验证服务器证书。如果 SSL/TLS 握手成功，证书有效、可信，并且建立了连接，则套接字会调度 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件。如果握手失败或无法验证该证书，则套接字将调度 <codeph class="+ topic/ph pr-d/codeph ">IOError</codeph> 事件。如果已调度其中一个事件，则可以通过读取 <codeph class="+ topic/ph pr-d/codeph ">serverCertificateStatus</codeph> 属性来检查证书验证结果。（如果调度了 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件，则证书状态始终为 <codeph class="+ topic/ph pr-d/codeph ">trusted</codeph>。）</p>
	 
     <p class="- topic/p ">如果已连接上套接字，则现有的连接将首先关闭。</p>
     
     </apiDesc></apiOperationDetail><adobeApiEvent id="flash.net:SecureSocket:connect_connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在建立网络连接后调度。
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在建立网络连接后调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:SecureSocket:connect_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在指定了主机但出现输入/输出错误并由此导致连接失败时调度。这包括 SSL/TLS 握手错误和无法成功验证主机的服务器证书。
	 
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在指定了主机但出现输入/输出错误并由此导致连接失败时调度。</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.net:SecureSocket:isSupported:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">isSupported</apiName><shortdesc class="- topic/shortdesc ">
     表示当前系统是否支持安全套接字。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示当前系统是否支持安全套接字。
     
     <p class="- topic/p ">并非所有平台都支持安全套接字。请在尝试创建新的 SecureSocket 实例之前检查此属性。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:SecureSocket:serverCertificateStatus:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">serverCertificateStatus</apiName><shortdesc class="- topic/shortdesc ">
     服务器证书的状态。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     服务器证书的状态。
     
     <p class="- topic/p ">在套接字尝试连接到服务器之前，状态为 <codeph class="+ topic/ph pr-d/codeph ">CertificateStatus.UNKNOWN</codeph>。验证后，该状态将为由 CertificateStatus 类枚举的字符串之一。仅当证书有效且受信任时连接才能成功。因此，在 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件后，状态始终为 <codeph class="+ topic/ph pr-d/codeph ">trusted</codeph>。 </p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>证书通过验证或被拒绝后，则直到下次调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法时才会更新状态值。调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 不会将状态值重置为“unknown”。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.security.xml#CertificateStatus" class="- topic/link "><linktext class="- topic/linktext ">CertificateStatus 类</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:ServerSocket" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">ServerSocket</apiName><shortdesc class="- topic/shortdesc ">
 ServerSocket 类允许代码充当传输控制协议 (TCP) 连接的服务器。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 ServerSocket 类允许代码充当传输控制协议 (TCP) 连接的服务器。 
 
 <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>所有桌面操作系统均支持此功能，但移动设备或用于电视的 AIR 设备不支持此功能。您可以使用 <codeph class="+ topic/ph pr-d/codeph ">ServerSocket.isSupported</codeph> 属性在运行时测试是否受支持。有关在多个配置文件之间支持 API 的详细信息，请参阅 <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">AIR 配置文件支持</xref>。</p>
 
 <p class="- topic/p ">TCP 服务器侦听来自远程客户端的传入连接。当客户端尝试连接时，ServerSocket 将调度 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件。为此事件调度的 ServerSocketConnectEvent 对象提供了表示服务器和客户端之间 TCP 连接的 Socket 对象。将此 Socket 对象用于与连接的客户端的后续通信。如果需要，您可以从 Socket 对象获取客户端地址和端口。</p> 
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>您的应用程序负责维持对客户端 Socket 对象的引用。如果不这样做，则该对象符合垃圾回收的条件，可能会在运行时损坏，但不会发出警告。</p>
 
 <p class="- topic/p ">要使 ServerSocket 对象进入侦听状态，请调用 <codeph class="+ topic/ph pr-d/codeph ">listen()</codeph> 方法。在侦听状态下，每当使用 TCP 协议的客户端尝试连接到绑定地址和端口时，服务器 Socket 对象将调度 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件。在调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 方法之前，ServerSocket 对象将继续侦听其他连接。</p>
 
 <p class="- topic/p ">TCP 连接是永久性的，除非连接的一方关闭此连接或发生严重网络故障，否则会一直存在。通过连接发送的任何数据会分解为可传输的数据包并在另一端进行重组。保证所有数据包到达（合理的情况下）— 会重新传输任何丢失的数据包。一般来说，TCP 协议可以比 UDP 协议更好地管理可用网络带宽。要求套接字通信的多数 AIR 应用程序应该使用 ServerSocket 和 Socket 类（而非 DatagramSocket 类）。</p>
 
 <p class="- topic/p ">ServerSocket 类仅可在 Adobe AIR 应用程序和应用程序安全沙箱中使用。</p>
 
 <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
 
 </apiDesc><example conref="examples\ServerSocketExample.as" class="- topic/example "> 下面的示例创建一个套接字服务器。要使用该服务器，可将套接字绑定到本地端口，然后从其他应用程序连接到该端口。该服务器仅识别 UTF-8 字符串。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.events.ProgressEvent;
    import flash.events.ServerSocketConnectEvent;
    import flash.net.ServerSocket;
    import flash.net.Socket;
    import flash.text.TextField;
    import flash.text.TextFieldType;
    import flash.utils.ByteArray;
        
    public class ServerSocketExample extends Sprite
    {
        private var serverSocket:ServerSocket = new ServerSocket();
        private var clientSocket:Socket;

        private var localIP:TextField;
        private var localPort:TextField;
        private var logField:TextField;
        private var message:TextField;

        public function ServerSocketExample()
        {
            setupUI();
        }
        
        private function onConnect( event:ServerSocketConnectEvent ):void
        {
            clientSocket = event.socket;
            clientSocket.addEventListener( ProgressEvent.SOCKET_DATA, onClientSocketData );
            log( "Connection from " + clientSocket.remoteAddress + ":" + clientSocket.remotePort );
        }
        
        private function onClientSocketData( event:ProgressEvent ):void
        {
            var buffer:ByteArray = new ByteArray();
            clientSocket.readBytes( buffer, 0, clientSocket.bytesAvailable );
            log( "Received: " + buffer.toString() );
        }

        private function bind( event:Event ):void
        {
            if( serverSocket.bound ) 
            {
                serverSocket.close();
                serverSocket = new ServerSocket();
                
            }
            serverSocket.bind( parseInt( localPort.text ), localIP.text );
            serverSocket.addEventListener( ServerSocketConnectEvent.CONNECT, onConnect );
            serverSocket.listen();
            log( "Bound to: " + serverSocket.localAddress + ":" + serverSocket.localPort );
        }
        
        private function send( event:Event ):void
        {
            try
            {
                if( clientSocket != null &amp;&amp; clientSocket.connected )
                {
                    clientSocket.writeUTFBytes( message.text );
                    clientSocket.flush(); 
                    log( "Sent message to " + clientSocket.remoteAddress + ":" + clientSocket.remotePort );
                }
                else log("No socket connection.");
            }
            catch ( error:Error )
            {
                log( error.message );
            }
        }

        private function log( text:String ):void
        {
            logField.appendText( text + "\n" );
            logField.scrollV = logField.maxScrollV;
            trace( text );
        }

        private function setupUI():void
        {
            localIP = createTextField( 10, 10, "Local IP", "0.0.0.0");
            localPort = createTextField( 10, 35, "Local port", "0" );
            createTextButton( 170, 60, "Bind", bind );
            message = createTextField( 10, 85, "Message", "Lucy can't drink milk." );
            createTextButton( 170, 110, "Send", send );
            logField = createTextField( 10, 135, "Log", "", false, 200 )
            
            this.stage.nativeWindow.activate();
        }
        
        private function createTextField( x:int, y:int, label:String, defaultValue:String = '', editable:Boolean = true, height:int = 20 ):TextField
        {
            var labelField:TextField = new TextField();
            labelField.text = label;
            labelField.type = TextFieldType.DYNAMIC;
            labelField.width = 100;
            labelField.x = x;
            labelField.y = y;
            
            var input:TextField = new TextField();
            input.text = defaultValue;
            input.type = TextFieldType.INPUT;
            input.border = editable;
            input.selectable = editable;
            input.width = 280;
            input.height = height;
            input.x = x + labelField.width;
            input.y = y;
            
            this.addChild( labelField );
            this.addChild( input );
            
            return input;
        }
        
        private function createTextButton( x:int, y:int, label:String, clickHandler:Function ):TextField
        {
            var button:TextField = new TextField();
            button.htmlText = "&lt;u>&lt;b>" + label + "&lt;/b>&lt;/u>";
            button.type = TextFieldType.DYNAMIC;
            button.selectable = false;
            button.width = 180;
            button.x = x;
            button.y = y;
            button.addEventListener( MouseEvent.CLICK, clickHandler );
            
            this.addChild( button );
            return button;
        }        
    }
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.events.xml#ServerSocketConnectEvent" class="- topic/link "><linktext class="- topic/linktext ">ServerSocketConnectEvent 类</linktext></link><link href="flash.net.xml#Socket" class="- topic/link "><linktext class="- topic/linktext ">Socket 类</linktext></link><link href="flash.net.xml#XMLSocket" class="- topic/link "><linktext class="- topic/linktext ">XMLSocket 类</linktext></link><link href="flash.net.xml#DatagramSocket" class="- topic/link "><linktext class="- topic/linktext ">DatagramSocket 类</linktext></link></related-links><adobeApiEvent id="flash.net:ServerSocket_flash.events.ServerSocketConnectEvent.CONNECT_connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
 当远程套接字搜索到此服务器套接字的连接时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.ServerSocketConnectEvent.CONNECT</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ServerSocketConnectEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当远程套接字搜索到此服务器套接字的连接时调度。
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:ServerSocket_flash.events.Event.CLOSE_close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
 当操作系统关闭此套接字时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.CLOSE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当操作系统关闭此套接字时调度。
  
 <p class="- topic/p ">调用 ServerSocket <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 方法时并不调度 <codeph class="+ topic/ph pr-d/codeph ">close</codeph> 事件。如果应用程序中的其他对象依靠 <codeph class="+ topic/ph pr-d/codeph ">close</codeph> 事件，可在调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 方法之前手动调度此事件。</p>
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:ServerSocket:ServerSocket" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">ServerSocket</apiName><shortdesc class="- topic/shortdesc ">
     创建一个 ServerSocket 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用的内容在 AIR 应用程序安全沙箱之外运行时，发生此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建一个 ServerSocket 对象。
     
     </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.net:ServerSocket:bind" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">bind</apiName><shortdesc class="- topic/shortdesc ">
     将此套接字绑定到指定的本地地址和端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 <codeph class="+ topic/ph pr-d/codeph ">localPort</codeph> 小于 0 或大于 65535 时，会发生此错误。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 <codeph class="+ topic/ph pr-d/codeph ">localAddress</codeph> 在语法形式上是格式不正确的 IP 地址时，将发生此错误。
     
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当套接字无法绑定时，如出现下列情况时：
     <ul class="- topic/ul "><li class="- topic/li ">基础网络套接字（IP 和端口）已被其他对象或进程绑定。</li><li class="- topic/li ">应用程序运行所使用的用户帐户不具有绑定到此端口的必要权限。尝试绑定到经常使用的端口 (<codeph class="+ topic/ph pr-d/codeph ">localPort</codeph> &lt; 1024) 时通常会发生权限问题</li><li class="- topic/li ">此 ServerSocket 对象已绑定。（在绑定到其他套接字之前调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph>。）</li><li class="- topic/li ">当 <codeph class="+ topic/ph pr-d/codeph ">localAddress</codeph> 不是有效的本地地址时。</li></ul>
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">localPort</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">绑定到本地计算机的端口数量。如果将 <codeph class="+ topic/ph pr-d/codeph ">localPort</codeph> 设置为 0（默认值），则绑定下一个可用的系统端口。连接到 1024 以下的端口号的权限受系统安全策略的限制。例如，在 Mac 和 Linux 系统中，应用程序必须拥有连接到 1024 以下的端口的根权限才能运行。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">localAddress</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0.0.0.0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要绑定到的本地计算机上的 IP 地址。此地址可以是 IPv4 地址，也可以是 IPv6 地址。如果将 <codeph class="+ topic/ph pr-d/codeph ">localAddress</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">0.0.0.0</codeph>（默认值），该套接字将侦听所有可用的 IPv4 地址。要侦听所有可用的 IPv6 地址，则必须将“::”指定为 <codeph class="+ topic/ph pr-d/codeph ">localAddress</codeph> 参数。要使用 IPv6 地址，计算机和网络必须都配置为支持 IPv6。此外，绑定到 IPv4 地址的套接字无法连接到使用 IPv6 地址的套接字。同样，绑定到 IPv6 地址的套接字无法连接到使用 IPv4 地址的套接字。地址类型必须匹配。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将此套接字绑定到指定的本地地址和端口。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:ServerSocket:close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     关闭套接字并停止侦听连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果套接字无法关闭或未打开，则发生此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     关闭套接字并停止侦听连接。
     
	 <p class="- topic/p ">关闭的套接字无法重新打开。应创建一个新的 ServerSocket 实例。</p>
	 
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:ServerSocket:listen" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">listen</apiName><shortdesc class="- topic/shortdesc ">
     表示侦听绑定的 IP 地址和端口上的 TCP 连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果套接字未打开或绑定，则发生此错误。如果对 <codeph class="+ topic/ph pr-d/codeph ">listen()</codeph> 的调用由于任何其他原因而失败时也会发生此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">backlog</codeph> 参数小于零，则发生此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">backlog</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">挂起连接的最大队列长度。如果 <codeph class="+ topic/ph pr-d/codeph ">backlog</codeph> 是 0，队列长度将设置为系统最大值。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示侦听绑定的 IP 地址和端口上的 TCP 连接。
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">listen()</codeph> 方法立即返回。调用 <codeph class="+ topic/ph pr-d/codeph ">listen()</codeph> 之后，只要尝试连接，ServerSocket 对象就会调度 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件。ServerSocketConnectEvent 事件对象的 <codeph class="+ topic/ph pr-d/codeph ">socket</codeph> 属性引用表示服务器-客户端连接的 Socket 对象。</p>
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">backlog</codeph> 参数指定当应用程序处理 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件时排队的挂起连接数。如果队列已满，则无需调度 <codeph class="+ topic/ph pr-d/codeph ">connect</codeph> 事件即可拒绝其他连接。如果指定了默认值零，则使用系统最大队列长度。此长度随平台不同而不同，可以根据计算机进行配置。如果指定值超出系统最大长度，则使用系统最大长度。未提供查找实际 backlog 值的方法。（系统最大值取决于主机上 TCP 网络子系统的 SOMAXCONN 设置。）</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:ServerSocket:bound:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bound</apiName><shortdesc class="- topic/shortdesc ">
     表示套接字是否绑定到本地地址和端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示套接字是否绑定到本地地址和端口。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#ServerSocket/bind()" class="- topic/link "><linktext class="- topic/linktext ">bind()</linktext></link></related-links></apiValue><apiValue id="flash.net:ServerSocket:isSupported:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">isSupported</apiName><shortdesc class="- topic/shortdesc ">
     表示运行时环境是否支持 ServerSocket 功能。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示运行时环境是否支持 ServerSocket 功能。
     
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:ServerSocket:listening:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">listening</apiName><shortdesc class="- topic/shortdesc ">
     表示服务器套接字是否侦听传入连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示服务器套接字是否侦听传入连接。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#ServerSocket/listen()" class="- topic/link "><linktext class="- topic/linktext ">listen()</linktext></link></related-links></apiValue><apiValue id="flash.net:ServerSocket:localAddress:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">localAddress</apiName><shortdesc class="- topic/shortdesc ">
     套接字所侦听的 IP 地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     套接字所侦听的 IP 地址。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#ServerSocket/bind()" class="- topic/link "><linktext class="- topic/linktext ">bind()</linktext></link></related-links></apiValue><apiValue id="flash.net:ServerSocket:localPort:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">localPort</apiName><shortdesc class="- topic/shortdesc ">
     套接字所侦听的端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     套接字所侦听的端口。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#ServerSocket/bind()" class="- topic/link "><linktext class="- topic/linktext ">bind()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:FileFilter" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">FileFilter</apiName><shortdesc class="- topic/shortdesc ">
 FileFilter 类用于表示在调用 FileReference.browse() 方法、FileReferenceList.browse() 方法或调用 File、FileReference 或 FileReferenceList 对象的 browse 方法时显示的文件浏览对话框中显示用户系统上的哪些文件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 FileFilter 类用于表示在调用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph> 方法、<codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 方法或调用 File、FileReference 或 FileReferenceList 对象的 browse 方法时显示的文件浏览对话框中显示用户系统上的哪些文件。FileFilter 实例作为可选 <codeph class="+ topic/ph pr-d/codeph ">typeFilter</codeph> 参数的值传递给该方法。如果使用 FileFilter 实例，则会滤除 FileFilter 实例中未指定的扩展名和文件类型，即用户无法选择这些类型。如果未向方法传递任何 FileFilter 对象，则对话框中将显示所有文件。
 
 <p class="- topic/p ">可以采用以下两种方式之一使用 FileFilter 实例：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">仅包含文件扩展名的描述</li><li class="- topic/li ">包含文件扩展名和 Macintosh 文件类型的描述</li></ul>
 
 <p class="- topic/p ">这两种格式不能在一个 browse 方法调用中互换。必须使用其中一种格式。</p>
 
 <p class="- topic/p ">可以向 browse 方法传递一个或多个 FileFilter 实例，如下所示：</p>
 
 <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
 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 class="- topic/p ">或者在 AIR 应用程序中：</p>
 
 <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
 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>
 
 
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">FileFilter.extension</codeph> 属性中的扩展名列表用于筛选文件浏览对话框中显示的文件。该列表实际并不显示在对话框中；要对用户显示文件类型，必须在描述字符串以及扩展名列表中列出文件类型。在 Windows 和 Linux 中，描述字符串显示在对话框中。（在 Macintosh<sup class="+ topic/ph hi-d/sup ">®</sup> 中不使用该列表。）在 Macintosh 上，如果提供 Macintosh 文件类型的列表，则该列表用于过滤文件。如果未提供，则使用文件扩展名列表。 </p> 
 
 </apiDesc></apiClassifierDetail><apiConstructor id="flash.net:FileFilter:FileFilter" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">FileFilter</apiName><shortdesc class="- topic/shortdesc ">
	 创建一个新的 FileFilter 实例。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">description</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">用户选择要上载的文件时可以看到的描述字符串。
	 
	 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">extension</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">文件扩展名列表，其中列出用户选择要上载的文件时可以看到的文件格式。
	 
	 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">macType</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Macintosh 文件类型列表，其中列出用户选择要上载的文件时可以看到的文件类型。如果不传递任何值，则将此参数设为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
	 
	 </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 创建一个新的 FileFilter 实例。
	 </apiDesc><example conref="examples\FileFilter.as" class="- topic/example "> 下面的示例从本地文件系统向根显示对象（本例中为舞台）上载图像。示例由 <xref href="http://blog.andrevenancio.com/" scope="external" class="- topic/xref ">Andre Venancio</xref> 提供。
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var buttonShape:Shape = new Shape();
buttonShape.graphics.beginFill(0x336699);
buttonShape.graphics.drawCircle(50, 50, 25);
var button = new SimpleButton(buttonShape, buttonShape, buttonShape, buttonShape);
addChild(button);

var fileRef:FileReference= new FileReference();
button.addEventListener(MouseEvent.CLICK, onButtonClick);

function onButtonClick(e:MouseEvent):void {
fileRef.browse([new FileFilter("Images", "*.jpg;*.gif;*.png")]);
fileRef.addEventListener(Event.SELECT, onFileSelected);
}

function onFileSelected(e:Event):void {
fileRef.addEventListener(Event.COMPLETE, onFileLoaded);
fileRef.load();
}

function onFileLoaded(e:Event):void {
var loader:Loader = new Loader();
loader.loadBytes(e.target.data);
addChild(loader);
}
</codeblock></example></apiConstructorDetail></apiConstructor><apiValue id="flash.net:FileFilter:description:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">description</apiName><shortdesc class="- topic/shortdesc ">
	 滤镜的描述字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 滤镜的描述字符串。调用 <codeph class="+ topic/ph pr-d/codeph ">FileReference.browse()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReferenceList.browse()</codeph> 时，用户将在打开的对话框中看到此描述。描述字符串包含诸如 <codeph class="+ topic/ph pr-d/codeph ">"Images (*.gif, *.jpg, *.png)"</codeph> 之类的字符串，这些字符串有助于用户辨认可以上载或下载的文件类型。请注意，此 FileReference 对象支持的实际文件类型存储在 <codeph class="+ topic/ph pr-d/codeph ">extension</codeph> 属性中。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:FileFilter:extension:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">extension</apiName><shortdesc class="- topic/shortdesc ">
	 一个文件扩展名列表。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 一个文件扩展名列表。此列表表示要在文件浏览对话框中显示的文件的类型。（用户看不到此列表，只能看到 <codeph class="+ topic/ph pr-d/codeph ">description</codeph> 属性值。） <codeph class="+ topic/ph pr-d/codeph ">extension</codeph> 属性包含以分号分隔的文件扩展名列表，其中每个扩展名之前都具有通配符 (*)，如下面的字符串所示：<codeph class="+ topic/ph pr-d/codeph ">"*.jpg;*.gif;*.png"</codeph>。
	 
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:FileFilter:macType:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">macType</apiName><shortdesc class="- topic/shortdesc ">
	 一个 Macintosh 文件类型列表。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 一个 Macintosh 文件类型列表。此列表表示要在文件浏览对话框中显示的文件的类型。（用户看不到此列表，只能看到 <codeph class="+ topic/ph pr-d/codeph ">description</codeph> 属性值。） <codeph class="+ topic/ph pr-d/codeph ">macType</codeph> 属性包含以分号分隔的 Macintosh 文件类型列表，如下面的字符串所示：<codeph class="+ topic/ph pr-d/codeph ">"JPEG;jp2_;GIFF"</codeph>。
	 
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:URLRequest" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">URLRequest</apiName><shortdesc class="- topic/shortdesc ">
  URLRequest 类可捕获单个 HTTP 请求中的所有信息。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>The above include is not a mistake, but rather code re-use.
 
  </internal></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  URLRequest 类可捕获单个 HTTP 请求中的所有信息。URLRequest 对象将传递给 Loader、URLStream 和 URLLoader 类的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法和其他加载操作，以便启动 URL 下载。这些对象还将传递给 FileReference 类的 <codeph class="+ topic/ph pr-d/codeph ">upload()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">download()</codeph> 方法。
 
  <p class="- topic/p ">只能与本地文件系统内容交互的沙箱中的 SWF 文件无法加载网络沙箱中的资源所包含的数据，也无法为该资源提供数据。 </p>
 
  <p class="- topic/p ">默认情况下，执行调用的 <ph class="- topic/ph ">SWF</ph> 文件和加载的 URL 必须在同一域中。例如，位于 www.adobe.com 的 <ph class="- topic/ph ">SWF</ph> 文件只能从同样位于 www.adobe.com 的源中加载数据。<ph class="- topic/ph ">要从不同的域中加载数据，请在承载数据的服务器上放置一个 URL 策略文件。</ph></p>
 
  <p class="- topic/p "> 但在 Adobe AIR 中，应用程序安全沙箱中的内容（与 AIR 应用程序一起安装的内容）不受这些安全限制的约束。对于在 Adobe AIR 中运行的内容，应用程序安全沙箱中的文件可以访问使用以下任一 URL 方案的 URL：</p>

  
 
 <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">http</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">https</codeph> </li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">file</codeph> </li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">app-storage</codeph> </li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">app</codeph> </li></ul>
 
  <p class="- topic/p "><ph class="- topic/ph ">在 Adobe AIR 中运行</ph>且不在应用程序安全沙箱中的内容与在浏览器<ph class="- topic/ph ">（在 Flash Player 中）</ph>中运行的内容遵循相同的限制，加载操作受内容的域<ph class="- topic/ph ">和 URL 策略文件中授予的任何权限控制</ph>。</p>
 
 <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
 
 
 </apiDesc><example conref="examples\URLRequestExample.as" class="- topic/example "> 下例创建一个新的 Loader 对象，并为其传递一个包含 XML 文件路径的 URLRequest 对象。如果加载操作成功，将调度 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件，并且 XML 文件中的数据会跟踪至输出。附加的事件处理函数会捕获其他事件，包括错误事件。
 <p class="- topic/p ">要运行该示例，请将名为 XMLFile.xml 的文件与 SWF 文件放在同一个目录下。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#FileReference" class="- topic/link "><linktext class="- topic/linktext ">FileReference</linktext></link><link href="flash.net.xml#URLRequestHeader" class="- topic/link "><linktext class="- topic/linktext ">URLRequestHeader</linktext></link><link href="flash.net.xml#URLRequestDefaults" class="- topic/link "><linktext class="- topic/linktext ">URLRequestDefaults</linktext></link><link href="flash.net.xml#URLLoader" class="- topic/link "><linktext class="- topic/linktext ">URLLoader</linktext></link><link href="flash.net.xml#URLStream" class="- topic/link "><linktext class="- topic/linktext ">URLStream</linktext></link><link href="../../flash/html/HTMLLoader.html" class="- topic/link "><linktext class="- topic/linktext ">HTMLLoader 类</linktext></link></related-links><apiConstructor id="flash.net:URLRequest:URLRequest" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">URLRequest</apiName><shortdesc class="- topic/shortdesc ">
     创建 URLRequest 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">url</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">所请求的 URL。随后可以使用 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性来设置 URL。
     
     </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建 URLRequest 对象。如果 <codeph class="+ topic/ph pr-d/codeph ">System.useCodePage</codeph> 为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则使用系统代码页对该请求进行编码，而不使用 Unicode。如果 <codeph class="+ topic/ph pr-d/codeph ">System.useCodePage</codeph> 为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>，则使用 Unicode 对该请求进行编码，而不使用系统代码页。
     
     </apiDesc><example conref="examples\URLRequest_example.as" class="- topic/example "> 以下示例显示如何从使用 navigateToURL() 方法的 Flash Player 打开新浏览器窗口。<xref href="http://actionscriptexamples.com/2008/12/08/opening-urls-in-new-browser-windows-using-actionscript-30-and-actionscript-20/" scope="_mmexternal" class="- topic/xref ">ActionScriptExamples.com</xref> 提供的示例。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
// Requires
// - Button symbol on Stage (or a display object, such as a MovieClip) with instance name "buttonSymbol"
//
buttonSymbol.addEventListener(MouseEvent.CLICK, buttonSymbol_click);
 
function buttonSymbol_click(evt:MouseEvent):void {
    var req:URLRequest = new URLRequest("http://www.adobe.com/");
    navigateToURL(req, "_blank");
}
</codeblock></example></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.system.xml#System/useCodePage" class="- topic/link "><linktext class="- topic/linktext ">flash.system.System.useCodePage</linktext></link></related-links></apiConstructor><apiValue id="flash.net:URLRequest:authenticate:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">authenticate</apiName><shortdesc class="- topic/shortdesc ">
    指定是否应为此请求处理验证请求，如果是，则为 true，否则为 false。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
    </apiDefaultValue><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">指定是否应处理身份验证请求。
    
    </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定是否应为此请求处理身份验证请求，如果是，则为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，否则为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。如果为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>，则验证挑战返回 HTTP 错误。
    
    <p class="- topic/p ">支持的身份验证方法有：</p>
    
    <ul class="- topic/ul "><li class="- topic/li ">Windows — HTTP 基本/摘要、Windows 集成式身份验证（包括 NTLM 和 Kerberos）、SSL 证书身份验证。</li><li class="- topic/li ">Mac — HTTP 基本/摘要、NTLM、SSL 证书身份验证。</li></ul>
    
    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">HTMLLoader.load()</codeph> 方法不支持 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.authenticate</codeph> 属性。</p>
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequestDefaults/authenticate" class="- topic/link "><linktext class="- topic/linktext ">flash.net.URLRequestDefaults.authenticate</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:cacheResponse:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">cacheResponse</apiName><shortdesc class="- topic/shortdesc ">
    指定是否应为此请求缓存成功的响应数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
    
    </apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定是否应为此请求缓存成功的响应数据。设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 时，AIR 应用程序将使用操作系统的 HTTP 缓存。
    
    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：<codeph class="+ topic/ph pr-d/codeph ">HTMLLoader.load()</codeph> 方法不支持 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.cacheResponse</codeph> 属性。</p>
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequestDefaults/cacheResponse" class="- topic/link "><linktext class="- topic/linktext ">flash.net.URLRequestDefaults.cacheResponse</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:contentType:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">contentType</apiName><shortdesc class="- topic/shortdesc ">
     data 属性中内容的 MIME 内容类型。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">数据属性中 MIME 内容类型的内容。
     
     </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性中内容的 MIME 内容类型。
     
     <p class="- topic/p ">默认值为 <codeph class="+ topic/ph pr-d/codeph ">application/x-www-form-urlencoded</codeph>。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b><codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">HTMLLoader.load()</codeph> 方法不支持 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.contentType</codeph> 属性。</p>
     
     <p class="- topic/p ">发送 POST 请求时，<codeph class="+ topic/ph pr-d/codeph ">contentType</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性的值必须正确对应。<codeph class="+ topic/ph pr-d/codeph ">contentType</codeph> 属性的值表示服务器如何解释 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性的值。 </p>
     
     <ul class="- topic/ul "><li class="- topic/li ">如果 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性的值是一个 URLVariables 对象，则 <codeph class="+ topic/ph pr-d/codeph ">contentType</codeph> 的值必须是 <codeph class="+ topic/ph pr-d/codeph ">application/x-www-form-urlencoded</codeph>。 </li><li class="- topic/li "> 如果 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性的值为其他类型，则 <codeph class="+ topic/ph pr-d/codeph ">contentType</codeph> 的值应表示将要发送的 POST 数据的类型（该数据为 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性的值中包含的二进制或字符串数据）。 </li><li class="- topic/li ">对于 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>，请求的内容类型将自动设置为 <codeph class="+ topic/ph pr-d/codeph ">multipart/form-data</codeph> 并忽略 <codeph class="+ topic/ph pr-d/codeph ">contentType</codeph> 属性的值。</li></ul>
     
     <p class="- topic/p "> 在 Flash Player 10 和更高版本中，如果使用包含上载（由 POST 体内的“content-disposition”标头中的“filename”参数表示）的 multipart Content-Type（例如“multipart/form-data”），则 POST 操作会受应用于上载的安全规则的约束：</p>
     <ul class="- topic/ul "><li class="- topic/li ">必须执行 POST 操作以响应用户启动的操作（如鼠标单击或按键）。</li><li class="- topic/li ">如果 POST 操作是跨域的（POST 目标与发送 POST 请求的 SWF 文件不在同一台服务器上），则目标服务器必须提供一个允许跨域访问的 URL 策略文件。</li></ul>
     <p class="- topic/p ">另外，对于任何 multipart Content-Type，语法必须有效（根据 RFC2046 标准）。如果语法无效，则 POST 操作受应用于上载的安全规则约束。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequest/data" class="- topic/link "><linktext class="- topic/linktext ">data</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:data:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">data</apiName><shortdesc class="- topic/shortdesc ">
     一个对象，它包含将随 URL 请求一起传输的数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     一个对象，它包含将随 URL 请求一起传输的数据。
     
     <p class="- topic/p ">该属性与 <codeph class="+ topic/ph pr-d/codeph ">method</codeph> 属性配合使用。当 <codeph class="+ topic/ph pr-d/codeph ">method</codeph> 值为 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 时，将使用 HTTP 查询字符串语法将 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 值追加到 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.url</codeph> 值。当 <codeph class="+ topic/ph pr-d/codeph ">method</codeph> 值为 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph>（或 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 之外的任何值）时，将在 HTTP 请求体中传输 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 值。</p>
     
     <p class="- topic/p ">URLRequest API 支持二进制 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph>，并支持 URL 编码变量和字符串。该数据对象可以是 ByteArray、URLVariables 或 String 对象。</p>
     
     <p class="- topic/p ">该数据的使用方式取决于所用对象的类型：</p>
     
     <ul class="- topic/ul "><li class="- topic/li ">如果该对象为 ByteArray 对象，则 ByteArray 对象的二进制数据用作 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 数据。对于 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph>，不支持 ByteArray 类型的数据。对于 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph>，也不支持 ByteArray 类型的数据。</li><li class="- topic/li ">如果该对象是 URLVariables 对象，并且该方法是 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph>，则使用 <i class="+ topic/ph hi-d/i ">x-www-form-urlencoded</i> 格式对变量进行编码，并且生成的字符串会用作 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 数据。一种例外情况是对 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 的调用，在该调用中变量将作为 <codeph class="+ topic/ph pr-d/codeph ">multipart/form-data</codeph> 发布中的单独字段进行发送。</li><li class="- topic/li ">如果该对象是 URLVariables 对象，并且该方法是 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph>，则 URLVariables 对象将定义要随 URLRequest 对象一起发送的变量。</li><li class="- topic/li ">否则，该对象会转换为字符串，并且该字符串会用作 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 数据。</li></ul>
     
     <p class="- topic/p ">在方法（如 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>）使用 URLRequest 对象前，不会发送该数据。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：<codeph class="+ topic/ph pr-d/codeph ">contentType</codeph> 值必须与 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性中的数据类型对应。请参阅 <codeph class="+ topic/ph pr-d/codeph ">contentType</codeph> 属性说明中的注释。</p>
     
     </apiDesc><example conref="examples\URLVariablesExample.as" class="- topic/example "> 下例在一个新的浏览器窗口中打开位于 http://www.[yourDomain].com/application.jsp 上的远程应用程序，并将 URLVariables 对象中捕获的有关用户会话的数据传递给该应用程序。 
  
 <p class="- topic/p ">该示例的要点遵循：</p>
 <ol class="- topic/ol "><li class="- topic/li ">构造函数会创建名为 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> 的 URLRequest 实例，同时将远程应用程序的 URL 作为参数。</li><li class="- topic/li ">创建了一个 URLVariables 对象，并对它的两个属性进行了赋值。</li><li class="- topic/li ">URLVariables 对象被赋给了 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性。</li><li class="- topic/li ">该示例调用 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL</codeph>，在一个新的浏览器窗口中打开远程应用程序的 URL。</li></ol>
 <p class="- topic/p "> <b class="+ topic/ph hi-d/b ">注意：</b>要运行该示例，必须将该示例中的远程应用程序 URL 替换为工作 URL。此外，需要用服务器代码处理 Flash Player 在 URLVariables 对象中捕获的信息。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#URLRequest/method" class="- topic/link "><linktext class="- topic/linktext ">URLRequest.method</linktext></link><link href="flash.net.xml#URLRequestMethod" class="- topic/link "><linktext class="- topic/linktext ">URLRequestMethod</linktext></link><link href="flash.net.xml#URLVariables" class="- topic/link "><linktext class="- topic/linktext ">URLVariables</linktext></link><link href="flash.utils.xml#ByteArray" class="- topic/link "><linktext class="- topic/linktext ">flash.utils.ByteArray</linktext></link><link href="flash.net.xml#URLRequest/contentType" class="- topic/link "><linktext class="- topic/linktext ">contentType</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:digest:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">digest</apiName><shortdesc class="- topic/shortdesc ">
     唯一地标识将存储到 Flash Player 缓存中（或从中检索）的已签名 Adobe 平台组件的字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9.0.115.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">提供的摘要与从下载的签名文件或从缓存中加载的签名文件中提取的文件摘要不匹配。如果提供的摘要长度错误或包含无效（非十六进制）字符，则应用程序也会引发此错误。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     唯一地标识将存储到 Flash Player 缓存中（或从中检索）的已签名 Adobe 平台组件的字符串。<ph class="- topic/ph ">Adobe 平台组件是一个签名文件（SWZ 文件），其中包含永久缓存在用户计算机上的 SWF 内容。Adobe 对所有 SWZ 进行签名。摘要对应于单个缓存文件；如果对该文件进行了任何更改，则其摘要的更改将以不可预知的方式进行。通过使用摘要，您可以跨多个域验证缓存文件。具有相同摘要的两个文件是同一个文件，具有不同摘要的两个文件是不同的文件。实际上无法创建文件来“窃听”摘要以假装是另一个摘要。</ph>
     
     <p class="- topic/p ">摘要基于 SHA-256 消息摘要算法（长度为 64 个字符，采用十六进制格式）。</p>
     
     <p class="- topic/p ">例如，Flex SDK 包括 Flex 框架的 SWZ（而且它为该 SWZ 文件提供了摘要字符串）。可以将此 SWZ 发布到您的 Web 服务器上并加载到 SWF 文件中（使用 URLLoader 对象的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法）。如果最终用户的计算机已缓存了匹配的 SWZ 文件，则应用程序将使用此缓存的 SWZ 文件。（SWZ 文件在其 <codeph class="+ topic/ph pr-d/codeph ">digest</codeph> 与您提供的摘要匹配时匹配。）否则，应用程序将从您指定的 URL 下载 SWZ 文件。 </p>
     
     <p class="- topic/p ">仅在 <codeph class="+ topic/ph pr-d/codeph ">URLLoader.load()</codeph> 方法调用中使用的 URLRequest 对象中设置 <codeph class="+ topic/ph pr-d/codeph ">digest</codeph> 参数即可加载 SWZ 文件。如果 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">digest</codeph> 属性在用于其他方法时进行了设置，则应用程序将引发 IOError 异常。</p>
     
     </apiDesc><example conref="examples\URLRequest_digest.as" class="- topic/example "> 下面的示例将远程文件加载到缓存中。加载结束时，字节数组包含实际的文件（而不是签名的文件）。该示例通过调用 <codeph class="+ topic/ph pr-d/codeph ">loadBytes()</codeph> 完成加载操作：
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">followRedirects</apiName><shortdesc class="- topic/shortdesc ">
    指定是否要遵循重定向，如果是，则为 true，否则为 false。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
    
    </apiDefaultValue><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">指定是否要遵循重定向。
    
    </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定是否要遵循重定向，如果是，则为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，否则为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
    
    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">HTMLLoader.load()</codeph> 方法不支持 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.followRedirects</codeph> 属性。</p>
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequestDefaults/followRedirects" class="- topic/link "><linktext class="- topic/linktext ">URLRequestDefaults.followRedirects</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:idleTimeout:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">idleTimeout</apiName><shortdesc class="- topic/shortdesc ">
	    指定此请求的空闲超时值（以毫秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
	    
	    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>initialized from the URLRequestDefaults.idleTimeout property
	    
	    </apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	    指定此请求的空闲超时值（以毫秒为单位）。
	    
	    <p class="- topic/p ">空闲超时值是指客户端在建立连接之后、放弃请求之前等待服务器响应的时间。</p>
	    
	    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：<codeph class="+ topic/ph pr-d/codeph ">HTMLLoader.load()</codeph> 方法不支持 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.idleTimeout</codeph> 属性。HTMLLoader 类可定义自身的 <codeph class="+ topic/ph pr-d/codeph ">idleTimeout</codeph> 属性。</p>
	    
	    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequestDefaults/idleTimeout" class="- topic/link "><linktext class="- topic/linktext ">URLRequestDefaults.idleTimeout</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:manageCookies:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">manageCookies</apiName><shortdesc class="- topic/shortdesc ">
    指定 HTTP 协议堆栈是否应管理此请求的 cookie。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
    
    </apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定 HTTP 协议堆栈是否应管理此请求的 cookie。如果为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则将 cookie 添加到请求中并记住响应 cookie。如果为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>，则<i class="+ topic/ph hi-d/i ">不</i> 将 cookie 添加到请求中且<i class="+ topic/ph hi-d/i ">不</i> 记住响应 cookie，但用户可以通过直接处理标头来自行管理 cookie。<b class="+ topic/ph hi-d/b ">注意：</b>在 Windows 上，当 <codeph class="+ topic/ph pr-d/codeph ">manageCookies</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 时，您不能手动将 Cookie 添加到 URL 请求。在其他操作系统上，无论 <codeph class="+ topic/ph pr-d/codeph ">manageCookies</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 还是 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>，都允许将 Cookie 添加到请求。允许此操作时，您可以通过将包含 Cookie 数据的 <codeph class="+ topic/ph pr-d/codeph ">URLRequestHeader</codeph> 对象添加到 <codeph class="+ topic/ph pr-d/codeph ">requestHeaders</codeph> 数组，手动将 Cookie 添加到请求。
    
    <p class="- topic/p ">在 Mac OS 上，cookie 与 Safari 共享。清除 Mac OS 上的 cookie：</p>
    
    <ol class="- topic/ol "><li class="- topic/li ">打开 Safari。</li><li class="- topic/li ">选择“Safari”>“首选参数”，然后单击“安全”面板。</li><li class="- topic/li ">单击“显示 Cookie”按钮。</li><li class="- topic/li ">单击“全部删除”按钮。</li></ol>
    
    <p class="- topic/p ">清除 Windows 上的 cookie：</p>
    
    <ol class="- topic/ol "><li class="- topic/li ">打开“Internet 属性”控制面板并单击“常规”选项卡。</li><li class="- topic/li ">单击“删除 Cookie”按钮。 </li></ol>
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequestDefaults/manageCookies" class="- topic/link "><linktext class="- topic/linktext ">flash.net.URLRequestDefaults.manageCookies</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:method:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">method</apiName><shortdesc class="- topic/shortdesc ">
     控制 HTTP 式提交方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">value</codeph> 参数不是 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.GET</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph>。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiDefaultValue>URLRequestMethod.GET
     
     </apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     控制 HTTP 式提交方法。
     
     <p class="- topic/p "><ph class="- topic/ph ">对于在 Flash Player 中（在浏览器中）运行的 SWF 内容，此属性限制为 GET 或 POST 操作，有效值为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.GET</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph>。</ph></p>
     
     <p class="- topic/p "><ph class="- topic/ph ">对于在 Adobe AIR 中运行的内容，如果该内容位于应用程序安全沙箱内，</ph>则可以使用任何字符串值。否则，<ph class="- topic/ph ">与在 Flash Player 中运行的内容一样，</ph>仅能使用 GET 或 POST 操作。</p>
     
     <p class="- topic/p "><ph class="- topic/ph ">对于在 Adobe AIR 中运行的内容，当</ph>使用 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL()</codeph> 函数时，运行时将使用 POST 方法的 URLRequest（其 <codeph class="+ topic/ph pr-d/codeph ">method</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph>）视为使用 GET 方法。</p>
     
     <p class="- topic/p "><ph class="- topic/ph "><b class="+ topic/ph hi-d/b ">注意：</b>如果在 Flash Player 中运行并且引用的表单没有正文，则即使将方法设置为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph>，Flash Player 也会自动使用 GET 操作。因此，建议始终包括“虚拟”正文以确保使用正确的 method。</ph></p>
     
     </apiDesc><example conref="examples\URLRequest_method.as" class="- topic/example "> 下例在一个新的浏览器窗口中打开位于 http://www.[yourDomain].com/application.jsp 上的远程应用程序，并将 URLVariables 对象中捕获的有关用户会话的数据传递给该应用程序。它将 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.method</codeph> 属性值显式设置为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph>。
 <p class="- topic/p ">该示例的要点遵循：</p>
 <ol class="- topic/ol "><li class="- topic/li ">构造函数会创建名为 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> 的 URLRequest 实例，同时将远程应用程序的 URL 作为参数。</li><li class="- topic/li ">创建了一个 URLVariables 对象，并对它的两个属性进行了赋值。</li><li class="- topic/li ">URLVariables 对象被赋给了 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">URLRequest.method</codeph> 属性的值设置为 <codeph class="+ topic/ph pr-d/codeph ">URLRequestMethod.POST</codeph>。</li><li class="- topic/li ">该示例调用 <codeph class="+ topic/ph pr-d/codeph ">navigateToURL</codeph>，在一个新的浏览器窗口中打开远程应用程序的 URL。</li></ol>
 <p class="- topic/p "> <b class="+ topic/ph hi-d/b ">注意：</b>要运行该示例，必须将该示例中的远程应用程序 URL 替换为工作 URL。此外，需要用服务器代码处理 Flash Player 在 URLVariables 对象中捕获的信息。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#URLRequestMethod" class="- topic/link "><linktext class="- topic/linktext ">URLRequestMethod 类</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:requestHeaders:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">requestHeaders</apiName><shortdesc class="- topic/shortdesc ">
     要追加到 HTTP 请求的 HTTP 请求标头的数组。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Array</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     要追加到 HTTP 请求的 HTTP 请求标头的数组。该数组由 URLRequestHeader 对象组成。数组中的每一对象必须是包含一个名称字符串和一个值字符串的 URLRequestHeader 对象，如下所示：
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     var rhArray:Array = new Array(new URLRequestHeader("Content-Type", "text/html"));
     </codeblock>
     
     <p class="- topic/p "><ph class="- topic/ph ">Flash Player 和 AIR 运行时对</ph>请求标头会施加一些限制；有关详细信息，请参阅 URLRequestHeader 类的描述。</p>
     
     <p class="- topic/p ">并非所有接受 URLRequest 参数的方法都支持 <codeph class="+ topic/ph pr-d/codeph ">requestHeaders</codeph> 属性，请参阅有关调用的方法的文档。例如，<codeph class="+ topic/ph pr-d/codeph ">FileReference.upload()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">FileReference.download()</codeph> 方法不支持 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.requestHeaders</codeph> 属性。</p>
     <p class="- topic/p ">由于存在浏览器限制，因此仅对 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 请求支持自定义 HTTP 请求标头，而对 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 请求不提供相应支持。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequestHeader" class="- topic/link "><linktext class="- topic/linktext ">URLRequestHeader</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:url:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">url</apiName><shortdesc class="- topic/shortdesc ">
     所请求的 URL。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     所请求的 URL。
     
     <p class="- topic/p ">确保对统一资源定位器规范（请参阅 http://www.faqs.org/rfcs/rfc1738.html）中说明为不安全的字符或 URLRequest 对象的 URL 架构中保留的字符（如果未用于其保留用途）进行编码。例如，按照 <codeph class="+ topic/ph pr-d/codeph ">"http://www.example.com/orderForm.cfm?item=%23B-3&amp;discount=50%25"</codeph> 的规定，对百分比符号 (%) 使用 <codeph class="+ topic/ph pr-d/codeph ">"%25"</codeph>，对数字符号 (#) 使用 <codeph class="+ topic/ph pr-d/codeph ">"%23"</codeph>。</p>
     
      <p class="- topic/p ">默认情况下，除非内容在 <ph class="- topic/ph ">Adobe AIR </ph>应用程序安全沙箱中运行，否则 URL 必须与执行调用的文件位于同一域中。<ph class="- topic/ph ">要从其他域中加载数据，请在承载数据的服务器上放置一个 URL 策略文件</ph>。有关详细信息，请参阅 URLRequest 类的说明。</p>
     
     <p class="- topic/p "><ph class="- topic/ph ">对于在 Adobe AIR 中运行的内容，应用程序安全沙箱中的文件（使用 AIR 应用程序安装的文件）可以通过使用以下任一 URL 方案访问 URL：</ph></p>
     
     <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">http</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">https</codeph> </li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">file</codeph> </li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">app-storage</codeph> </li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">app</codeph> </li></ul>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>AIR 和 Flash Player 9.0.115.0 及更高版本中支持 IPv6（Internet 协议版本 6）<ph class="- topic/ph "/>。IPv6 是支持 128 位地址的 Internet 协议版本（它是支持 32 位地址的早期 IPv4 协议的改进版本）。您可能需要在网络接口中激活 IPv6。有关详细信息，请参阅承载数据的操作系统的帮助。<ph class="- topic/ph ">如果承载系统上支持 IPv6，则可以在用方括号 ([]) 括起的 URL 中指定数字 IPv6 文本地址，如下所示</ph>。 </p>
     
     <ph class="- topic/ph ">
     <pre xml:space="preserve" class="- topic/pre ">
     rtmp://[2001:db8:ccc3:ffff:0:444d:555e:666f]:1935/test
     </pre>
     </ph>
     
     </apiDesc><example conref="examples\Loader_load_url.as" class="- topic/example "> 以下示例显示如何使用 ActionScript 3.0 中的 Loader 类动态加载图像。<xref href="http://actionscriptexamples.com/2008/03/02/dynamically-loading-an-image-in-actionscript-20-and-actionscript-30/" scope="_mmexternal" class="- topic/xref ">ActionScriptExamples.com</xref> 提供的示例。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var url:String = "http://www.helpexamples.com/flash/images/image2.jpg";
var urlRequest:URLRequest = new URLRequest(url);
var loader:Loader = new Loader();
loader.load(urlRequest);
addChild(loader);
</codeblock></example></apiValueDetail></apiValue><apiValue id="flash.net:URLRequest:useCache:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">useCache</apiName><shortdesc class="- topic/shortdesc ">
    指定在此 URLRequest 获取数据之前是否应查询本地缓存。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiDefaultValue>true
    
    </apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定在此 URLRequest 获取数据之前是否应查询本地缓存。
    
    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：<codeph class="+ topic/ph pr-d/codeph ">HTMLLoader.load()</codeph> 方法不支持 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.useCache</codeph> 属性。</p>
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequestDefaults/useCache" class="- topic/link "><linktext class="- topic/linktext ">flash.net.URLRequestDefaults.useCache</linktext></link></related-links></apiValue><apiValue id="flash.net:URLRequest:userAgent:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">userAgent</apiName><shortdesc class="- topic/shortdesc ">
    指定要在 HTTP 请求中使用的用户代理字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">调用方不在 AIR 应用程序安全沙箱中。
    
    </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定要在 HTTP 请求中使用的用户代理字符串。
    
    <p class="- topic/p ">默认值是由 Flash Player 使用的同一用户代理字符串，该字符串在 Mac、Linux 和 Windows 中有所不同。</p>
    
    <p class="- topic/p "><i class="+ topic/ph hi-d/i ">注意：</i>在将 URLRequest 对象与 HTMLLoader 对象的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法一起使用时，此属性不影响用户代理字符串。要设置 HTMLLoader 对象的用户代理字符串，请设置 HTMLLoader 对象的 <codeph class="+ topic/ph pr-d/codeph ">userAgent</codeph> 属性或设置静态 <codeph class="+ topic/ph pr-d/codeph ">URLRequestDefaults.userAgent</codeph> 属性。</p>
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLRequestDefaults/userAgent" class="- topic/link "><linktext class="- topic/linktext ">flash.net.URLRequestDefaults.userAgent</linktext></link><link href="../../flash/html/HTMLLoader.html#userAgent" class="- topic/link "><linktext class="- topic/linktext ">flash.html.HTMLLoader.userAgent</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:InterfaceAddress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">InterfaceAddress</apiName><shortdesc class="- topic/shortdesc ">
 InterfaceAddress 类报告网络接口地址的属性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 InterfaceAddress 类报告网络接口地址的属性。
 
 </apiDesc><example conref="examples\InterfaceAddressExample.as" class="- topic/example "/></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetworkInfo" class="- topic/link "><linktext class="- topic/linktext ">NetworkInfo 类</linktext></link><link href="flash.net.xml#NetworkInterface" class="- topic/link "><linktext class="- topic/linktext ">NetworkInterface 类</linktext></link></related-links><apiValue id="flash.net:InterfaceAddress:address:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">address</apiName><shortdesc class="- topic/shortdesc ">
     Internet 协议 (IP) 地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     Internet 协议 (IP) 地址。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:InterfaceAddress:broadcast:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">broadcast</apiName><shortdesc class="- topic/shortdesc ">
     本地网络段的广播地址。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     本地网络段的广播地址。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:InterfaceAddress:ipVersion:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">ipVersion</apiName><shortdesc class="- topic/shortdesc ">
	 IP 地址类型（IPv4 或 IPv6）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 IP 地址类型（IPv4 或 IPv6）。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:InterfaceAddress:prefixLength:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">prefixLength</apiName><shortdesc class="- topic/shortdesc ">
     此地址的前缀长度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此地址的前缀长度。 
     
     <p class="- topic/p ">对于 IPv4 地址，这是子网掩码。IPv4 前缀长度示例值包括：8 (255.0.0.0)、16 (255.255.0.0) 和 24 (255.255.255.0)。IPv6 前缀长度示例值包括 128 (::1/128) 和 32 (2001:db8::/32) </p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果此地址的前缀长度不可用，则 <codeph class="+ topic/ph pr-d/codeph ">prefixLength</codeph> 的值为 <codeph class="+ topic/ph pr-d/codeph ">-1</codeph>。前缀值不一定由特定客户端计算机的网络实现返回。</p>
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:GroupSpecifier" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">GroupSpecifier</apiName><shortdesc class="- topic/shortdesc ">
     GroupSpecifier 类用于构造可传递给 NetStream 和 NetGroup 构造函数的不透明的 groupspec 字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">构造传递给 NetStream 和 NetGroup 构造函数的不透明的 groupspec 字符串。
     </apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     GroupSpecifier 类用于构造可传递给 NetStream 和 NetGroup 构造函数的不透明的 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 字符串。<codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 指定 RTMFP 对等组，包括使用 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 的成员的能力、限制和授权。
     
     <p class="- topic/p ">默认情况下，禁用所有功能，但允许对等连接。</p>
     
     </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup</linktext></link><link href="flash.net.xml#NetStream" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream</linktext></link></related-links><apiConstructor id="flash.net:GroupSpecifier:GroupSpecifier" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">GroupSpecifier</apiName><shortdesc class="- topic/shortdesc ">
         创建一个新的 GroupSpecifier 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 为空或 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
         
         </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">name</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">所有成员必须同意组名称。
         
         </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         创建一个新的 GroupSpecifier 对象。默认情况下，禁用所有功能，但允许对等连接。
         
         </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup</linktext></link><link href="flash.net.xml#NetStream" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:GroupSpecifier:addBootstrapPeer" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">addBootstrapPeer</apiName><shortdesc class="- topic/shortdesc ">
         导致关联的 NetStream 或 NetGroup 与指定的 peerID 进行初始邻居连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">peerID</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">应将初始邻居连接引导入对等网格的 peerID。
         
         </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         导致关联的 NetStream 或 NetGroup 与指定的 peerID 进行初始邻居连接。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/encodeBootstrapPeerIDSpec()" class="- topic/link "><linktext class="- topic/linktext ">encodeBootstrapPeerIDSpec()</linktext></link><link href="flash.net.xml#NetGroup/addMemberHint()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.addMemberHint()</linktext></link><link href="flash.net.xml#NetGroup/addNeighbor()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.addNeighbor()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:addIPMulticastAddress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">addIPMulticastAddress</apiName><shortdesc class="- topic/shortdesc ">
         导致关联的 NetStream 或 NetGroup 加入指定的 IP 多播组并侦听指定的 UDP 端口。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">address</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个字符串，用于指定要加入的 IPv4 或 IPv6 多播组的地址，可能后跟冒号（“:”）和 UDP 端口号。如果指定 IPv6 地址和端口，则 IPv6 地址<i class="+ topic/ph hi-d/i ">必须</i>使用中括号括起来。示例：<codeph class="+ topic/ph pr-d/codeph ">“224.0.0.254”</codeph>、 <codeph class="+ topic/ph pr-d/codeph ">“224.0.0.254:30000”</codeph>、 <codeph class="+ topic/ph pr-d/codeph ">“ff03::ffff”</codeph>、 <codeph class="+ topic/ph pr-d/codeph ">“[ff03::ffff]:30000”</codeph>。
         
         </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">port</apiItemName><apiType value="any" name="type" class="- topic/state reference/state apiRef/apiType "/><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">接收 IP 多播数据报的 UDP 端口。如果 <codeph class="+ topic/ph pr-d/codeph ">port</codeph> 为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则<i class="+ topic/ph hi-d/i ">必须</i>在 <codeph class="+ topic/ph pr-d/codeph ">address</codeph> 中指定 UDP 端口。如果不为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则<i class="+ topic/ph hi-d/i ">不得 </i>在<codeph class="+ topic/ph pr-d/codeph ">address</codeph> 中指定 UDP 端口。
         
         </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">source</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果不为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则为用于指定特定于源的多播 (SSM) 的源 IP 地址的字符串。
         
         </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         导致关联的 NetStream 或 NetGroup 加入指定的 IP 多播组并侦听指定的 UDP 端口。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/encodeIPMulticastAddressSpec()" class="- topic/link "><linktext class="- topic/linktext ">encodeIPMulticastAddressSpec()</linktext></link><link href="flash.net.xml#GroupSpecifier/ipMulticastMemberUpdatesEnabled" class="- topic/link "><linktext class="- topic/linktext ">ipMulticastMemberUpdatesEnabled</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:authorizations" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">authorizations</apiName><shortdesc class="- topic/shortdesc ">
         返回表示用于 IP 多播发布和用于发布的密码的字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         返回表示用于 IP 多播发布和用于发布的密码的字符串。将此字符串附加到未授权的 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 以启用已设置密码的功能。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/encodePostingAuthorization()" class="- topic/link "><linktext class="- topic/linktext ">encodePostingAuthorization()</linktext></link><link href="flash.net.xml#GroupSpecifier/encodePublishAuthorization()" class="- topic/link "><linktext class="- topic/linktext ">encodePublishAuthorization()</linktext></link><link href="flash.net.xml#GroupSpecifier/groupspecWithAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithAuthorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/groupspecWithoutAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithoutAuthorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/setPostingPassword()" class="- topic/link "><linktext class="- topic/linktext ">setPostingPassword()</linktext></link><link href="flash.net.xml#GroupSpecifier/setPublishPassword()" class="- topic/link "><linktext class="- topic/linktext ">setPublishPassword()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:encodeBootstrapPeerIDSpec" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">encodeBootstrapPeerIDSpec</apiName><shortdesc class="- topic/shortdesc ">
         编码并返回表示启动 peerID 的字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">peerID</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">应将初始邻居连接引导入对等网格的 peerID。
         
         </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         编码并返回表示启动 peerID 的字符串。如果将此字符串附加到 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph>，则关联的 NetStream 或 NetGroup 会进行到指定的 peerID 的初始相邻连接。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/addBootstrapPeer()" class="- topic/link "><linktext class="- topic/linktext ">addBootstrapPeer()</linktext></link><link href="flash.net.xml#NetGroup/addMemberHint()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.addMemberHint()</linktext></link><link href="flash.net.xml#NetGroup/addNeighbor()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.addNeighbor()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:encodeIPMulticastAddressSpec" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">encodeIPMulticastAddressSpec</apiName><shortdesc class="- topic/shortdesc ">
         编码并返回表示 IP 多播套接字地址的字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">address</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个字符串，用于表示要加入的 IPv4 或 IPv6 多播组的地址，可能后跟冒号（“:”）和 UDP 端口号。如果指定 IPv6 地址<i class="+ topic/ph hi-d/i ">和</i>端口，则 IPv6 地址<i class="+ topic/ph hi-d/i ">必须</i>使用中括号括起来。示例：<codeph class="+ topic/ph pr-d/codeph ">“224.0.0.254”</codeph>、 <codeph class="+ topic/ph pr-d/codeph ">“224.0.0.254:30000”</codeph>、 <codeph class="+ topic/ph pr-d/codeph ">“ff03::ffff”</codeph>、 <codeph class="+ topic/ph pr-d/codeph ">“[ff03::ffff]:30000”</codeph>。
         
         </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">port</apiItemName><apiType value="any" name="type" class="- topic/state reference/state apiRef/apiType "/><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">接收 IP 多播数据报的 UDP 端口。如果 <codeph class="+ topic/ph pr-d/codeph ">port</codeph> 为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则<i class="+ topic/ph hi-d/i ">必须</i>在 <codeph class="+ topic/ph pr-d/codeph ">address</codeph> 中指定 UDP 端口。如果不为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则<i class="+ topic/ph hi-d/i ">不得 </i>在<codeph class="+ topic/ph pr-d/codeph ">address</codeph> 中指定 UDP 端口。
         
         </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">source</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果不为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则为用于指定特定于源的多播 (SSM) 的源 IP 地址的字符串。
         
         </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         编码并返回表示 IP 多播套接字地址的字符串。如果将此字符串附加到 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph>，则关联的 NetStream 或 NetGroup 会加入指定的 IP 多播组并侦听指定的 UDP 端口。
         
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/addIPMulticastAddress()" class="- topic/link "><linktext class="- topic/linktext ">addIPMulticastAddress()</linktext></link><link href="flash.net.xml#GroupSpecifier/ipMulticastMemberUpdatesEnabled" class="- topic/link "><linktext class="- topic/linktext ">ipMulticastMemberUpdatesEnabled</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:encodePostingAuthorization" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">encodePostingAuthorization</apiName><shortdesc class="- topic/shortdesc ">
         编码并返回表示发布密码的字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">password</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要编码的密码，此密码必须与发布的密码（如果设置）匹配才能启用 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.post()</codeph>。
         
         </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         编码并返回表示发布密码的字符串。当发布受密码保护时，可将字符串连接到 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 以启用发布。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/groupspecWithoutAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithoutAuthorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/setPostingPassword()" class="- topic/link "><linktext class="- topic/linktext ">setPostingPassword()</linktext></link><link href="flash.net.xml#NetGroup/post()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.post()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:encodePublishAuthorization" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">encodePublishAuthorization</apiName><shortdesc class="- topic/shortdesc ">
         编码并返回表示多播发布密码的字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">password</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要编码的密码，此密码必须与发布密码（如果设置）匹配才能启用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.publish()</codeph>。
         
         </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         编码并返回表示多播发布密码的字符串。当多播发布受密码保护时，可将字符串连接到 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 以启用发布。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/groupspecWithoutAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithoutAuthorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/setPublishPassword()" class="- topic/link "><linktext class="- topic/linktext ">setPublishPassword()</linktext></link><link href="flash.net.xml#NetStream/publish()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.publish()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:groupspecWithAuthorizations" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">groupspecWithAuthorizations</apiName><shortdesc class="- topic/shortdesc ">
         返回可传递给 NetStream 和 NetGroup 构造函数的不透明的 groupspec 字符串，包括授权。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         返回可传递给 NetStream 和 NetGroup 构造函数的不透明的 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 字符串，包括授权。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/authorizations()" class="- topic/link "><linktext class="- topic/linktext ">authorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/groupspecWithoutAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithoutAuthorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/setPostingPassword()" class="- topic/link "><linktext class="- topic/linktext ">setPostingPassword()</linktext></link><link href="flash.net.xml#GroupSpecifier/setPublishPassword()" class="- topic/link "><linktext class="- topic/linktext ">setPublishPassword()</linktext></link><link href="flash.net.xml#GroupSpecifier/toString()" class="- topic/link "><linktext class="- topic/linktext ">toString()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:groupspecWithoutAuthorizations" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">groupspecWithoutAuthorizations</apiName><shortdesc class="- topic/shortdesc ">
         返回可传递给 NetStream 和 NetGroup 构造函数的不透明的 groupspec 字符串，不包括授权。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">返回可传递给 NetStream 和 NetGroup 构造函数的不透明的 groupspec 字符串，不包括授权。
         </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         返回可传递给 NetStream 和 NetGroup 构造函数的不透明的 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 字符串，不包括授权。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/authorizations()" class="- topic/link "><linktext class="- topic/linktext ">authorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/encodePostingAuthorization()" class="- topic/link "><linktext class="- topic/linktext ">encodePostingAuthorization()</linktext></link><link href="flash.net.xml#GroupSpecifier/encodePublishAuthorization()" class="- topic/link "><linktext class="- topic/linktext ">encodePublishAuthorization()</linktext></link><link href="flash.net.xml#GroupSpecifier/groupspecWithAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithAuthorizations()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:makeUnique" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">makeUnique</apiName><shortdesc class="- topic/shortdesc ">
         向 groupspec 添加强伪随机标记，使其具有唯一性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">向 groupspec 添加强伪随机标记，使其具有唯一性。
         </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         向 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 添加强伪随机标记，使其具有唯一性。不透明的 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 字符串随后必须逐字传递到组的其他潜在成员（如果这些成员已成功加入）。
         
         </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:GroupSpecifier:setPostingPassword" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">setPostingPassword</apiName><shortdesc class="- topic/shortdesc ">
         指定在 NetGroup 中发布是否要求密码。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">password</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">使用 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.post()</codeph> 所必须提供的密码。如果为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则表明发布不要求任何密码。
         
         </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">salt</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">修改密码的哈希以增加破解难度。为获得最佳安全性，此参数应设置为随机值。
         
         </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         指定在 NetGroup 中发布是否要求密码。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/encodePostingAuthorization()" class="- topic/link "><linktext class="- topic/linktext ">encodePostingAuthorization()</linktext></link><link href="flash.net.xml#GroupSpecifier/groupspecWithAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithAuthorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/groupspecWithoutAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithoutAuthorizations()</linktext></link><link href="flash.net.xml#NetGroup/post()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.post()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:setPublishPassword" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">setPublishPassword</apiName><shortdesc class="- topic/shortdesc ">
         指定在 NetStream 中发布多播流是否要求密码。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">password</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.publish()</codeph> 所必须提供的密码。如果为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则发布不要求任何密码。
         
         </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">salt</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">修改密码的哈希以增加破解难度。为获得最佳安全性，此参数应设置为随机值。
         
         </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         指定在 NetStream 中发布多播流是否要求密码。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/encodePublishAuthorization()" class="- topic/link "><linktext class="- topic/linktext ">encodePublishAuthorization()</linktext></link><link href="flash.net.xml#GroupSpecifier/groupspecWithAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithAuthorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/groupspecWithoutAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithoutAuthorizations()</linktext></link><link href="flash.net.xml#NetStream/publish()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.publish()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:GroupSpecifier:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc ">
         与 groupspecWithAuthorizations() 方法相同。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">与 groupspecWithAuthorizations() 方法相同。
         </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         与 <codeph class="+ topic/ph pr-d/codeph ">groupspecWithAuthorizations()</codeph> 方法相同。返回可传递给 NetStream 和 NetGroup 构造函数的不透明的 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 字符串（包括授权）的便捷方法。
         
         </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/groupspecWithAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">groupspecWithAuthorizations()</linktext></link></related-links></apiOperation><apiValue id="flash.net:GroupSpecifier:ipMulticastMemberUpdatesEnabled:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">ipMulticastMemberUpdatesEnabled</apiName><shortdesc class="- topic/shortdesc ">
         指定是否可以在 IP 多播套接字中交换有关组成员资格的信息。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         指定是否可以在 IP 多播套接字中交换有关组成员资格的信息。IP 多播服务器可以发送组成员资格更新以帮助启动 P2P 网格或修复分区。同级可以发送 LAN 上的组成员资格更新以帮助启动 LAN P2P 网格和通知全局网格中的 on-LAN 邻居其他 on-LAN 邻居存在。这些更新可以提高 P2P 性能。
         
         </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/addIPMulticastAddress()" class="- topic/link "><linktext class="- topic/linktext ">addIPMulticastAddress()</linktext></link><link href="flash.net.xml#GroupSpecifier/peerToPeerDisabled" class="- topic/link "><linktext class="- topic/linktext ">peerToPeerDisabled</linktext></link></related-links></apiValue><apiValue id="flash.net:GroupSpecifier:multicastEnabled:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">multicastEnabled</apiName><shortdesc class="- topic/shortdesc ">
         指定是否为 NetGroup 启用流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         指定是否为 NetGroup 启用流。用于流的方法是 <codeph class="+ topic/ph pr-d/codeph ">NetStream.publish()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph>。默认情况下，此属性为 FALSE（禁用流）。
         
         </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#GroupSpecifier/setPublishPassword()" class="- topic/link "><linktext class="- topic/linktext ">setPublishPassword()</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.play2()</linktext></link><link href="flash.net.xml#NetStream/publish()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.publish()</linktext></link></related-links></apiValue><apiValue id="flash.net:GroupSpecifier:objectReplicationEnabled:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">objectReplicationEnabled</apiName><shortdesc class="- topic/shortdesc ">
         指定是否为 NetGroup 启用对象复制。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         指定是否为 NetGroup 启用对象复制。默认情况下，此属性为 FALSE（对象复制被禁用）。
         
         </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/addHaveObjects()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.addHaveObjects()</linktext></link><link href="flash.net.xml#NetGroup/addWantObjects()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.addWantObjects()</linktext></link><link href="flash.net.xml#NetGroup/denyRequestedObject()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.denyRequestedObject()</linktext></link><link href="flash.net.xml#NetGroup/removeHaveObjects()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.removeHaveObjects()</linktext></link><link href="flash.net.xml#NetGroup/removeWantObjects()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.removeWantObjects()</linktext></link><link href="flash.net.xml#NetGroup/writeRequestedObject()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.writeRequestedObject()</linktext></link></related-links></apiValue><apiValue id="flash.net:GroupSpecifier:peerToPeerDisabled:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">peerToPeerDisabled</apiName><shortdesc class="- topic/shortdesc ">
         指定是否为 NetGroup 或 NetStream 禁用对等连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         指定是否为 NetGroup 或 NetStream 禁用对等连接。默认情况下，此属性为 FALSE（启用 P2P 连接）。
         
         <p class="- topic/p ">如果禁用 P2P 连接（将此属性设置为 TRUE），则禁止 P2P 警告对话框。在这种情况下，不能进行任何相邻连接，并且任何组成员都不使用上游带宽。通过这种方式禁用 P2P 连接通常仅在通过纯 IP 多播接收多播流时有用。</p>
         
         </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:GroupSpecifier:postingEnabled:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">postingEnabled</apiName><shortdesc class="- topic/shortdesc ">
         指定是否为 NetGroup 启用发布。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         指定是否为 NetGroup 启用发布。默认情况下，此属性为 FALSE（禁用发布）。
         
         </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/post()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.post()</linktext></link></related-links></apiValue><apiValue id="flash.net:GroupSpecifier:routingEnabled:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">routingEnabled</apiName><shortdesc class="- topic/shortdesc ">
         指定是否为 NetGroup 启用定向路由方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         指定是否为 NetGroup 启用定向路由方法。默认情况下，此属性为 FALSE（定向路由方法被禁用）。
         
         </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNearest()</linktext></link></related-links></apiValue><apiValue id="flash.net:GroupSpecifier:serverChannelEnabled:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">serverChannelEnabled</apiName><shortdesc class="- topic/shortdesc ">
         指定 NetGroup 的成员是否可以打开到服务器的通道。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
         指定 NetGroup 的成员是否可以打开到服务器的通道。默认情况下，此属性为 FALSE。
         
         <p class="- topic/p ">只有打开服务器通道，服务器才能将支持功能提供给组成员。根据服务器配置，支持功能可能通过此通道提供，也可能不通过此通道提供。</p>
         
         </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:LocalConnection" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">LocalConnection</apiName><shortdesc class="- topic/shortdesc ">
 使用 LocalConnection 类可以创建调用另一个 LocalConnection 对象中的方法的 LocalConnection 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">LocalConnection
 
  </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 使用 LocalConnection 类可以创建调用另一个 LocalConnection 对象中的方法的 LocalConnection 对象。通信可以通过以下方式进行：
 
 <ul class="- topic/ul "><li class="- topic/li ">在一个 SWF 文件内</li><li class="- topic/li ">在多个 SWF 文件之间</li><li class="- topic/li ">在 AIR 应用程序的内容（基于 SWF 或基于 HTML）之间</li><li class="- topic/li ">在 AIR 应用程序的内容（基于 SWF 或基于 HTML）和运行于浏览器中的 SWF 内容之间</li></ul>
 
 <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>所有桌面操作系统和所有用于电视的 AIR 设备均支持此功能，但移动设备不支持此功能。您可以使用 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.isSupported</codeph> 属性在运行时测试是否受支持。有关在多个配置文件之间支持 API 的详细信息，请参阅 <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">AIR 配置文件支持</xref>。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>用于电视的 AIR 设备仅支持 AIR 应用程序中基于 SWF 的内容之间的通信。</p>
 
 <p class="- topic/p ">通过本地连接，可以在 SWF 文件之间进行这种通信，而不用使用 <codeph class="+ topic/ph pr-d/codeph ">fscommand()</codeph> 或 JavaScript。LocalConnection 对象只能在运行于同一台客户端计算机上的文件之间进行通信，但这些文件可以在不同的应用程序中运行。例如，浏览器中运行的文件和 Adobe AIR 中运行的 SWF 文件。 </p>
 
 <p class="- topic/p ">ActionScript 3.0 中创建的 LocalConnection 对象可以与 ActionScript 1.0 或 2.0 中创建的 LocalConnection 对象通信。反之亦然：ActionScript 1.0 或 2.0 中创建的 LocalConnection 对象可以与 ActionScript 3.0 中创建的 LocalConnection 对象通信。Flash Player 可自动处理不同版本 LocalConnection 对象间的通信。</p>
 
 <p class="- topic/p ">可以使用三种方式将回调方法添加到 LocalConnection 对象：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">使 LocalConnection 类成为子类，并添加方法。</li><li class="- topic/li ">将 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.client</codeph> 属性设置为实现方法的对象。</li><li class="- topic/li ">创建扩展 LocalConnection 的动态类，并动态附加方法。</li></ul>
 
 <p class="- topic/p ">为了了解如何使用 LocalConnection 对象在两个文件之间进行通信，了解每个文件中使用的命令非常有用。一个文件被称为<i class="+ topic/ph hi-d/i ">接收方</i>文件；该文件中包含要调用的方法。接收方文件中必须包含一个 LocalConnection 对象和对 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法的调用。另一个文件被称为<i class="+ topic/ph hi-d/i ">发送方</i>文件；这是调用方法的那个文件。发送方文件中必须包含另一个 LocalConnection 对象和对 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 方法的调用。</p>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 的使用将有所不同，这取决于 文件是在同一个域中、在具有可预知域名的不同域中还是在具有不可预知域名（即动态域名）的不同域中。下文将说明这三种不同的情况，并针对每种情况分别提供代码示例。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">同一个域</b>。这是使用 LocalConnection 对象最简单的情况，它只允许在位于同一个域中的 LocalConnection 对象间通信，这是因为默认情况下，应用程序允许同域通信。当同一个域中的两个 文件通信时，无需实施任何特殊的安全措施，而只需将 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 参数的同一个值传递给 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 方法。</p>
 
 <p class="- topic/p "><adobeimage alt="从相同的域中加载" href="../../images/localconnection_samedomains.gif" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/p "><b class="+ topic/ph hi-d/b ">具有可预知域名的不同域</b>。当不同域中的两个 SWF 文件通信时，需要通过调用 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 方法来允许在这两个不同域之间进行通信。还需要在 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 方法中使用接收方 LocalConnection 对象的域名限定连接名：</p>
 
 <p class="- topic/p "><adobeimage alt="从不同的域中加载" href="../../images/localconnection_differentdomains.gif" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/p "><b class="+ topic/ph hi-d/b ">具有不可预知域名的不同域</b>。有时候，可能希望具有接收方 LocalConnection 对象的 文件在域之间具有更好的可移植性。为了避免在 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 方法中指定域名，但要指出接收方和发送方 LocalConnection 对象不在同一个域中，可在 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 调用中的连接名称之前加一个下划线 (_)。要允许在这两个不同域之间通信，请调用 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 方法并传递您希望允许 LocalConnection 调用的域。或者，也可以传递通配符 (*) 参数来允许从所有域调用：</p>
 
 <p class="- topic/p "><adobeimage alt="从未知域名中加载" href="../../images/localconnection_unknowndomains.gif" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/p "><b class="+ topic/ph hi-d/b ">从 Flash Player 到 AIR 应用程序</b>。在 AIR 应用程序沙箱中创建的 LocalConnection 对象使用一个特殊字符串作为连接前缀，而不是使用域名。此字符串的格式为 <codeph class="+ topic/ph pr-d/codeph ">app#appID.pubID</codeph>，其中，appID 是应用程序 ID，pubID 是应用程序的发行商 ID。（如果 AIR 应用程序使用发行商 ID，则仅包括发行商 ID。）例如，如果 AIR 应用程序的应用程序 ID 为“com.example”，没有发行商 ID，则您可以使用 <codeph class="+ topic/ph pr-d/codeph ">app#com.example:myConnection</codeph> 作为本地连接字符串。AIR 应用程序还必须调用 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 方法，传入调用 SWF 文件的原始域： </p>
 
 <p class="- topic/p "><adobeimage alt="Flash Player 到 AIR 连接" href="../../images/localconnection_flash2AIR.gif" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
// receivingLC is an AIR application with app ID = com.example (and no publisher ID)
receivingLC.allowDomain('www.domain.com');
receivingLC.connect('myConnection');

// sendingLC is in http://www.domain.com/sending.swf
sendingLC.send('app#com.example:myConnection', 'myMethod');
</codeblock>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果 AIR 应用程序在 AIR 应用程序沙箱外部加载 SWF，则使用该 SWF 建立本地连接的规则与使用 Flash Player 中运行的 SWF 建立连接的规则相同。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">从 AIR 应用程序到 Flash Playe</b>。当 AIR 应用程序与 Flash Player 运行时中运行的 SWF 通信时，您需要通过调用 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 方法并传入 AIR 应用程序的连接前缀，来允许两者之间的通信。例如，如果 AIR 应用程序的应用程序 ID 为“com.example”，没有发行商 ID，则您可以将字符串 <codeph class="+ topic/ph pr-d/codeph ">app#com.example</codeph> 传递给 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 方法。您还需要在 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 方法中使用接收方 LocalConnection 对象的域名（使用“localhost”作为从本地文件系统加载的 SWF 文件的域）来限定连接名：</p>
 
 <p class="- topic/p "><adobeimage alt="AIR 到 Flash Player 通信" href="../../images/localconnection_AIR2flash.gif" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
// receivingLC is in http://www.domain.com/receiving.swf
receivingLC.allowDomain('app#com.example');
receivingLC.connect('myConnection');

// sendingLC is an AIR application with app ID = com.example (and no publisher ID)
sendingLC.send('www.domain.com:myConnection', 'myMethod');
</codeblock>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">从一个 AIR 应用程序到另一个 AIR 应用程序</b>。要在两个 AIR 应用程序之间进行通信，您需要通过调用 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 方法并传入发送方 AIR 应用程序的连接前缀，来允许两者之间的通信。例如，如果发送方应用程序的应用程序 ID 为“com.example”，没有发行商 ID，您可以将字符串 <codeph class="+ topic/ph pr-d/codeph ">app#com.example</codeph> 传递给接收方应用程序中的 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 方法。还需要在 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 方法中使用接收方 LocalConnection 对象的连接前缀限定连接名：</p>
 
 <p class="- topic/p "><adobeimage alt="AIR 到 AIR 通信" href="../../images/localconnection_AIR2AIR.gif" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
// receivingLC is an AIR application with app ID = com.sample (and no publisher ID)
receivingLC.allowDomain('app#com.example');
receivingLC.connect('myConnection');

// sendingLC is an AIR application with app ID = com.example (and no publisher ID)
sendingLC.send('app#com.sample:myConnection', 'myMethod');
</codeblock>
 
 <p class="- topic/p ">可以使用 LocalConnection 对象发送和接收单个 文件中的数据，但这不是通常的用法。</p>
 
 <p class="- topic/p ">有关 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法的详细信息，请参阅 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.send()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.connect()</codeph> 条目中对 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 参数的讨论。此外，请参阅 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">domain</codeph> 条目。</p>
 
 </apiDesc><example conref="examples\LocalConnectionSenderExample.as" class="- topic/example "> 下例包含两个 ActionScript 类，这两个类应当编译到两个单独的 SWF 文件中：
 
 <p class="- topic/p ">在 LocalConnectionSenderExample SWF 文件中，将创建 LocalConnection 实例，并且当按下按钮时使用 <codeph class="+ topic/ph pr-d/codeph ">call()</codeph> 方法通过名为“myConnection”的连接调用 SWF 文件中名为 <codeph class="+ topic/ph pr-d/codeph ">lcHandler</codeph> 的方法，调用时将 TextField 的内容作为参数传递。</p>
 
 <p class="- topic/p ">在 LocalConnectionReceiverExample SWF 文件中，将创建 LocalConnection 实例并调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法，将此 SWF 文件指定为发送到名为“myConnection”的连接的消息的接收方。此外，此类还包括一个名为 <codeph class="+ topic/ph pr-d/codeph ">lcHandler()</codeph> 的公共方法，此方法就是 LocalConnectionSenderExample SWF 文件调用的方法。调用时，作为参数传入的文本将被追加到舞台的 TextField 中。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>为了测试此示例，必须将两个 SWF 文件同时加载到同一台计算机上。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" class="- topic/example "><codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#LocalConnection/send()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.send()</linktext></link><link href="flash.net.xml#LocalConnection/allowDomain()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.allowDomain()</linktext></link><link href="flash.net.xml#LocalConnection/domain" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.domain</linktext></link></related-links><adobeApiEvent id="flash.net:LocalConnection_flash.events.StatusEvent.STATUS_status" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">status</apiName><shortdesc class="- topic/shortdesc ">
 在 LocalConnection 对象报告其状态时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.StatusEvent.STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.StatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 LocalConnection 对象报告其状态时调度。如果 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.send()</codeph> 成功，则 <codeph class="+ topic/ph pr-d/codeph ">status</codeph> 事件对象的 <codeph class="+ topic/ph pr-d/codeph ">level</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">"status"</codeph>；如果调用失败，则 <codeph class="+ topic/ph pr-d/codeph ">level</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">"error"</codeph>。如果接收方 文件拒绝连接，则调用失败，并且不会通知发送方 文件。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#LocalConnection/send()" class="- topic/link "><linktext class="- topic/linktext ">LocalConnection.send()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:LocalConnection_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><shortdesc class="- topic/shortdesc ">
 若对 LocalConnection.send() 的调用尝试向另一个安全沙箱发送数据，则进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 若对 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.send()</codeph> 的调用尝试向另一个安全沙箱发送数据，则进行调度。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#LocalConnection/send()" class="- topic/link "><linktext class="- topic/linktext ">send()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:LocalConnection_flash.events.AsyncErrorEvent.ASYNC_ERROR_asyncError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">asyncError</apiName><shortdesc class="- topic/shortdesc ">
 在异步引发异常（即来自本机异步代码）时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.AsyncErrorEvent.ASYNC_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.AsyncErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在异步引发异常（即来自本机异步代码）时调度。
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:LocalConnection:LocalConnection" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">LocalConnection</apiName><shortdesc class="- topic/shortdesc ">
     创建 LocalConnection 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/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 class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建 LocalConnection 对象。可以使用 LocalConnection 对象启用在同一客户端计算机上运行的不同文件之间的通信。
     
     </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.net.xml#LocalConnection/connect()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.connect()</linktext></link><link href="flash.net.xml#LocalConnection/send()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.send()</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:LocalConnection:allowDomain" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">allowDomain</apiName><shortdesc class="- topic/shortdesc ">
     指定一个或多个可以将 LocalConnection 调用发送到此 LocalConnection 实例的域。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Change the first example in the listing.
     </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">所有指定的参数都必须为非空字符串。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">domains</apiItemName><apiType value="restParam" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对您在其上允许 LocalConnection 调用的域进行命名的一个或多个字符串。此参数有两种特殊用法：
     
     <ul class="- topic/ul "><li class="- topic/li ">可以指定通配符“*”，以允许从所有域调用。</li><li class="- topic/li ">您可以指定字符串“<codeph class="+ topic/ph pr-d/codeph ">localhost</codeph>”允许从本地安装的 文件调用此 文件。<ph class="- topic/ph ">Flash Player 8 对本地 文件引入了安全限制。默认情况下，在 Flash Player 中运行并允许访问 Internet 的 SWF 文件不能同时访问本地文件系统。在 Flash Player 中，如果指定了“<codeph class="+ topic/ph pr-d/codeph ">localhost</codeph>”，则任何本地 SWF 文件都可以访问此 SWF 文件。</ph> </li></ul>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定一个或多个可以将 LocalConnection 调用发送到此 LocalConnection 实例的域。
     
     <p class="- topic/p ">您无法使用此方法允许使用安全协议 (HTTPS) 承载的文件由使用非安全协议承载的文件进行访问；必须改用 <codeph class="+ topic/ph pr-d/codeph ">allowInsecureDomain()</codeph> 方法。</p>
     
     <p class="- topic/p ">您可能想要使用此方法，以便在不知道来自于不同域的子级文件究竟来自哪个最终域的情况下，使该子级文件能够对父级文件进行 LocalConnection 调用。例如，当您使用负载平衡重定向或第三方服务器时就可能发生这种情况。在这种情况下，您可以使用用于加载的 LoaderInfo 对象的 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性，以获取要与 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 方法配合使用的域。例如，如果使用 Loader 对象加载子级文件，则您可以在文件加载后检查 Loader 对象的 <codeph class="+ topic/ph pr-d/codeph ">contentLoaderInfo.url</codeph> 属性，并从完整的 URL 字符串中解析出域。如果您这样做的话，请务必等待文件加载完毕，因为只有在该文件完全加载后，<codeph class="+ topic/ph pr-d/codeph ">contentLoaderInfo.url</codeph> 属性才会具有其最终的正确值。 </p>
     
     <p class="- topic/p ">也可能出现相反的情况：您可能创建了一个子级文件，用以接受来自父级的 LocalConnection 调用，但却不知道其父级的域。在这种情况下，可以通过检查域参数是否与已加载的 文件中 <codeph class="+ topic/ph pr-d/codeph ">loaderInfo.url</codeph> 属性的域相匹配来实现此方法。同样，您必须从 <codeph class="+ topic/ph pr-d/codeph ">loaderInfo.url</codeph> 的完整 URL 中解析出该域。在这种情况下，您不必等待父级 文件加载；加载子级时，父级已经加载完毕。</p>
     
     <p class="- topic/p ">使用此方法时，请考虑 Flash Player 安全模型。默认情况下，LocalConnection 对象与创建它的 文件的沙箱相关联，并且不允许对 LocalConnection 对象进行跨域调用，除非在接收方 文件中调用 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.allowDomain()</codeph> 方法。但在 Adobe AIR 中，<codeph class="+ topic/ph pr-d/codeph ">application</codeph> 安全沙箱中的内容（使用 AIR 应用程序安装的内容）不受这些安全限制的约束。</p>
     
     <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：<codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 方法的格式已更改，与其在 ActionScript 1.0 和 2.0 中的格式不同。在这两个早期版本中，<codeph class="+ topic/ph pr-d/codeph ">allowDomain</codeph> 是可以实现的回调方法。在 ActionScript 3.0 中，<codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 是调用的 LocalConnection 的内置方法。由于这种更改，<codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 的用法与 <codeph class="+ topic/ph pr-d/codeph ">flash.system.Security.allowDomain()</codeph> 基本相同。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#LocalConnection/allowInsecureDomain()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.allowInsecureDomain()</linktext></link><link href="flash.display.xml#LoaderInfo/url" class="- topic/link "><linktext class="- topic/linktext ">flash.display.LoaderInfo.url</linktext></link><link href="flash.system.xml#Security/allowDomain()" class="- topic/link "><linktext class="- topic/linktext ">flash.system.Security.allowDomain()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:LocalConnection:allowInsecureDomain" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">allowInsecureDomain</apiName><shortdesc class="- topic/shortdesc ">
     指定一个或多个可以将 LocalConnection 调用发送到此 LocalConnection 对象的域。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Seems like a security note is in order here.
     </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">所有指定的参数都必须为非空字符串。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">domains</apiItemName><apiType value="restParam" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对您在其上允许 LocalConnection 调用的域进行命名的一个或多个字符串。此参数有两种特殊用法：
     <ul class="- topic/ul "><li class="- topic/li ">可以指定通配符“*”，以允许从所有域调用。指定“*”将不包括本地主机。</li><li class="- topic/li ">您可以指定字符串“<codeph class="+ topic/ph pr-d/codeph ">localhost</codeph>”允许从本地安装的 SWF 文件调用此 SWF 文件。Flash Player 8 对本地 SWF 文件引入了安全限制。可以访问 Internet 的 SWF 文件还不能访问本地文件系统。若指定“<codeph class="+ topic/ph pr-d/codeph ">localhost</codeph>”，则任何本地 SWF 文件都可以访问此 SWF 文件。请记住，处于编辑状态时还必须将执行调用的 SWF 文件指定为只能与远程内容交互的 SWF 文件。</li></ul>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定一个或多个可以将 LocalConnection 调用发送到此 LocalConnection 对象的域。
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">allowInsecureDomain()</codeph> 方法的用法与 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 方法相似，不同之处是 <codeph class="+ topic/ph pr-d/codeph ">allowInsecureDomain()</codeph> 方法允许非 HTTPS 来源的文件将 LocalConnection 调用发送至 HTTPS 来源的 SWF 文件。仅当您在使用 HTTPS 加载的文件中调用 <codeph class="+ topic/ph pr-d/codeph ">allowInsecureDomain()</codeph> 方法时，才能体现这种不同。即使在同一个域中跨越非 HTTPS/HTTPS 边界，也必须调用 <codeph class="+ topic/ph pr-d/codeph ">allowInsecureDomain()</codeph> 方法；默认情况下，即使在同一个域中，也不允许从非 HTTPS 文件到 HTTPS 文件进行 LocalConnection 调用。</p>
     
     <p class="- topic/p ">不建议调用 <codeph class="+ topic/ph pr-d/codeph ">allowInsecureDomain()</codeph>，因为这可能会削弱 HTTPS 提供的安全性。通过 HTTPS 加载文件时，您可以确信在通过网络传输文件时，文件不会被篡改。如果随后允许非 HTTPS 文件对 HTTPS 文件进行 LocalConnection 调用，则要接受来自可能在传输过程中已被篡改的 文件的调用。这通常需要格外小心，因为您无法确保到达 HTTPS 文件的 LocalConnection 调用的真实性。</p>
     
     <p class="- topic/p ">默认情况下，使用 HTTPS 协议承载的文件只能被其他使用 HTTPS 协议承载的文件访问。这种实现保持了 HTTPS 协议所提供的完整性。</p>
     
     <p class="- topic/p ">不建议使用此方法覆盖默认行为，因为这样做会削弱 HTTPS 安全性。但在某些情况下您可能需要这样做；例如，需要允许从为 Flash Player 6 或更早版本发布的 HTTP SWF 文件访问为 Flash Player 9 或更高版本发布的 HTTPS SWF 文件。</p>
     
     <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#LocalConnection/allowDomain()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.allowDomain()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:LocalConnection:close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     关闭（断开连接）LocalConnection 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">LocalConnection, LocalConnection.close, close
     
      </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">未连接 LocalConnection 实例，因而无法将其关闭。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     关闭（断开连接）LocalConnection 对象。在您不再需要该对象来接受命令时（例如，当您要在另一个 SWF 文件中使用相同的 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 参数发出 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 命令时）发出此命令。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#LocalConnection/connect()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.connect()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:LocalConnection:connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
     准备 LocalConnection 对象以接收从 send() 命令（从发送方 LocalConnection 对象）发送的命令。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">LocalConnection, LocalConnection.connect, connect
     
      </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">传递给 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 参数的值必须为非空值。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">TypeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">TypeError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">出现此错误有以下三种原因：1) 传递给 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 参数的字符串值为空。请传递非空值。2) 传递给 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 参数的值包含冒号 (:)。冒号用作一种特殊字符，在 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 方法（而非 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法）中用于分隔超级域和 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 字符串。3) 已连接 LocalConnection 实例。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">connectionName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个字符串，对应于要与接收方 LocalConnection 对象进行通信的 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 命令中指定的连接名称。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     准备 LocalConnection 对象以接收从 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 命令（从<i class="+ topic/ph hi-d/i ">发送方 LocalConnection 对象</i>）发送的命令。同 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法一起使用的对象被称为<i class="+ topic/ph hi-d/i ">接收方 LocalConnection 对象</i>。接收方和发送方对象必须运行于同一台客户端计算机上。
     
     <p class="- topic/p ">要避免出现竞争状况，请在调用附加到接收方 LocalConnection 对象的方法之前先定义这些方法，如 LocalConnection 类示例所示。 </p>
     
     <p class="- topic/p ">默认情况下，<codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 将解析为值<codeph class="+ topic/ph pr-d/codeph ">“<i class="+ topic/ph hi-d/i ">superdomain</i>:connectionName”</codeph>，其中 <codeph class="+ topic/ph pr-d/codeph "><i class="+ topic/ph hi-d/i ">superdomain</i></codeph> 是包含 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 命令的文件的超级域。例如，如果包含接收方 LocalConnection 对象的 文件位于 www.someDomain.com，则 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 解析为 <codeph class="+ topic/ph pr-d/codeph ">"someDomain.com:connectionName"</codeph>。（如果 Flash Player 中运行的文件位于客户端计算机上，则分配给 <codeph class="+ topic/ph pr-d/codeph ">superdomain</codeph> 的值为<codeph class="+ topic/ph pr-d/codeph ">“localhost”</codeph>。）</p>
     
     <p class="- topic/p ">在运行于 Adobe AIR 的 <codeph class="+ topic/ph pr-d/codeph ">application</codeph> 安全沙箱的内容（使用 AIR 应用程序安装的内容）中，运行时将使用字符串 <codeph class="+ topic/ph pr-d/codeph ">app#</codeph> 后跟 AIR 应用程序的应用程序 ID（在应用程序描述符文件中定义）来代替该超级域。例如，应用程序 ID 为 <codeph class="+ topic/ph pr-d/codeph ">com.example.air.MyApp</codeph> <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 的应用程序的 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 将解析为 <codeph class="+ topic/ph pr-d/codeph ">"app#com.example.air.MyApp:connectionName"</codeph>。</p>
     
     <p class="- topic/p ">此外，在默认情况下，Flash Player 只允许接收方 LocalConnection 对象从连接名称也解析为值 <codeph class="+ topic/ph pr-d/codeph ">"</codeph><codeph class="+ topic/ph pr-d/codeph "><i class="+ topic/ph hi-d/i ">superdomain</i></codeph><codeph class="+ topic/ph pr-d/codeph ">:connectionName"</codeph> 的发送方 LocalConnection 对象接受命令。这样，Flash Player 就使得位于同一个域中的文件可以很容易地相互通信。</p>
     
     <p class="- topic/p ">如果您仅在同一个域中的 文件之间实现通讯，请为 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 指定一个不以下划线 (_) 开头且不指定域名的字符串（例如 <codeph class="+ topic/ph pr-d/codeph ">"myDomain:connectionName"</codeph>）。在 <codeph class="+ topic/ph pr-d/codeph ">connect(connectionName)</codeph> 方法中使用同一个字符串。</p>
     
     <p class="- topic/p ">如果要使位于不同域中的 文件之间实现通信，则为 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 指定一个以下划线 (_) 开头的字符串，这样就会使具有接收方 LocalConnection 对象的 文件在域之间具有更好的可移植性。下面是两种可能的情形：</p>
     
     <ul class="- topic/ul "><li class="- topic/li ">如果 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 字符串不以下划线 (_) 开头，则会添加一个超级域前缀和一个冒号（例如<codeph class="+ topic/ph pr-d/codeph ">“myDomain:connectionName”</codeph>）。虽然这可以确保您的连接不会与其他域中具有同一名称的连接相互冲突，但任何发送方 LocalConnection 对象都必须指定此超级域（例如 <codeph class="+ topic/ph pr-d/codeph ">"myDomain:connectionName"</codeph>）。如果具有接收方 LocalConnection 对象的 文件被移动到另一个域中，则播放器会更改该前缀，以反映新的超级域（例如 <codeph class="+ topic/ph pr-d/codeph ">"anotherDomain:connectionName"</codeph>）。所有发送方 LocalConnection 对象必须进行手动编辑，以指向这个新超级域。</li><li class="- topic/li ">如果 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 字符串以下划线开头（例如<codeph class="+ topic/ph pr-d/codeph ">“_connectionName”</codeph>），则不会向该字符串添加前缀。这意味着接收方和发送方 LocalConnection 对象都将使用相同的 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 字符串。如果接收方对象使用 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 来指定可以接受来自任何域的连接，则具有接收方 LocalConnection 对象的 文件可以移动到另一个域，而无需更改任何发送方 LocalConnection 对象。</li></ul>
     
     <p class="- topic/p ">有关详细信息，请参阅类概述中的讨论和 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 中对 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 的讨论以及 <codeph class="+ topic/ph pr-d/codeph ">allowDomain()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">domain</codeph> 条目。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>冒号用作一种特殊字符，以分隔 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 超级域和字符串。包含冒号的 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 字符串无效。</p>
     
     <p class="- topic/p ">使用此方法时，请考虑 <ph class="- topic/ph ">Flash Player</ph> 安全模型。默认情况下，LocalConnection 对象与创建它的 文件的沙箱相关联，并且不允许对 LocalConnection 对象进行跨域调用，除非在接收方 文件中调用 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.allowDomain()</codeph> 方法。<ph class="- topic/ph ">可以在包含 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数，防止 SWF 文件使用此方法。</ph>但在 Adobe AIR 中，<codeph class="+ topic/ph pr-d/codeph ">application</codeph> 安全沙箱中的内容（使用 AIR 应用程序安装的内容）不受这些安全限制的约束。</p>
     
     <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#LocalConnection/send()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.send()</linktext></link><link href="flash.net.xml#LocalConnection/allowDomain()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.allowDomain()</linktext></link><link href="flash.net.xml#LocalConnection/domain" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.domain</linktext></link></related-links></apiOperation><apiOperation id="flash.net:LocalConnection:send" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">send</apiName><shortdesc class="- topic/shortdesc ">
     在使用 connect(connectionName) 方法打开的连接（位于接收方 LocalConnection 对象中）上调用 methodName 方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">LocalConnection, LocalConnection.send, send
     
     
      </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">methodName</codeph> 的值为空。请将非空值传递给这些参数。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">TypeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">TypeError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">出现此错误是由于以下某种原因：1) <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">methodName</codeph> 的值为空字符串。请将有效字符串传递给这些参数。2) <codeph class="+ topic/ph pr-d/codeph ">methodName</codeph> 中指定的方法受限。3) 正在发送的序列化消息过大（超过 40K）。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">connectionName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对应于要与发送方 LocalConnection 对象进行通信的 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 命令中指定的连接名称。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">methodName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要在接收方 LocalConnection 对象中调用的方法的名称。以下方法名会导致命令失败：<codeph class="+ topic/ph pr-d/codeph ">send</codeph>、<codeph class="+ topic/ph pr-d/codeph ">connect</codeph>、<codeph class="+ topic/ph pr-d/codeph ">close</codeph>、<codeph class="+ topic/ph pr-d/codeph ">allowDomain</codeph>、<codeph class="+ topic/ph pr-d/codeph ">allowInsecureDomain</codeph>、<codeph class="+ topic/ph pr-d/codeph ">client</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">domain</codeph>。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">arguments</apiItemName><apiType value="restParam" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要传递给指定方法的附加可选参数。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在使用 <codeph class="+ topic/ph pr-d/codeph ">connect(connectionName)</codeph> 方法打开的连接（位于<i class="+ topic/ph hi-d/i ">接收方 LocalConnection 对象</i> 中）上调用 <codeph class="+ topic/ph pr-d/codeph ">methodName</codeph> 方法。同 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 方法一起使用的对象被称为<i class="+ topic/ph hi-d/i ">发送方 LocalConnection 对象</i>。包含发送方对象的 SWF 文件和包含接收方对象的 SWF 文件必须在同一台客户端计算机上运行。
     
     <p class="- topic/p ">您能够以参数形式传递给此命令的数据量限制为 40 千字节。如果 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 引发 <codeph class="+ topic/ph pr-d/codeph ">ArgumentError</codeph>，但是您的语法是正确的，请尝试将 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 请求分为多个命令，每个命令的数据量不超过 40K。</p>
     
     <p class="- topic/p ">如 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 条目中所述，默认情况下，会将当前超级域添加到 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph>。如果您要在不同的域之间实现通讯，则在发送方和接收方 LocalConnection 对象中都需要定义 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph>，这样当前超级域就不会添加到 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph>。您可以使用以下两种方法中的一种实现这一目的：</p>
     
     <ul class="- topic/ul "><li class="- topic/li ">在发送方 LocalConnection 对象和接收方 LocalConnection 对象中 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 的开头使用下划线 (_)。在包含接收方对象的 文件中，使用 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.allowDomain()</codeph> 指定将接受来自任何域的连接。这一实现使您可以在任何域中存储发送方 文件和接收方 SWF 文件。</li><li class="- topic/li ">在发送方 LocalConnection 对象中包含 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 中的超级域，例如 <codeph class="+ topic/ph pr-d/codeph ">myDomain.com:myConnectionName</codeph>。在接收方对象中，使用 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.allowDomain()</codeph> 指定将接受来自指定超级域的连接（本例中为 myDomain.com），或者接受来自任何域的连接。</li></ul>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>不能在接收方 LocalConnection 对象的 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 中指定超级域，只能在发送方 LocalConnection 对象中指定。</p>
     
     <p class="- topic/p ">使用此方法时，请考虑 <ph class="- topic/ph ">Flash Player</ph> 安全模型。默认情况下，LocalConnection 对象与创建它的 文件的沙箱相关联，并且不允许对 LocalConnection 对象进行跨域调用，除非在接收方 文件中调用 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.allowDomain()</codeph> 方法。对于在浏览器中运行的 SWF 内容，通过在包含 SWF 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数，可以防止文件使用此方法。但在 Adobe AIR 中，<codeph class="+ topic/ph pr-d/codeph ">application</codeph> 安全沙箱中的内容（使用 AIR 应用程序安装的内容）不受这些安全限制的约束。</p>
     
     <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#LocalConnection/allowDomain()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.allowDomain()</linktext></link><link href="flash.net.xml#LocalConnection/connect()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.connect()</linktext></link><link href="flash.net.xml#LocalConnection/domain" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.domain</linktext></link></related-links><adobeApiEvent id="flash.net:LocalConnection:send_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "><codeph class="+ topic/ph pr-d/codeph ">LocalConnection.send() </codeph>尝试与执行调用的代码不能访问的安全沙箱中的 SWF 文件通信。在接收方的 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.allowDomain()</codeph> 实现中可以避免此问题。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">LocalConnection.send() 尝试与执行调用的代码不能访问的安全沙箱中的 SWF 文件通信。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:LocalConnection:send_status" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">status</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:StatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果 <codeph class="+ topic/ph pr-d/codeph ">level</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">"status"</codeph>，则调用成功；如果值为 <codeph class="+ topic/ph pr-d/codeph ">"error"</codeph>，则调用失败。如果接收方 SWF 文件拒绝连接，则调用失败。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">如果 level 属性的值为“status”，则调用成功；如果值为“error”，则调用失败。</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.net:LocalConnection:client:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">client</apiName><shortdesc class="- topic/shortdesc ">
     表示对其调用回调方法的对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">必须将 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性设置为非空对象。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">TypeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">TypeError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示对其调用回调方法的对象。默认对象为 <codeph class="+ topic/ph pr-d/codeph ">this</codeph>，将创建本地连接。您可以将设置 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性设置为另一个对象，并对此对象调用回调方法。
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:LocalConnection:domain:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">domain</apiName><shortdesc class="- topic/shortdesc ">
     一个字符串，它表示当前 文件所在位置的域。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">LocalConnection, LocalConnection.domain, domain
     
      </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     一个字符串，它表示当前 文件所在位置的域。
     
     <p class="- topic/p ">在运行于 Adobe AIR 的 <codeph class="+ topic/ph pr-d/codeph ">application</codeph> 安全沙箱的内容（使用 AIR 应用程序安装的内容）中，运行时将使用字符串 <codeph class="+ topic/ph pr-d/codeph ">app#</codeph> 后跟 AIR 应用程序的应用程序 ID（在应用程序描述符文件中定义）来代替该超级域。例如，应用程序 ID 为 <codeph class="+ topic/ph pr-d/codeph ">com.example.air.MyApp</codeph> <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 的应用程序的 <codeph class="+ topic/ph pr-d/codeph ">connectionName</codeph> 将解析为 <codeph class="+ topic/ph pr-d/codeph ">"app#com.example.air.MyApp:connectionName"</codeph>。</p>
     
     <p class="- topic/p ">在为 Flash Player 9 或更高版本发布的 SWF 文件中，返回的字符串就是文件所在的域并包括子域。例如，如果 文件位于 www.adobe.com，则此命令将返回 <codeph class="+ topic/ph pr-d/codeph ">"www.adobe.com"</codeph>。 </p>
     
     <p class="- topic/p ">如果当前文件是在 Flash Player 中运行并驻留在客户端计算机上的本地文件，则此命令将返回<codeph class="+ topic/ph pr-d/codeph ">“localhost”</codeph>。</p>
     
     <p class="- topic/p ">此属性最常见的用法是，将发送方 LocalConnection 对象的域名作为要在接收方 LocalConnection 对象中调用的方法的参数包括在内，或者与 <codeph class="+ topic/ph pr-d/codeph ">LocalConnection.allowDomain()</codeph> 一起使用以接受来自指定域的命令。如果仅启用位于同一个域的 LocalConnection 对象之间的通信，则可能不需要使用此属性。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#LocalConnection/allowDomain()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.allowDomain()</linktext></link><link href="flash.net.xml#LocalConnection/connect()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.LocalConnection.connect()</linktext></link></related-links></apiValue><apiValue id="flash.net:LocalConnection:isSupported:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">isSupported</apiName><shortdesc class="- topic/shortdesc ">
    如果当前平台支持 LocalConnection 类，则 isSupported 属性设置为 true，否则设置为 false。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    如果当前平台支持 LocalConnection 类，则 <codeph class="+ topic/ph pr-d/codeph ">isSupported</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，否则，设置为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
    
    </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:LocalConnection:isPerUser:set" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">isPerUser</apiName><shortdesc class="- topic/shortdesc "/><prolog class="- topic/prolog "/><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetStream" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetStream</apiName><shortdesc class="- topic/shortdesc ">
 NetStream 类通过 NetConnection 打开了一个单向流通道。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream
 
 </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 NetStream 类通过 NetConnection 打开了一个单向流通道。
 
 <p class="- topic/p "> 使用 NetStream 类执行以下操作：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph>，从本地磁盘、Web 服务器或 Flash Media Server 播放媒体文件。</li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.publish()</codeph> 以将视频、音频和数据流发布到 Flash Media Server。</li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.send()</codeph> 将数据消息发送给所有订阅客户端。</li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.send()</codeph> 向实时流添加元数据。</li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.appendBytes()</codeph>，将 ByteArray 数据传入 NetStream。</li></ul>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>不能通过同一 NetStream 对象播放和发布流。</p>
 
 <p class="- topic/p ">Adobe AIR 和 Flash Player 9.0.115.0 和更高版本支持从标准 MPEG-4 容器格式中派生的文件。这些文件包括 F4V、MP4、M4A、MOV、MP4V、3GP 和 3G2（如果他们包含 H.264 视频和/或 HEAAC v2 编码音频）。与 Sorenson 或 On2 中相同的编码配置文件相比，H.264 可以在更低的位速率下交付更高品质的视频。AAC 是在 MPEG-4 视频标准中定义的一种标准音频格式。HE-AAC v2 是 AAC 的扩展，它使用频带复制 (SBR) 和参量立体声 (PS) 技术在低比特率下提高编码效率。</p>
 
 <p class="- topic/p ">有关支持的编解码器和文件格式的信息，请参阅下面的内容：</p>
 
 <ul class="- topic/ul "><li class="- topic/li "><xref href="http://www.adobe.com/go/learn_fms_fileformats_cn" scope="external" class="- topic/xref ">Flash Media Server 文档</xref></li><li class="- topic/li "><xref href="http://www.adobe.com/go/hardware_scaling_cn" scope="external" class="- topic/xref ">Exploring Flash Player support for high-definition H.264 video and AAC audio</xref>（了解高分辨率 H.264 视频和 AAC 音频的 Flash Player 支持）</li><li class="- topic/li "><xref href="http://www.adobe.com/go/video_file_format_cn" scope="external" class="- topic/xref ">FLV/F4V open specification documents</xref>（FLV/F4V 开放规范文档）</li></ul>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">从 Flash Media Server 流、渐进式 F4V 文件或渐进式 FLV 文件中接收数据</b></p>
 
 <p class="- topic/p ">Flash Media Server、F4V 文件和 FLV 文件可以在流处理或播放过程中发送包含特定数据点上的数据的事件对象。您可以使用两种方法在播放过程中从流或 FLV 文件中处理数据：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">
 将客户端属性与事件处理函数相关联以接收数据对象。使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 属性分配对象以调用特定的数据处理函数。分配给 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 属性的对象可以侦听下列数据点：<codeph class="+ topic/ph pr-d/codeph ">onCuePoint()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">onImageData()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">onMetaData()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">onPlayStatus()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">onSeekPoint()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">onTextData()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">onXMPData()</codeph>。在这些函数内编写过程，以处理在播放过程中从流中返回的数据对象。有关详细信息，请参阅 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 属性。
 </li><li class="- topic/li ">
 将客户端属性与 NetStream 类的子类相关联，然后编写事件处理函数以接收数据对象。NetStream 是一个密封类，即无法在运行时将属性或方法添加到 NetStream 对象。然而，您可以创建 NetStream 的子类并在其中定义您的事件处理函数。您还可以将该子类变为动态的并对子类的实例添加事件处理函数。
 </li></ul>
 
 <p class="- topic/p ">在您使用对象复制、直接路由或发布 API 之前，等待接收 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.Neighbor.Connect</codeph> 事件。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>要通过音频文件（如 mp3 文件）发送数据，请使用 Sound 类将音频文件与 Sound 对象关联起来。然后使用 <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> 属性读取声音文件中的元数据。</p>
 
 </apiDesc><example conref="examples\NetConnectionExample.as" class="- topic/example "> 以下示例将 Video 对象与 NetConnection 和 NetStream 类一同使用，以加载和播放 FLV 文件。 
 <p class="- topic/p ">在本例中，创建 Video 和 NetStream 对象并调用 <codeph class="+ topic/ph pr-d/codeph ">Video.attachNetStream()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法的代码放在处理函数中。仅当连接到 NetConnection 对象的尝试取得成功时才调用处理函数，即，当 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件返回 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 对象（带有一个表示成功的 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性）时，才调用该处理函数。建议您在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 之前，等待连接成功。 </p>
 <codeblock xml:space="preserve" class="+ topic/pre pr-d/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 = "http://www.helpexamples.com/flash/video/cuepoints.flv";
        private var connection:NetConnection;
        private var stream:NetStream;
        private var video:Video = new Video();        

        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();
            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><example conref="examples\NetConnectionExample.2.as" class="- topic/example "> 可以使用函数（而不是创建自定义类）来获取元数据。以下建议（由 <xref href="http://www.sandlight.com" scope="external" class="- topic/xref ">Bill Sanders</xref> 提供）说明如何编辑上述 NetConnectionExample 代码来在函数中调用元数据。在此示例中，<codeph class="+ topic/ph pr-d/codeph ">mdata</codeph> 对象用于设置 <codeph class="+ topic/ph pr-d/codeph ">video</codeph> 视频实例的宽度和高度。
 <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  //Place the following in the connectStream() function
  //in the NetConnectionExample code
  var metaSniffer:Object=new Object();  
  stream.client=metaSniffer; //stream is the NetStream instance  
  metaSniffer.onMetaData=getMeta;  
      
   
  // Add the following function within the NetConnectionExample class  
  private function getMeta (mdata:Object):void  
  {  
     video.width=mdata.width/2;  
     video.height=mdata.height/2;  
  }  
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Video" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Video</linktext></link><link href="flash.net.xml#NetConnection" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection</linktext></link><link href="flash.net.xml#NetStream/appendBytes()" class="- topic/link "><linktext class="- topic/linktext ">appendBytes()</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.net.xml#NetStream/publish()" class="- topic/link "><linktext class="- topic/linktext ">publish()</linktext></link><link href="flash.net.xml#NetStream/send()" class="- topic/link "><linktext class="- topic/linktext ">send()</linktext></link><link href="flash.net.xml#NetStream/event:onImageData" class="- topic/link "><linktext class="- topic/linktext ">onImageData</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData" class="- topic/link "><linktext class="- topic/linktext ">onMetaData</linktext></link></related-links><adobeApiEvent id="flash.net:NetStream_flash.events.NetDataEvent_mediaTypeData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">mediaTypeData</apiName><shortdesc class="- topic/shortdesc ">
 播放视频内容和处理某种类型的消息时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.3" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2.7" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="3.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.NetDataEvent</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.NetDataEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 播放视频内容和处理某种类型的消息时调度。
 
 <p class="- topic/p ">对于以下消息调度 NetDataEvent：</p>
 <ul class="- topic/ul "><li class="- topic/li ">onCuePoint</li><li class="- topic/li ">onImageData</li><li class="- topic/li ">onMetaData</li><li class="- topic/li ">onPlayStatus（用于代码 NetStream.Play.Complete）</li><li class="- topic/li ">onTextData</li><li class="- topic/li ">onXMPData</li></ul>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>Android 或 Blackberry Tablet OS 上的浏览器的 Flash Player 中运行的内容或 iOS 上的 AIR 中运行的内容不会调度此事件。</p>
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onSeekPoint" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">onSeekPoint</apiName><shortdesc class="- topic/shortdesc ">
 当追加字节分析程序遇到一个它认为是可搜索的点（例如，视频关键帧）时从 appendBytes() 同步调用。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier "/><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当追加字节分析程序遇到一个它认为是可搜索的点（例如，视频关键帧）时从 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 同步调用。使用此事件构造搜索点表。<codeph class="+ topic/ph pr-d/codeph ">byteCount</codeph> 对应于该搜索点的可解析的消息的第一个字节处的 <codeph class="+ topic/ph pr-d/codeph ">byteCount</codeph>，然后如上所述被重置为 0。要进行搜索，请在 <codeph class="+ topic/ph pr-d/codeph ">NetStream.Seek.Notify</codeph> 事件处，找到以可搜索点开始的字节，然后调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytes(bytes)</codeph>。如果 <codeph class="+ topic/ph pr-d/codeph ">bytes</codeph> 参数是由从可搜索点开始的字节组成的 <codeph class="+ topic/ph pr-d/codeph ">ByteArray</codeph>，则在该搜索点处播放视频。
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>将忽略从此回调中进行的对 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 的调用。</p>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">onSeekPoint</codeph> 属性是 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 对象的属性。该属性之所以在 Events 一节中列出，是因为它将响应传入 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 方法的数据。有关详细信息，请参阅 NetStream 类的描述以及 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 属性。不能使用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 方法或任何其他 EventDispatcher 方法将 <codeph class="+ topic/ph pr-d/codeph ">onSeekPoint</codeph> 作为事件进行侦听或处理。要使用 <codeph class="+ topic/ph pr-d/codeph ">onSeekPoint</codeph>，请定义一个回调函数并将其附加到下列对象之一：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">NetStream 实例的 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性所引用的对象。</li><li class="- topic/li ">NetStream 子类的一个实例。NetStream 是一个密封类，即无法在运行时将属性或方法添加到 NetStream 对象。然而，您可以创建 NetStream 的子类并在其中定义您的事件处理函数。您还可以将该子类变为动态的并对子类的实例添加事件处理函数。</li></ul>
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/client" class="- topic/link "><linktext class="- topic/linktext ">client</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.DRMStatusEvent.DRM_STATUS_drmStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">drmStatus</apiName><shortdesc class="- topic/shortdesc ">
 在开始播放数字权限管理 (DRM) 加密的内容时（如果已对用户进行身份验证并授权播放该内容）调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.DRMStatusEvent.DRM_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.DRMStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在开始播放数字权限管理 (DRM) 加密的内容时（如果已对用户进行身份验证并授权播放该内容）调度。
 <p class="- topic/p ">
 DRMStatusEvent 对象包含与凭证有关的信息，如是否可以脱机使用该内容或凭证何时过期而用户无法再查询该内容。
 </p>
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.events.xml#DRMStatusEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.DRMStatusEvent</linktext></link><link href="flash.net.drm.xml#DRMManager/resetDRMVouchers()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.drm.DRMManager.resetDRMVouchers()</linktext></link><link href="flash.net.xml#NetStream/setDRMAuthenticationCredentials()" class="- topic/link "><linktext class="- topic/linktext ">setDRMAuthenticationCredentials()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.DRMErrorEvent.DRM_ERROR_drmError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">drmError</apiName><shortdesc class="- topic/shortdesc ">
 在 NetStream 对象尝试播放数字权限管理 (DRM) 加密的文件的过程中遇到与 DRM 相关的错误时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.DRMErrorEvent.DRM_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.DRMErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 NetStream 对象尝试播放数字权限管理 (DRM) 加密的文件的过程中遇到与 DRM 相关的错误时调度。例如，用户身份验证失败时，将调度 DRMErrorEvent 对象。这可能是由于用户没有购买查看内容的权限或者是由于内容提供程序不支持执行查看的应用程序。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.events.xml#DRMErrorEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.DRMErrorEvent</linktext></link><link href="flash.net.drm.xml#DRMManager/resetDRMVouchers()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.drm.DRMManager.resetDRMVouchers()</linktext></link><link href="flash.net.xml#NetStream/setDRMAuthenticationCredentials()" class="- topic/link "><linktext class="- topic/linktext ">setDRMAuthenticationCredentials()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.DRMAuthenticateEvent.DRM_AUTHENTICATE_drmAuthenticate" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">drmAuthenticate</apiName><shortdesc class="- topic/shortdesc ">
 在 NetStream 对象尝试播放使用数字权限管理 (DRM) 加密的内容（播放前需要用户凭据以进行身份验证）时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.DRMAuthenticateEvent.DRM_AUTHENTICATE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.DRMAuthenticateEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 NetStream 对象尝试播放使用数字权限管理 (DRM) 加密的内容（播放前需要用户凭据以进行身份验证）时调度。
 
 <p class="- topic/p ">
 使用 NetStream 对象的 <codeph class="+ topic/ph pr-d/codeph ">setDRMAuthenticationCredentials()</codeph> 方法对用户进行身份验证。如果用户身份验证失败，则应用程序将重新尝试身份验证并为 NetStream 对象调度一个新的 DRMAuthenticateEvent 事件。
 </p>
 
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.events.xml#DRMAuthenticateEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.DRMAuthenticateEvent</linktext></link><link href="flash.net.drm.xml#DRMManager/resetDRMVouchers()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.drm.DRMManager.resetDRMVouchers()</linktext></link><link href="flash.net.xml#NetStream/setDRMAuthenticationCredentials()" class="- topic/link "><linktext class="- topic/linktext ">setDRMAuthenticationCredentials()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onDRMContentData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">onDRMContentData</apiName><shortdesc class="- topic/shortdesc ">
 建立一个侦听器，以便在 AIR 提取媒体文件中嵌入的 DRM 内容元数据时作出响应。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier "/><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 建立一个侦听器，以便在 AIR 提取媒体文件中嵌入的 DRM 内容元数据时作出响应。
 
 <p class="- topic/p ">DRMContentData 对象包含获取凭证所需的信息，在播放受 DRM 保护的媒体文件时需要该凭证。使用 DRMManager 类可根据这些信息下载该凭证。</p>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">onDRMContentData</codeph> 是 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 对象的属性。该属性之所以在 Events 一节中列出，是因为从本地媒体文件预加载嵌入的数据时它将响应数据事件。有关详细信息，请参阅 NetStream 类的描述。不能使用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 方法或任何其他 EventDispatcher 方法将 <codeph class="+ topic/ph pr-d/codeph ">onDRMContentData</codeph> 作为事件进行侦听或处理。相反，您必须定义一个回调函数，并将其直接附加到以下对象之一：</p>
 <ul class="- topic/ul "><li class="- topic/li ">NetStream 实例的 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性所引用的对象。</li><li class="- topic/li ">NetStream 子类的一个实例。NetStream 是一个密封类，即无法在运行时将属性或方法添加到 NetStream 对象。然而，您可以创建 NetStream 的子类并在其中定义您的事件处理函数，或者将该子类变为动态的并对子类的实例添加事件处理函数。</li></ul>
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.drm.xml#DRMContentData" class="- topic/link "><linktext class="- topic/linktext ">flash.net.drm.DRMContentData</linktext></link><link href="flash.net.xml#NetStream/preloadEmbeddedData()" class="- topic/link "><linktext class="- topic/linktext ">preloadEmbeddedData()</linktext></link><link href="flash.net.drm.xml#DRMManager" class="- topic/link "><linktext class="- topic/linktext ">flash.net.drm.DRMManager</linktext></link><link href="flash.net.drm.xml#DRMVoucher" class="- topic/link "><linktext class="- topic/linktext ">flash.net.drm.DRMVoucher</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onPlayStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">onPlayStatus</apiName><shortdesc class="- topic/shortdesc ">
 在 NetStream 对象已完全播放流时建立侦听器进行响应。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier "/><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 NetStream 对象已完全播放流时建立侦听器进行响应。关联的事件对象除了提供由 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件返回的信息以外，还提供一些其他信息。您可以在 NetStream 对象从播放列表中的一个流切换到另一个流时（如信息对象 <codeph class="+ topic/ph pr-d/codeph ">NetStream.Play.Switch</codeph> 所示），或者在 NetStream 对象播放到结尾时（如信息对象 <codeph class="+ topic/ph pr-d/codeph ">NetStream.Play.Complete</codeph> 所示），使用此属性触发代码中的操作。
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">onPlayStaus</codeph> 实际上是 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 对象的属性。该属性之所以在 Events 一节中列出，因为它在流媒体使用 Flash Media Server 时或在 FLV 文件播放过程中响应数据事件。有关详细信息，请参阅 NetStream 类的描述。不能使用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 方法或任何其他 EventDispatcher 方法将 <codeph class="+ topic/ph pr-d/codeph ">onPlayStatus</codeph> 作为事件进行侦听或处理。定义一个回调函数并将其附加到下列对象之一：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">NetStream 实例的 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性所引用的对象。</li><li class="- topic/li ">NetStream 子类的一个实例。NetStream 是一个密封类，即无法在运行时将属性或方法添加到 NetStream 对象。创建 NetStream 的子类并在其中定义您的事件处理函数。您还可以将该子类变为动态的并对子类的实例添加事件处理函数。</li></ul>
 
 <p class="- topic/p ">此事件可返回一个具有以下属性的信息对象：</p>

 <adobetable class="innertable"><tgroup cols="3" class="- topic/tgroup "><thead class="- topic/thead "><row class="- topic/row "><entry class="- topic/entry ">代码属性</entry><entry class="- topic/entry ">级别属性</entry><entry class="- topic/entry ">意义</entry></row></thead><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">NetStream.Play.Switch</codeph></entry><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">"status"</codeph></entry><entry class="- topic/entry ">订阅者正在从播放列表中的一个流切换到另一个流。</entry></row><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">NetStream.Play.Complete</codeph></entry><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">"status"</codeph></entry><entry class="- topic/entry ">播放已结束。</entry></row><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">NetStream.Play.TransitionComplete</codeph></entry><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">"status"</codeph></entry><entry class="- topic/entry ">应用流比特率切换之后，订户将切换到新的流</entry></row></tbody></tgroup></adobetable>
 
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/client" class="- topic/link "><linktext class="- topic/linktext ">client</linktext></link><link href="flash.events.xml#NetStatusEvent/NET_STATUS" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.NET_STATUS</linktext></link><link href="flash.net.xml#NetStream/event:asyncError" class="- topic/link "><linktext class="- topic/linktext ">asyncError</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData" class="- topic/link "><linktext class="- topic/linktext ">onMetaData</linktext></link><link href="flash.net.xml#NetStream/event:onCuePoint" class="- topic/link "><linktext class="- topic/linktext ">onCuePoint</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onCuePoint" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">onCuePoint</apiName><shortdesc class="- topic/shortdesc ">
 在播放视频文件期间到达嵌入提示点时建立侦听器进行响应。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier "/><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在播放视频文件期间到达嵌入提示点时建立侦听器进行响应。在视频到达某个特定提示点时，您可以使用此侦听器触发代码中的操作，从而使应用程序中的其他操作与视频播放事件实现同步。有关 Flash Media Server 支持的视频文件格式的信息，请参阅 <xref href="http://www.adobe.com/go/learn_fms_fileformats_cn" scope="external" class="- topic/xref ">www.adobe.com/go/learn_fms_fileformats_cn</xref>。

 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">onCuePoint</codeph> 实际上是 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 对象的属性。该属性之所以在 Events 一节中列出，因为它在流媒体使用 Flash Media Server 时或在 FLV 文件播放过程中响应数据事件。有关详细信息，请参阅 NetStream 类的描述。不能使用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 方法或任何其他 EventDispatcher 方法将 <codeph class="+ topic/ph pr-d/codeph ">onCuePoint</codeph> 作为事件进行侦听或处理。定义一个回调函数并将其附加到下列对象之一：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">NetStream 实例的 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性所引用的对象。</li><li class="- topic/li ">NetStream 子类的一个实例。NetStream 是一个密封类，即无法在运行时将属性或方法添加到 NetStream 对象。创建 NetStream 的子类并在其中定义您的事件处理函数。您还可以将该子类变为动态的并对子类的实例添加事件处理函数。</li></ul>
 
 <p class="- topic/p ">关联的事件侦听器在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法之后、在视频播放头前进之前触发。</p>
 
 <p class="- topic/p ">您可以在视频文件中嵌入下列类型的提示点：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">导航提示点，它指定视频文件中的一个关键帧，而且其 <codeph class="+ topic/ph pr-d/codeph ">time</codeph> 属性对应于该关键帧。导航提示点经常被用作书签或入口点，以便用户在视频文件中导航。</li><li class="- topic/li ">一个事件提示点指定一个时间。此时间可能与某个特定的关键帧对应，也可能不对应。事件提示点通常代表视频中的某个时间，到达这个时间时可用于触发其他应用程序事件的情况就会发生。</li></ul>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">onCuePoint</codeph> 事件对象具有以下属性：</p>
 
 <adobetable class="innertable"><tgroup cols="2" class="- topic/tgroup "><thead class="- topic/thead "><row class="- topic/row "><entry class="- topic/entry ">属性</entry><entry class="- topic/entry ">说明</entry></row></thead><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">name</codeph></entry><entry class="- topic/entry ">将提示点嵌入视频文件时为其指定的名称。</entry></row><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">parameters</codeph></entry><entry class="- topic/entry ">为此提示点指定的一个由名称和值对字符串组成的关联数组。任何有效的字符串都可用于参数名或参数值。</entry></row><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">time</codeph></entry><entry class="- topic/entry ">提示点在视频文件播放期间的出现时间（以秒为单位）。</entry></row><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">type</codeph></entry><entry class="- topic/entry ">到达的提示点的类型：导航提示点或事件提示点。</entry></row></tbody></tgroup></adobetable>
 
 <p class="- topic/p ">在首次对视频文件进行编码时，或者在 Flash 创作工具中使用“视频导入”向导导入视频剪辑时，您可以在该视频文件中定义提示点。</p>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 事件还会在视频文件中检索有关提示点的信息。不过，<codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 事件会在视频开始播放之前，获取有关所有提示点的信息。<codeph class="+ topic/ph pr-d/codeph ">onCuePoint</codeph> 事件会在播放期间对某个提示点所指定的时间，接收有关该提示点的信息。</p>
 
 <p class="- topic/p ">通常，要让代码在特定的提示点出现时对它给予响应，请使用 <codeph class="+ topic/ph pr-d/codeph ">onCuePoint</codeph> 事件来触发代码中的某个操作。</p>
 
 <p class="- topic/p ">您可以使用提供给 <codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 事件的提示点列表，允许用户在视频流的预定义点处开始播放视频。将提示点的 <codeph class="+ topic/ph pr-d/codeph ">time</codeph> 属性的值传递给 <codeph class="+ topic/ph pr-d/codeph ">NetStream.seek()</codeph> 方法，以便从该提示点播放视频。</p>
 
 </apiDesc><example conref="examples\NetStream_onCuePoint.as" class="- topic/example "> 以下示例说明如何加载外部 FLV 文件并响应元数据和提示点。<xref href="http://actionscriptexamples.com/2008/02/26/loading-flv-files-in-actionscript-30-using-the-netconnection-and-netstream-classes/" scope="_mmexternal" class="- topic/xref ">ActionScriptExamples.com</xref> 提供的示例。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var video:Video = new Video();
addChild(video);
 
var nc:NetConnection = new NetConnection();
nc.connect(null);
 
var ns:NetStream = new NetStream(nc);
ns.client = {};
ns.client.onMetaData = ns_onMetaData;
ns.client.onCuePoint = ns_onCuePoint;
ns.play("http://www.helpexamples.com/flash/video/cuepoints.flv");
 
video.attachNetStream(ns);
 
function ns_onMetaData(item:Object):void {
    trace("metaData");
    // Resize video instance.
    video.width = item.width;
    video.height = item.height;
    // Center video instance on Stage.
    video.x = (stage.stageWidth - video.width) / 2;
    video.y = (stage.stageHeight - video.height) / 2;
}
 
function ns_onCuePoint(item:Object):void {
    trace("cuePoint");
    trace(item.name + "\t" + item.time);
}
</codeblock></example></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/client" class="- topic/link "><linktext class="- topic/linktext ">client</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData" class="- topic/link "><linktext class="- topic/linktext ">onMetaData</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onTextData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">onTextData</apiName><shortdesc class="- topic/shortdesc ">
  在 Flash Player 接收到正在播放的媒体文件中嵌入的文本数据时建立侦听器进行响应。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9.0.115.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier "/><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  在 Flash Player 接收到正在播放的媒体文件中嵌入的文本数据时建立侦听器进行响应。文本数据采用 UTF-8 格式并可以包含有关基于 3GP Timed Text 规范的格式设置的信息。
  <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">onTextData</codeph> 实际上是 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 对象的属性。该属性之所以在 Events 一节中列出，因为它在流媒体使用 Flash Media Server 时或在 FLV 文件播放过程中响应数据事件。有关详细信息，请参阅 NetStream 类的描述。不能使用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 方法或任何其他 EventDispatcher 方法将 <codeph class="+ topic/ph pr-d/codeph ">onTextData</codeph> 作为事件进行侦听或处理。定义一个回调函数并将其附加到下列对象之一：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">NetStream 实例的 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性所引用的对象。</li><li class="- topic/li ">NetStream 子类的一个实例。NetStream 是一个密封类，即无法在运行时将属性或方法添加到 NetStream 对象。创建 NetStream 的子类并在其中定义您的事件处理函数。您还可以将该子类变为动态的并对子类的实例添加事件处理函数。</li></ul>
 
 <p class="- topic/p ">关联的事件侦听器在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法之后、在视频播放头前进之前触发。</p>
  
  <p class="- topic/p ">onTextData 事件对象对每段文本数据包含一个属性。</p>
  
  </apiDesc><example conref="examples\OnTextDataExample.as" class="- topic/example "> 本示例中的代码使用 <codeph class="+ topic/ph pr-d/codeph ">Netstream.client</codeph> 属性来处理 <codeph class="+ topic/ph pr-d/codeph ">onTextData</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">onImageData</codeph> 的回调函数。<codeph class="+ topic/ph pr-d/codeph ">onImageDataHandler()</codeph> 函数使用 onImageData 事件对象 <codeph class="+ topic/ph pr-d/codeph ">imageData</codeph> 来存储该字节数组。而 <codeph class="+ topic/ph pr-d/codeph ">onTextDataHandler()</codeph> 函数使用 onTextData 事件对象 <codeph class="+ topic/ph pr-d/codeph ">textData</codeph> 来存储各段文本数据（每段数据都是 <codeph class="+ topic/ph pr-d/codeph ">textData</codeph> 对象的一个属性）。
 <p class="- topic/p ">您需要在代码中用位置 <codeph class="+ topic/ph pr-d/codeph ">"yourURL"</codeph> 的文本或图像元数据替换媒体文件的实际位置。</p>
 <p class="- topic/p "> 您也可以使用自定义类处理图像和文本数据。有关详细信息和示例，请参阅文章 <xref href="http://www.adobe.com/devnet/flash/quickstart" scope="external" class="- topic/xref ">Handling metadata and cue points in Flash video</xref>（处理 Flash 视频中的元数据和提示点）。</p>
 <codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#NetConnection" class="- topic/link "><linktext class="- topic/linktext ">NetConnection</linktext></link><link href="flash.net.xml#NetStream/client" class="- topic/link "><linktext class="- topic/linktext ">client</linktext></link><link href="flash.net.xml#NetStream/event:asyncError" class="- topic/link "><linktext class="- topic/linktext ">asyncError</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.net.xml#NetStream/event:onImageData" class="- topic/link "><linktext class="- topic/linktext ">onImageData</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onImageData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">onImageData</apiName><shortdesc class="- topic/shortdesc ">
 在 Flash Player 以字节数组形式接收到正在播放的媒体文件中嵌入的图像数据时建立侦听器进行响应。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9.0.115.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier "/><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 Flash Player 以字节数组形式接收到正在播放的媒体文件中嵌入的图像数据时建立侦听器进行响应。图像数据可以生成 JPEG、PNG 或 GIF 内容。使用 <codeph class="+ topic/ph pr-d/codeph ">flash.display.Loader.loadBytes()</codeph> 方法可以将该字节数组加载到显示对象中。
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">onImageData</codeph> 实际上是 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 对象的属性。该属性之所以在 Events 一节中列出，因为它在流媒体使用 Flash Media Server 时或在 FLV 文件播放过程中响应数据事件。有关详细信息，请参阅 NetStream 类的描述。不能使用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 方法或任何其他 EventDispatcher 方法侦听或处理 <codeph class="+ topic/ph pr-d/codeph ">onImageData</codeph> 事件。定义一个回调函数并将其附加到下列对象之一：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">NetStream 实例的 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性所引用的对象。</li><li class="- topic/li ">NetStream 子类的一个实例。NetStream 是一个密封类，即无法在运行时将属性或方法添加到 NetStream 对象。创建 NetStream 的子类并在其中定义您的事件处理函数。您还可以将该子类变为动态的并对子类的实例添加事件处理函数。</li></ul>
 
 <p class="- topic/p ">关联的事件侦听器在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法之后、在视频播放头前进之前触发。</p>
 
 <p class="- topic/p ">onImageData 事件对象包含通过 AMF0 数据通道以字节数组形式发送的图像数据。</p>
 
 </apiDesc><example conref="examples\OnTextDataExample.as" class="- topic/example "> 本示例中的代码使用 <codeph class="+ topic/ph pr-d/codeph ">Netstream.client</codeph> 属性来处理 <codeph class="+ topic/ph pr-d/codeph ">onTextData</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">onImageData</codeph> 的回调函数。<codeph class="+ topic/ph pr-d/codeph ">onImageDataHandler()</codeph> 函数使用 onImageData 事件对象 <codeph class="+ topic/ph pr-d/codeph ">imageData</codeph> 来存储该字节数组。而 <codeph class="+ topic/ph pr-d/codeph ">onTextDataHandler()</codeph> 函数使用 onTextData 事件对象 <codeph class="+ topic/ph pr-d/codeph ">textData</codeph> 来存储各段文本数据（每段数据都是 <codeph class="+ topic/ph pr-d/codeph ">textData</codeph> 对象的一个属性）。
 <p class="- topic/p ">您需要在代码中用位置 <codeph class="+ topic/ph pr-d/codeph ">"yourURL"</codeph> 的文本或图像元数据替换媒体文件的实际位置。</p>
 <p class="- topic/p "> 您也可以使用自定义类处理图像和文本数据。有关详细信息和示例，请参阅文章 <xref href="http://www.adobe.com/devnet/flash/quickstart" scope="external" class="- topic/xref ">Handling metadata and cue points in Flash video</xref>（处理 Flash 视频中的元数据和提示点）。</p>
 <codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#NetConnection" class="- topic/link "><linktext class="- topic/linktext ">NetConnection</linktext></link><link href="flash.display.xml#Loader/loadBytes()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Loader.loadBytes()</linktext></link><link href="flash.net.xml#NetStream/client" class="- topic/link "><linktext class="- topic/linktext ">client</linktext></link><link href="flash.net.xml#NetStream/event:asyncError" class="- topic/link "><linktext class="- topic/linktext ">asyncError</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.net.xml#NetStream/event:onTextData" class="- topic/link "><linktext class="- topic/linktext ">onTextData</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onMetaData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">onMetaData</apiName><shortdesc class="- topic/shortdesc ">
 在 Flash Player 接收到正在播放的视频中嵌入的描述性信息时建立侦听器进行响应。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier "/><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 Flash Player 接收到正在播放的视频中嵌入的描述性信息时建立侦听器进行响应。有关 Flash Media Server 支持的视频文件格式的信息，请参阅 <xref href="http://www.adobe.com/go/learn_fms_fileformats_cn" scope="external" class="- topic/xref ">www.adobe.com/go/learn_fms_fileformats_cn</xref>。
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 实际上是 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 对象的属性。该属性之所以在 Events 一节中列出，因为它在流媒体使用 Flash Media Server 时或在 FLV 文件播放过程中响应数据事件。有关详细信息，请参阅 NetStream 类的描述以及 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 属性。不能使用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 方法或任何其他 EventDispatcher 方法侦听或处理 <codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 事件。定义一个回调函数并将其附加到下列对象之一：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">NetStream 实例的 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性所引用的对象。</li><li class="- topic/li ">NetStream 子类的一个实例。NetStream 是一个密封类，即无法在运行时将属性或方法添加到 NetStream 对象。您可以创建 NetStream 的子类并在其中定义您的事件处理函数。您还可以将该子类变为动态的并对子类的实例添加事件处理函数。</li></ul>
 
 <p class="- topic/p ">Flash Video Exporter 实用程序（1.1 版本或更高版本）将视频的持续时间、创建日期、数据速率及其他信息嵌入视频文件本身。不同的视频编码器嵌入不同的元数据组中。</p>
 
 <p class="- topic/p ">关联的事件侦听器在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法之后、在视频播放头前进之前触发。</p>
 
 <p class="- topic/p ">在多数情况下，流元数据中嵌入的持续时间值接近于实际持续时间，但并不精确。换言之，当播放头在视频流的结尾处时，此值不会始终与 <codeph class="+ topic/ph pr-d/codeph ">NetStream.time</codeph> 属性的值相匹配。</p>
 <p class="- topic/p ">传递到 onMetaData 事件处理函数的事件对象包含每段数据的一个属性。</p>
 
 </apiDesc><example conref="examples\NetStream_onCuePoint.as" class="- topic/example "> 以下示例说明如何加载外部 FLV 文件并响应元数据和提示点。<xref href="http://actionscriptexamples.com/2008/02/26/loading-flv-files-in-actionscript-30-using-the-netconnection-and-netstream-classes/" scope="_mmexternal" class="- topic/xref ">ActionScriptExamples.com</xref> 提供的示例。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var video:Video = new Video();
addChild(video);
 
var nc:NetConnection = new NetConnection();
nc.connect(null);
 
var ns:NetStream = new NetStream(nc);
ns.client = {};
ns.client.onMetaData = ns_onMetaData;
ns.client.onCuePoint = ns_onCuePoint;
ns.play("http://www.helpexamples.com/flash/video/cuepoints.flv");
 
video.attachNetStream(ns);
 
function ns_onMetaData(item:Object):void {
    trace("metaData");
    // Resize video instance.
    video.width = item.width;
    video.height = item.height;
    // Center video instance on Stage.
    video.x = (stage.stageWidth - video.width) / 2;
    video.y = (stage.stageHeight - video.height) / 2;
}
 
function ns_onCuePoint(item:Object):void {
    trace("cuePoint");
    trace(item.name + "\t" + item.time);
}
</codeblock></example></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection" class="- topic/link "><linktext class="- topic/linktext ">NetConnection</linktext></link><link href="flash.net.xml#NetStream/client" class="- topic/link "><linktext class="- topic/linktext ">client</linktext></link><link href="flash.net.xml#NetStream/event:asyncError" class="- topic/link "><linktext class="- topic/linktext ">asyncError</linktext></link><link href="flash.net.xml#NetStream/event:onCuePoint" class="- topic/link "><linktext class="- topic/linktext ">onCuePoint</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.net.xml#NetStream/time" class="- topic/link "><linktext class="- topic/linktext ">time</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream__onXMPData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">onXMPData</apiName><shortdesc class="- topic/shortdesc ">
 建立一个侦听器，以便在 Flash Player 接收到特定于正在播放的视频中嵌入的 Adobe 可扩展元数据平台 (XMP) 的信息时进行响应。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier "/><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 建立一个侦听器，以便在 Flash Player 接收到特定于正在播放的视频中嵌入的 Adobe 可扩展元数据平台 (XMP) 的信息时进行响应。有关 Flash Media Server 支持的视频文件格式的信息，请参阅 <xref href="http://www.adobe.com/go/learn_fms_fileformats_cn" scope="external" class="- topic/xref ">www.adobe.com/go/learn_fms_fileformats_cn</xref>。
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">onXMPData</codeph> 实际上是 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 对象的属性。该属性之所以在 Events 一节中列出，因为它在流媒体使用 Flash Media Server 时或在 FLV 文件播放过程中响应数据事件。有关详细信息，请参阅 NetStream 类的描述以及 <codeph class="+ topic/ph pr-d/codeph ">NetStream.client</codeph> 属性。不能使用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 方法或任何其他 EventDispatcher 方法侦听或处理 <codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 事件。定义一个回调函数并将其附加到下列对象之一：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">NetStream 实例的 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性所引用的对象。</li><li class="- topic/li ">NetStream 子类的一个实例。NetStream 是一个密封类，即无法在运行时将属性或方法添加到 NetStream 对象。然而，您可以创建 NetStream 的子类并在其中定义您的事件处理函数。您还可以将该子类变为动态的并对子类的实例添加事件处理函数。</li></ul>
 
 <p class="- topic/p ">关联的事件侦听器在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法之后、在视频播放头前进之前触发。</p>
 
 <p class="- topic/p ">传递给 <codeph class="+ topic/ph pr-d/codeph ">onXMPData()</codeph> 事件处理函数的对象包含一个 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性，此属性是一个字符串。此字符串在顶级 UUID 框中生成。（顶级框的 128 位 UUID 为 <codeph class="+ topic/ph pr-d/codeph ">BE7ACFCB-97A9-42E8-9C71-999491E3AFAC</codeph>。）此顶级 UUID 框正好包含一个 XML 文档，该文档以 null 结尾的 UTF-8 字符串形式表示。</p>
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection</linktext></link><link href="flash.net.xml#NetStream/client" class="- topic/link "><linktext class="- topic/linktext ">client</linktext></link><link href="flash.net.xml#NetStream/event:asyncError" class="- topic/link "><linktext class="- topic/linktext ">asyncError</linktext></link><link href="flash.net.xml#NetStream/event:onCuePoint" class="- topic/link "><linktext class="- topic/linktext ">onCuePoint</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.net.xml#NetStream/time" class="- topic/link "><linktext class="- topic/linktext ">time</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.NetStatusEvent.NET_STATUS_netStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">netStatus</apiName><shortdesc class="- topic/shortdesc ">
 在 NetStream 对象报告其状态或错误条件时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.NetStatusEvent.NET_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.NetStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 NetStream 对象报告其状态或错误条件时调度。<codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件包含一个 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 属性，该属性是一个包含有关事件特定信息（例如连接尝试成功还是失败）的信息对象。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.events.xml#NetStatusEvent/info" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.IOErrorEvent.IO_ERROR_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><shortdesc class="- topic/shortdesc ">
 在出现输入或输出错误并导致网络操作失败时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在出现输入或输出错误并导致网络操作失败时调度。
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.AsyncErrorEvent.ASYNC_ERROR_asyncError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">asyncError</apiName><shortdesc class="- topic/shortdesc ">
 在异步引发异常（即来自本机异步代码）时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.AsyncErrorEvent.ASYNC_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.AsyncErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在异步引发异常（即来自本机异步代码）时调度。当服务器调用客户端上未定义的方法时调度此事件。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/event:onPlayStatus" class="- topic/link "><linktext class="- topic/linktext ">onPlayStatus</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData" class="- topic/link "><linktext class="- topic/linktext ">onMetaData</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetStream_flash.events.StatusEvent.STATUS_status" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">status</apiName><shortdesc class="- topic/shortdesc ">
 在应用程序尝试通过调用 NetStream.play() 方法播放用数字权限管理 (DRM) 加密的内容时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.StatusEvent.STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.StatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在应用程序尝试通过调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法播放用数字权限管理 (DRM) 加密的内容时调度。状态代码属性的值将为<codeph class="+ topic/ph pr-d/codeph ">“DRM.encryptedFLV”</codeph>。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link></related-links></adobeApiEvent><apiConstructor id="flash.net:NetStream:NetStream" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">NetStream</apiName><shortdesc class="- topic/shortdesc ">
     创建可以用来通过 NetConnection 对象播放媒体文件和发送数据的流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream, constructor
     
      </keyword></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">未连接 NetConnection 实例。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">connection</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:NetConnection</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 NetConnection 对象。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">peerID</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">connectToFMS</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">此可选参数在 Flash Player 10 和更高版本中可用，与 RTMFP 连接配合使用。（如果 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.protocol</codeph> 属性的值不是<codeph class="+ topic/ph pr-d/codeph ">“rtmfp”</codeph>，则忽略此参数。）使用下列值之一：
     
     <ul class="- topic/ul "><li class="- topic/li ">要连接到 Flash Media Server，请指定 <codeph class="+ topic/ph pr-d/codeph ">NetStream.CONNECT_TO_FMS</codeph>。 </li><li class="- topic/li ">要向同级直接发布，请指定 <codeph class="+ topic/ph pr-d/codeph ">NetStream.DIRECT_CONNECTIONS</codeph>。</li><li class="- topic/li ">若要从特定同级直接播放，请指定该同级的标识（请参阅 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.nearID</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">NetStream.farID</codeph>）。</li><li class="- topic/li ">（Flash Player 10.1 或 AIR 2 或更高版本）要在对等多播组中发布或播放，请指定 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 字符串（请参阅 GroupSpecifier 类）。</li></ul>
     
     <p class="- topic/p ">大多数情况下，<codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 有可能使用本地系统上的网络上行链路。在这种情况下，要求用户具有使用计算机的网络资源的权限。如果用户允许此种使用，则将 <codeph class="+ topic/ph pr-d/codeph ">NetStream.Connect.Success </codeph> NetStatusEvent 发送到 NetConnection 的事件侦听器。如果用户拒绝允许此种使用，则发送 <codeph class="+ topic/ph pr-d/codeph ">NetStream.Connect.Rejected</codeph> 事件。当指定 <codeph class="+ topic/ph pr-d/codeph ">groupspec</codeph> 时，在接收 <codeph class="+ topic/ph pr-d/codeph ">NetStream.Connect.Success</codeph> 事件之前，使用 NetStream 对象的任何方法都会出错，并将引发异常。</p>
     
     
     <p class="- topic/p ">如果您将此参数包含在构造函数语句中，但传递 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 值，则此值将设置为 <codeph class="+ topic/ph pr-d/codeph ">"connectToFMS"</codeph>。</p>
     
     </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建可以用来通过 NetConnection 对象播放媒体文件和发送数据的流。
     
     </apiDesc><example conref="examples\NetStreamExample_constructor.as" class="- topic/example "> 以下代码演示一个用于渐进式下载和显示分配给变量 <codeph class="+ topic/ph pr-d/codeph ">videoURL</codeph> 的视频的连接：
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" class="- topic/example "> 以下代码演示一个用于流式处理和显示 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 命令中指定的远程 Flash Media Server 实例上的视频（为变量 <codeph class="+ topic/ph pr-d/codeph ">videoURL</codeph> 分配的视频）的连接：
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#NetStream/CONNECT_TO_FMS" class="- topic/link "><linktext class="- topic/linktext ">CONNECT_TO_FMS</linktext></link><link href="flash.net.xml#NetStream/DIRECT_CONNECTIONS" class="- topic/link "><linktext class="- topic/linktext ">DIRECT_CONNECTIONS</linktext></link><link href="flash.net.xml#NetStream/farID" class="- topic/link "><linktext class="- topic/linktext ">farID</linktext></link><link href="flash.media.xml#Video/attachCamera()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Video.attachCamera()</linktext></link><link href="flash.net.xml#GroupSpecifier" class="- topic/link "><linktext class="- topic/linktext ">flash.net.GroupSpecifier</linktext></link><link href="flash.net.xml#GroupSpecifier/groupspecWithAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.GroupSpecifier.groupspecWithAuthorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/groupspecWithoutAuthorizations()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.GroupSpecifier.groupspecWithoutAuthorizations()</linktext></link><link href="flash.net.xml#GroupSpecifier/multicastEnabled" class="- topic/link "><linktext class="- topic/linktext ">flash.net.GroupSpecifier.multicastEnabled</linktext></link><link href="flash.net.xml#NetConnection" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection</linktext></link><link href="flash.net.xml#NetConnection/nearID" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection.nearID</linktext></link><link href="flash.net.xml#NetConnection/protocol" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection.protocol</linktext></link><link href="flash.net.xml#NetGroup" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetStream_Connect_Rejected" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code=“NetStream.Connect.Rejected”</linktext></link><link href="flash.events.xml#NetStatusEvent/code_NetStream_Connect_Success" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info.code=“NetStream.Connect.Success”</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:NetStream:appendBytesAction" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">appendBytesAction</apiName><shortdesc class="- topic/shortdesc ">
     表示时间刻度不连续，请刷新 FIFO，告知字节分析程序需要分析文件标头或 FLV 标签的开头。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">netStreamAppendBytesAction</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示时间刻度不连续，请刷新 FIFO，告知字节分析程序需要分析文件标头或 FLV 标签的开头。
     
     <p class="- topic/p ">
     调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.seek()</codeph> 以刷新 NetStream 缓冲。在您调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytesAction()</codeph> 并传递 <codeph class="+ topic/ph pr-d/codeph ">RESET_BEGIN</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">RESET_SEEK</codeph> 参数之前，字节分析程序保持为刷新模式。捕获 <codeph class="+ topic/ph pr-d/codeph ">"NetStream.Seek.Notify"</codeph> 事件，以便在搜索之后调用 <codeph class="+ topic/ph pr-d/codeph ">appendByte Action()</codeph>。新的文件标头可以支持播放列表，并且无需调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.seek()</codeph> 即可进行搜索。
     </p>
     
     <p class="- topic/p ">
     您还可以调用此方法为 <codeph class="+ topic/ph pr-d/codeph ">onSeekPoint()</codeph>) 回调重置字节计数器。
     </p>
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/appendBytes()" class="- topic/link "><linktext class="- topic/linktext ">appendBytes()</linktext></link><link href="flash.net.xml#NetStream/seek()" class="- topic/link "><linktext class="- topic/linktext ">seek()</linktext></link><link href="flash.net.xml#NetStreamAppendBytesAction" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStreamAppendBytesAction</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:appendBytes" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">appendBytes</apiName><shortdesc class="- topic/shortdesc ">
     将一个 ByteArray 传递到 NetStream 以进行播放。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">bytes</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.utils:ByteArray</apiOperationClassifier></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将一个 ByteArray 传递到 NetStream 以进行播放。对处于“数据生成模式”的 NetStream 调用此方法。要使 NetStream 处于数据生成模式，请对在已连接到 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 的 NetConnection 上创建的 NetStream 调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play(null)</codeph>。对未处于数据生成模式下的 NetStream 调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 会出错并引发异常。
     
     <p class="- topic/p ">
     字节分析程序通过标头识别 FLV 文件。分析该标头后，<codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 要求将来的所有调用都继续使用同一个真实文件或虚拟文件。除非调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN)</codeph>，否则不需要分析其他标头。
     </p>
     
     <p class="- topic/p ">
     NetStream 对象具有两个缓冲区：从 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 到 NetStream 的 FIFO 和播放缓冲区。FIFO 是部分 FLV 标签重组缓冲区，包含的不完整 FLV 标签不超过一个。调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.seek()</codeph> 以刷新两个缓冲区。调用 <codeph class="+ topic/ph pr-d/codeph ">seek()</codeph> 之后，调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytesAction()</codeph> 将时间刻度重置为从下一个追加消息的时间戳开始。
     </p>
     
     <p class="- topic/p ">
     对 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 的每次调用都会向 FIFO 添加字节，直到 FLV 标签完整。FLV 标签完整后会移到播放缓冲区。对 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 的调用可以写入多个 FLV 标签。第一批字节完成一个现有 FLV 标签（该标签会移到播放缓冲区中）。完整的 FLV 标签会移到播放缓冲区中。未组成完整 FLV 标签的剩余字节将进入 FIFO。调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 可使 FIFO 中的字节完整，也可以使用 <codeph class="+ topic/ph pr-d/codeph ">RESET_SEEK</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">RESET_BEGIN</codeph> 参数调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytesAction()</codeph> 来刷新 FIFO 中的字节。
     </p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在对 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 执行后续调用之前，字节分析程序可能无法完整地解码对 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 的调用。 </p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/appendBytesAction()" class="- topic/link "><linktext class="- topic/linktext ">appendBytesAction()</linktext></link><link href="flash.net.xml#NetStream/seek()" class="- topic/link "><linktext class="- topic/linktext ">seek()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:attachAudio" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">attachAudio</apiName><shortdesc class="- topic/shortdesc ">
     将音频流从作为源传递的 Microphone 对象附加到 NetStream 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiDefaultValue>"null"
     </apiDefaultValue><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">microphone</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:Microphone</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要传输的音频流的源。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将音频流从作为源传递的 Microphone 对象附加到 NetStream 对象。此方法仅供指定的流的发布者使用。
     
     <p class="- topic/p ">使用此方法和 Flash Media Server 可以将实时音频发送到服务器。请在调用 <codeph class="+ topic/ph pr-d/codeph ">publish()</codeph> 方法之前或之后调用此方法。
     </p>
     
     <p class="- topic/p ">设置 <codeph class="+ topic/ph pr-d/codeph ">Microphone.rate</codeph> 属性以匹配声音捕获设备的速率。调用 <codeph class="+ topic/ph pr-d/codeph ">setSilenceLevel()</codeph> 以设置静默级别阈值。要控制音频流的声音属性（音量和声像调节），请使用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.soundTransform</codeph> 属性。</p>
     
     <pre xml:space="preserve" class="- topic/pre ">
     var nc:NetConnection = new NetConnection();
     nc.connect("rtmp://server.domain.com/app");
     var ns:NetStream = new NetStream(nc);
     
     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;
     
     ns.attachAudio(live_mic);
     ns.publish("mic_stream","live")
     </pre>
     
     <p class="- topic/p "> 要听到声音，请调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法，然后调用 <codeph class="+ topic/ph pr-d/codeph ">DisplayObjectContainer.addChild()</codeph> 将音频路由到显示列表上的某个对象。
     </p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.media.xml#Microphone" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone</linktext></link><link href="flash.display.xml#DisplayObjectContainer/addChild()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObjectContainer.addChild()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:attachCamera" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">attachCamera</apiName><shortdesc class="- topic/shortdesc ">
     开始从摄像头捕获视频，如果将 theCamera 设置为 null，则会停止捕获操作。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">theCamera</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:Camera</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">视频传输的源。有效值为一个 Camera 对象（可开始捕获视频）和 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。如果传递 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，应用程序将停止捕获视频，并忽略发送的其他任何参数。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">snapshotMilliseconds</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">-1</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定视频流是连续、单帧，还是用于创建延时拍摄的一系列单帧。
     
     <ul class="- topic/ul "><li class="- topic/li ">如果省略此参数，应用程序将捕获所有视频，直到将 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 值传递给 <codeph class="+ topic/ph pr-d/codeph ">attachCamera</codeph>。</li><li class="- topic/li ">如果传递 0，应用程序将仅捕获一个视频帧。使用此值可传输先前流中的“快照”。<ph class="- topic/ph ">Flash Player 或</ph>AIR 会将无效参数、负参数或非数字参数均解释为 0。</li><li class="- topic/li ">如果传递了正数值，应用程序将捕获单个视频帧，然后将指定长度的停顿作为片尾追加到快照上。使用此值可实现延时拍摄效果。</li></ul>
     
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     开始从摄像头捕获视频，如果将 <codeph class="+ topic/ph pr-d/codeph ">theCamera</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则会停止捕获操作。此方法仅供指定的流的发布者使用。
     
     <p class="- topic/p ">此方法用于 Flash Media Server；有关详细信息，请参阅类说明。</p>
     
     <p class="- topic/p "> 在附加了视频源后，必须调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.publish()</codeph> 才能开始传输。希望显示视频的订户必须调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">Video.attachCamera()</codeph> 方法，才能在舞台上显示视频。</p>
     
     <p class="- topic/p ">可以使用 <codeph class="+ topic/ph pr-d/codeph ">snapshotMilliseconds</codeph> 并通过提供一个正数值，将指定毫秒数的尾片添加到视频输入信号中的方式来发送单个快照（通过提供值 0）或一系列快照（实际上是延时拍摄镜头）。尾片延长了视频消息的显示时间。通过对 <codeph class="+ topic/ph pr-d/codeph ">snapshotMilliseconds</codeph> 使用正数值来重复调用 <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph>，交替快照和尾片的序列将创建延时拍摄镜头。例如，可以每天捕获一个帧，将其追加到视频文件上。当订阅者播放该文件时，每个帧都会在屏幕上显示指定的毫秒数，然后才会显示下一个帧。</p>
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">snapshotMilliseconds</codeph> 参数的用途不同于可通过 <codeph class="+ topic/ph pr-d/codeph ">Camera.setMode()</codeph> 设置的 <codeph class="+ topic/ph pr-d/codeph ">fps</codeph> 参数。在指定 <codeph class="+ topic/ph pr-d/codeph ">snapshotMilliseconds</codeph> 时，您可以控制录制的帧之间的时间间隔。在使用 <codeph class="+ topic/ph pr-d/codeph ">Camera.setMode()</codeph> 指定 <codeph class="+ topic/ph pr-d/codeph ">fps</codeph> 时，您在控制录制和播放多长时间。</p>
     
     <p class="- topic/p ">例如，假设您想每隔 5 分钟取一个快照，一共要取 100 个快照。您可以通过以下两种方式来实现：</p>
     
     <ul class="- topic/ul "><li class="- topic/li ">您可以每隔 5 分钟发出一个 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachCamera(myCamera, 500)</codeph> 命令，重复执行 100 次。整个录制过程将需要 500 分钟，但是产生的文件将在 50 秒内完成播放（100 个帧，帧与帧之间的时间间隔为 500 毫秒）。</li><li class="- topic/li ">您可以发出一个 <codeph class="+ topic/ph pr-d/codeph ">fps</codeph> 值为 1/300（每 300 秒一次，即每 5 分钟一次）的 <codeph class="+ topic/ph pr-d/codeph ">Camera.setMode()</codeph> 命令，然后发出一个 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachCamera(source)</codeph> 命令，使摄像头连续捕捉 500 分钟的图像。产生的文件将在 500 分钟内完成播放，这与录制的时间长度相同，每个帧显示 5 分钟。</li></ul>

     <p class="- topic/p ">这两种方法都同样捕获了 500 个帧，并且都很有用；具体采用何种方法，主要取决于对播放的要求。例如，在第二种情况中，可以是整段时间一直在录制音频。另外，两个文件的大小也相近。</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetStream:attach" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">attach</apiName><shortdesc class="- topic/shortdesc ">
    将流附加到新 NetConnection 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>uncomment the following line after offset is added to the file
    </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">connection</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:NetConnection</apiOperationClassifier></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    将流附加到新 NetConnection 对象。在连接断开并且已重新连接后，调用此方法可将 NetStream 附加到新的 NetConnection 对象。当连接断开时，Flash Player 和 AIR 继续从播放点流式播放。您也可以使用此方法实现负载平衡。
    
    <p class="- topic/p ">此方法要求使用 Flash Media Server 3.5.3 版或更高版本。</p>
    
    <p class="- topic/p ">要使用此方法实现<b class="+ topic/ph hi-d/b ">流重新连接</b>，请参阅 <xref href="http://www.adobe.com/go/learn_fms_docs_cn" scope="external" class="- topic/xref ">Flash Media Server 3.5.3 文档</xref>。</p>
    
    <p class="- topic/p "> 要使用此方法实现<b class="+ topic/ph hi-d/b ">负载平衡</b>，请执行下列操作： </p>
    
    <ol class="- topic/ol "><li class="- topic/li "> 将已连接的流附加到另一服务器上的 NetConnection 对象。 </li><li class="- topic/li ">将流成功附加到新连接后，调用以前连接上的 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.close()</codeph> 以防止出现数据泄露。</li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 并设置 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayOptions.transition</codeph> 的值以执行恢复。将其余的 NetStreamPlayOptions 属性设置为最初调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 时使用的值以启动流。</li></ol>
    
    
    </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">play2()</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/transition" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions.transition</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     停止播放流上的所有数据，将 time 属性设置为 0，并使该流可用于其他用途。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.close, close
     </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     停止播放流上的所有数据，将 <codeph class="+ topic/ph pr-d/codeph ">time</codeph> 属性设置为 0，并使该流可用于其他用途。此方法还会删除通过 HTTP 下载的视频文件的本地副本。虽然应用程序会删除它所创建的文件的本地副本，但可能会在缓存目录中永久保留一个副本。如果必须完全禁止缓存视频文件或在本地进行存储，请使用 Flash Media Server。
     
     <p class="- topic/p ">
     如果使用 Flash Media Server，则在从发布流中调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 或从订阅流中调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.publish()</codeph> 时，将隐式地调用此方法。请注意：
     </p>
     
     <ul class="- topic/ul "><li class="- topic/li ">
     如果从发布流中调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph>，该流将停止发布，发布者现在可以将该流用于其他用途。订阅者不再接收在该流中发布的任何内容，因为该流已停止发布。
     </li><li class="- topic/li ">
     如果从订阅流中调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph>，该流将停止为订阅者播放，订阅者现在可以将该流用于其他用途。其他订阅者不受影响。
     </li><li class="- topic/li ">
     您可以让订阅流停止播放，而无需使用 <codeph class="+ topic/ph pr-d/codeph ">flash.net.NetStream.play(false)</codeph> 关闭该流或更改流类型。
     </li></ul>
     
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/pause()" class="- topic/link "><linktext class="- topic/linktext ">pause()</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.net.xml#NetStream/publish()" class="- topic/link "><linktext class="- topic/linktext ">publish()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:onPeerConnect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">onPeerConnect</apiName><shortdesc class="- topic/shortdesc ">
     
     每当一个同级发布流与一个同级订阅流相匹配时即调用。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">subscriber</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:NetStream</apiOperationClassifier></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
     每当一个同级发布流与一个同级订阅流相匹配时即调用。在订户连接到发行者之前，调用此方法以允许 ActionScript 代码细化同级对同级发布的访问控制。以下代码显示一个如何创建此方法的回调函数的示例：
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/p ">如果同级发行者不实现此方法，则允许所有同级播放已发布的任何内容。</p>
     
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetStream:pause" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">pause</apiName><shortdesc class="- topic/shortdesc ">
     暂停视频流的播放。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.pause, pause
     
     </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     暂停视频流的播放。如果视频已经暂停，则调用此方法将不会执行任何操作。要在暂时视频后恢复播放，请调用 <codeph class="+ topic/ph pr-d/codeph ">resume()</codeph>。要在暂停和播放之间切换（先暂停视频，然后恢复），请调用 <codeph class="+ topic/ph pr-d/codeph ">togglePause()</codeph>。
     
     <p class="- topic/p ">从 Flash Player 9.0.115.0 开始，在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.pause()</codeph> 时，Flash Player 不再清除缓冲区。此行为称为“智能暂停”。在 Flash Player 9.0.115.0 之前，恢复播放之前 Flash Player 将等待缓冲区填满，这通常会导致延迟。 </p>
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>针对向后兼容，<codeph class="+ topic/ph pr-d/codeph ">"NetStream.Buffer.Flush"</codeph> 事件（请参阅 <codeph class="+ topic/ph pr-d/codeph ">NetStatusEvent.info</codeph> 属性）仍然激发，尽管服务器不刷新缓冲区。</p>
     <p class="- topic/p ">对于一次暂停，<codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferLength</codeph> 属性的限值为 60 秒或二倍的 <codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferTime</codeph> 值（取二者之中的较大值）。例如，如果 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 为 20 秒，在 <codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferLength</codeph> 为较大值 20*2 (40) 或 60 之前，Flash Player 将一直进行缓冲，因此在本例中，在 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 为 60 之前，Flash Player 将一直进行缓冲。如果 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 为 40 秒，在 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 为较大值 40*2 (80) 或 60 之前，则 Flash Player 将一直进行缓冲，因此在本例中，在 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 为 80 秒之前，Flash Player 将一直进行缓冲。</p>
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 属性还有一个绝对限制。如果对 <codeph class="+ topic/ph pr-d/codeph ">pause()</codeph> 的任何调用导致 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 增大到 600 秒以上或 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> * 2 的值（取二者中的较大值），Flash Player 将刷新缓冲区并将 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 重置为 0。例如，如果 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 为 120 秒，当 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 达到 600 秒时，Flash Player 将刷新缓冲区；如果 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 为 360 秒，当 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 达到 720 秒时，Flash Player 将刷新缓冲区。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">提示</b>：例如，在查看器监视商用版的同时，可以在代码中使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.pause()</codeph> 来缓冲数据，然后在开始播放主视频时取消暂停。</p>
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/close()" class="- topic/link "><linktext class="- topic/linktext ">close()</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.net.xml#NetStream/resume()" class="- topic/link "><linktext class="- topic/linktext ">resume()</linktext></link><link href="flash.net.xml#NetStream/togglePause()" class="- topic/link "><linktext class="- topic/linktext ">togglePause()</linktext></link><link href="flash.net.xml#NetStream/bufferLength" class="- topic/link "><linktext class="- topic/linktext ">bufferLength</linktext></link><link href="flash.net.xml#NetStream/bufferTime" class="- topic/link "><linktext class="- topic/linktext ">bufferTime</linktext></link><link href="flash.events.xml#NetStatusEvent/info" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:play2" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">play2</apiName><shortdesc class="- topic/shortdesc ">
     使用多比特率在文件间无缝切换，并允许 NetStream 在连接断开并重新连接后继续。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">param</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:NetStreamPlayOptions</apiOperationClassifier></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     使用多比特率在文件间无缝切换，并允许 NetStream 在连接断开并重新连接后继续。
     
     <p class="- topic/p ">此方法是 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 的增强版。与 <codeph class="+ topic/ph pr-d/codeph ">play()</codeph> 方法类似，<codeph class="+ topic/ph pr-d/codeph ">play2()</codeph> 方法开始播放媒体文件或对媒体文件进行排队以创建播放列表。在将此方法用于 Flash Media Server 时，它还可以请求服务器切换到不同的媒体文件。此过渡在客户端应用程序中以无缝方式进行。下列功能使用 <codeph class="+ topic/ph pr-d/codeph ">play2()</codeph> 流切换：</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">动态流</b></p>
     
     <p class="- topic/p ">动态流（在 Flash Media Server 3.5 和更高版本中支持）让您能够提供用多比特率编码的流。当查看器的网络状况更改时，它们获得可提供最佳查看体验的比特率。使用 <codeph class="+ topic/ph pr-d/codeph ">NetStreamInfo</codeph> 类可监视网络状况并根据数据切换流。还可以为功能不同的客户端切换流。有关详细信息，请参阅《Adobe Flash Media Server 开发人员指南》中的<xref href="http://www.adobe.com/go/learn_fms_dynstream_cn" scope="external" class="- topic/xref ">“动态流”</xref>。</p>
     
     <p class="- topic/p ">Adobe 构建了一个称为 DynamicStream 的自定义 ActionScript 类，该类扩展了 NetStream 类。可以使用 DynamicStream 类在应用程序中实现动态流，而不必自行编写代码来检测网络状况。即使决定自行编写动态流代码，也请将 DynamicStream 类用作引用实现。可从 <xref href="http://www.adobe.com/go/fms_tools_cn" scope="external" class="- topic/xref ">Flash Media Server 工具及下载</xref>页下载该类和类文档。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">流重新连接</b></p>
     
     <p class="- topic/p ">流重新连接（在 Flash Media Server 3.5.3 和更高版本中支持）让用户获得不间断的媒体体验，即使在用户丢失连接时也是如此。当 ActionScript 逻辑重新连接到 Flash Media Server 时，媒体使用缓冲进行播放。重新连接后，调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attach()</codeph> 以使用与新的 NetConnection 相同的 NetStream 对象。使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attach()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayTransitions.RESUME</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayTrasitions.APPEND_AND_WAIT</codeph> API 重新连接流。有关详细信息，请参阅 <xref href="http://www.adobe.com/go/learn_fms_docs_cn" scope="external" class="- topic/xref ">Flash Media Server 3.5.3 文档</xref>。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.net.xml#NetStream/attach()" class="- topic/link "><linktext class="- topic/linktext ">attach()</linktext></link><link href="flash.net.xml#NetStreamPlayOptions" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions</linktext></link><link href="flash.net.xml#NetStreamPlayTransitions" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayTransitions</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:play" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">play</apiName><shortdesc class="- topic/shortdesc ">
     从本地目录或 Web 服务器播放媒体文件；从 Flash Media Server 播放媒体文件或实时流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>"at"see flash.media.Video#attachVideo()  This method no longer exists.  Replace with new method.
     </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">本地不受信任的 SWF 文件无法与 Internet 通信。您可以通过将此 SWF 文件重新分类为只能与远程内容交互或受信任来消除此限制。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">至少必须指定一个参数。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">NetStream 对象无效。这可能是由于失败的 NetConnection 造成的。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">arguments</apiItemName><apiType value="restParam" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">    <p class="- topic/p "><b class="+ topic/ph hi-d/b ">播放本地文件</b></p>
     
     
     <p class="- topic/p ">
     媒体文件的位置。参数可以是字符串、<codeph class="+ topic/ph pr-d/codeph ">URLRequest.url</codeph> 属性或引用这二者之一的变量。在 <ph class="- topic/ph ">Flash Player 以及</ph>应用程序安全沙箱以外的 AIR 内容中，您可以播放与 SWF 文件存储在同一个目录或位于其子目录中的本地视频文件，但是不能导航至更高级别的目录中。
     </p>
     
     <p class="- topic/p ">
     对于应用程序安全沙箱中的 AIR 内容，您为媒体文件指定的路径是相对于 SWF 文件的目录的。但是，您不能浏览到 SWF 文件的目录之上。不要指定完整路径，因为 AIR 会将其视为相对路径。      
     </p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">播放 Flash Media Server 中的文件</b></p>
     
     <adobetable class="innertable"><tgroup cols="3" class="- topic/tgroup "><thead class="- topic/thead "><row class="- topic/row "><entry class="- topic/entry ">名称</entry><entry class="- topic/entry ">必需</entry><entry class="- topic/entry ">说明</entry></row></thead><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">name:Object</codeph></entry><entry class="- topic/entry ">必需 </entry><entry class="- topic/entry "> 录制的文件的名称、<codeph class="+ topic/ph pr-d/codeph ">NetStream.publish()</codeph> 发布的实时数据的标识符或 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。如果为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>，流将停止播放并忽略任何其他参数。有关文件名语法的详细信息，请参阅此表后面的文件格式表。</entry></row><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">start:Number</codeph></entry><entry class="- topic/entry ">可选</entry><entry class="- topic/entry "> 开始时间（以秒为单位）。允许的值为 -2、-1、0 或正数。默认值为 -2，它先查找实时流，然后查找录制流，如果都没有找到，则打开实时流。如果为 -1，则只播放实时流。如果为 0 或正数，则播放录制流，从第 <codeph class="+ topic/ph pr-d/codeph ">start</codeph> 秒开始。
       </entry></row><row class="- topic/row "><entry class="- topic/entry "> <codeph class="+ topic/ph pr-d/codeph ">len:Number</codeph> </entry><entry class="- topic/entry "> 如果指定了 <codeph class="+ topic/ph pr-d/codeph ">start</codeph>，则是可选的。 </entry><entry class="- topic/entry "> 播放持续时间（以秒为单位）。允许的值为 -1、0 或正数。默认值为 -1，它一直播放完实时流或录制流。如果为 0，则播放距录制流开始处 <codeph class="+ topic/ph pr-d/codeph ">start</codeph> 秒的单个帧。如果为正数，则播放实时流或录制流 <codeph class="+ topic/ph pr-d/codeph ">len</codeph> 秒。
       </entry></row><row class="- topic/row "><entry class="- topic/entry "> <codeph class="+ topic/ph pr-d/codeph ">reset:Object</codeph> </entry><entry class="- topic/entry "> 如果指定了 <codeph class="+ topic/ph pr-d/codeph ">len</codeph>，则是可选的。 </entry><entry class="- topic/entry "> 是否清除播放列表。默认值为 1 或 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，它清除任何以前的 <codeph class="+ topic/ph pr-d/codeph ">play</codeph> 调用并立即播放 <codeph class="+ topic/ph pr-d/codeph ">name</codeph>。如果为 0 或 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>，则将流添加到播放列表中。如果为 2，则将播放列表保持不变，并同时返回所有流消息，而不是分段返回。如果为 3，则清除播放列表，并同时返回所有流消息。  </entry></row></tbody></tgroup></adobetable>
     
     
     <p class="- topic/p ">
     可以播放下表中所列的文件格式。语法将随文件格式的不同而不同。
     </p>
     
     <adobetable class="innertable"><tgroup cols="3" class="- topic/tgroup "><thead class="- topic/thead "><row class="- topic/row "><entry class="- topic/entry ">文件格式</entry><entry class="- topic/entry ">语法</entry><entry class="- topic/entry ">示例</entry></row></thead><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry ">FLV</entry><entry class="- topic/entry ">以字符串形式指定流名称（在“samples”目录中），不带文件扩展名。</entry><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">ns.play("samples/myflvstream");</codeph></entry></row><row class="- topic/row "><entry class="- topic/entry ">mp3 或 ID3</entry><entry class="- topic/entry ">使用前缀 <codeph class="+ topic/ph pr-d/codeph ">mp3:</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">id3:</codeph> 以字符串形式指定流名称（在“samples”目录中），不带文件扩展名。</entry><entry class="- topic/entry "><p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">ns.play("mp3:samples/mymp3stream");</codeph></p>
            <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">ns.play("id3:samples/myid3data");</codeph></p></entry></row><row class="- topic/row "><entry class="- topic/entry ">基于 MPEG-4 的文件（如 F4V 和 MP4）</entry><entry class="- topic/entry ">使用前缀 <codeph class="+ topic/ph pr-d/codeph ">mp4:</codeph> 以字符串形式指定流名称（在“samples”目录中）。该前缀向服务器表明文件包含 H.264 编码的视频和 AAC 编码的音频（在 MPEG-4 第 14 部分容器格式内）。如果服务器上的文件有文件扩展名，请指定它。 </entry><entry class="- topic/entry "><p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">ns.play("mp4:samples/myvideo.f4v");</codeph></p>
            <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">ns.play("mp4:samples/myvideo.mp4");</codeph></p>
          <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">ns.play("mp4:samples/myvideo");</codeph></p>
          <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">ns.play("mp4:samples/myvideo.mov");</codeph></p></entry></row><row class="- topic/row "><entry class="- topic/entry ">RAW</entry><entry class="- topic/entry ">使用前缀 <codeph class="+ topic/ph pr-d/codeph ">raw:</codeph> 以字符串形式指定流名称（在“samples”目录中）</entry><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">ns.play("raw:samples/myvideo");</codeph></entry></row></tbody></tgroup></adobetable>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">启用数据生成模式</b></p>
     
     <p class="- topic/p ">
     要启用“数据生成模式”，请将 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 值传递给在已连接到 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 的 NetConnection 上创建的 NetStream。在此模式下，调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 以将数据传送到 NetStream。（传递 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 还将重置 <codeph class="+ topic/ph pr-d/codeph ">onSeekPoint()</codeph> 回调的字节计数器。）
     </p>
     
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从本地目录或 Web 服务器播放媒体文件；从 Flash Media Server 播放媒体文件或实时流。调度 <codeph class="+ topic/ph pr-d/codeph ">NetStatusEvent</codeph> 对象，以报告状态和错误消息。
     
     <p class="- topic/p ">有关支持的编解码器和文件格式的信息，请参阅下面的内容：</p>
     
     <ul class="- topic/ul "><li class="- topic/li "><xref href="http://www.adobe.com/go/learn_fms_fileformats_cn" scope="external" class="- topic/xref ">Flash Media Server 文档</xref></li><li class="- topic/li "><xref href="http://www.adobe.com/go/hardware_scaling_cn" scope="external" class="- topic/xref ">Exploring Flash Player support for high-definition H.264 video and AAC audio</xref>（了解高分辨率 H.264 视频和 AAC 音频的 Flash Player 支持）</li><li class="- topic/li "><xref href="http://www.adobe.com/go/video_file_format_cn" scope="external" class="- topic/xref ">FLV/F4V open specification documents</xref>（FLV/F4V 开放规范文档）</li></ul>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">播放文件或实时流的工作流程</b></p>
     
     <ol class="- topic/ol "><li class="- topic/li ">创建 NetConnection 对象并调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph>。
     <p class="- topic/p ">要从本地目录或 Web 服务器播放文件，可传递 null。</p>
     <p class="- topic/p ">要从 Flash Media Server 播放录制的文件或实时流，可传递 Flash Media Server 应用程序的 URI。</p></li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler)</codeph> 以侦听 NetStatusEvent 事件。</li><li class="- topic/li ">对 <codeph class="+ topic/ph pr-d/codeph ">"NetConnection.Connect.Success"</codeph> 创建 NetStream 对象，并将 NetConnection 对象传递给构造函数。</li><li class="- topic/li ">创建一个 Video 对象，然后调用 <codeph class="+ topic/ph pr-d/codeph ">Video.attachNetStream()</codeph> 并传递 NetStream 对象。</li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph>。
     <p class="- topic/p ">要播放实时流，可对传递到 <codeph class="+ topic/ph pr-d/codeph ">NetStream.publish()</codeph> 方法的流名称进行传递。</p>
     <p class="- topic/p ">要播放录制文件，可传递该文件名。</p></li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">addChild()</codeph> 并传递 Video 对象以显示视频。</li></ol>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>要查看示例代码，请滚动到此页底部的示例。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">启用数据生成模式</b></p>
     
     <p class="- topic/p ">
     调用 <codeph class="+ topic/ph pr-d/codeph ">play(null)</codeph> 以启用“数据生成模式”。在此模式下，调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 方法，将数据传送到 NetStream。使用“数据生成模式”通过 HTTP 从 Apache HTTP 服务器上的 Adobe HTTP 动态流原始模块流式传输内容。HTTP 动态流允许客户端快速搜索文件中的任意点。Open Source Media Framework (OSMF) 支持视频点播和实时流的 HTTP 动态流。有关如何使用 NetStream 数据生成模式的示例，请下载 <xref href="http://www.opensourcemediaframework.com" scope="external" class="- topic/xref ">OSMF</xref> 源。有关 HTTP 动态流的详细信息，请参阅 <xref href="http://www.adobe.com/go/learn_fms_http_cn" scope="external" class="- topic/xref ">HTTP 动态流</xref>。
     </p>
     
     <p class="- topic/p ">
     在不使用 Flash Media Server 的情况下使用此方法时，有一些安全注意事项。受信任的本地沙箱或只能与远程内容交互的沙箱中的 文件可以加载并播放远程沙箱中的视频文件，但如果没有以 URL 策略文件的形式进行显式许可，则无法访问该远程文件的数据。<ph class="- topic/ph ">此外，还可以在包含 SWF 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数，以防止在 Flash Player 中运行的 SWF 文件使用此方法。</ph>有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。
     </p>
     
     </apiDesc><example class="- topic/example "><b class="+ topic/ph hi-d/b ">Flash Media Server</b> 此示例从“samples”目录播放录制的 F4V 文件，从头开始播放，持续 100 秒。对于 MPEG-4 文件，如果服务器上的文件包含文件名扩展，则 <codeph class="+ topic/ph pr-d/codeph ">play()</codeph> 方法必须指定一个文件名扩展。
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     ns.play("mp4:samples/record1.f4v", 0, 100, true);
     </codeblock>
     
     </example><example class="- topic/example "><b class="+ topic/ph hi-d/b ">Flash Media Server</b> 此示例将从头到尾播放由客户端发布的实时 FLV 流，立即开始：
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     ns.play("livestream");
     </codeblock>
     
     
     </example><example conref="examples\Video_new.as" class="- topic/example "> 以下示例显示如何加载外部 FLV 文件：
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var MyVideo:Video = new Video();
addChild(MyVideo);
 
var MyNC:NetConnection = new NetConnection();
MyNC.connect(null);
 
var MyNS:NetStream = new NetStream(MyNC);
MyNS.play("http://www.helpexamples.com/flash/video/clouds.flv");

MyVideo.attachNetStream(MyNS);

//the clouds.flv video has metadata we're not using, so create
//an error handler to ignore the message generated by the runtime
//about the metadata
MyNS.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); 

function asyncErrorHandler(event:AsyncErrorEvent):void 
{ 
   //ignore metadata error message
} 
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.display.xml#DisplayObjectContainer/addChild()" class="- topic/link "><linktext class="- topic/linktext ">DisplayObjectContainer.addChild()</linktext></link><link href="flash.net.xml#NetStream/checkPolicyFile" class="- topic/link "><linktext class="- topic/linktext ">checkPolicyFile</linktext></link><link href="flash.net.xml#NetStream/appendBytes()" class="- topic/link "><linktext class="- topic/linktext ">appendBytes()</linktext></link></related-links><adobeApiEvent id="flash.net:NetStream:play_status" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">status</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:StatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在尝试播放用数字权限管理 (DRM) 加密的内容时调度。<codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">"DRM.encryptedFLV"</codeph>。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在尝试播放用数字权限管理 (DRM) 加密的内容时调度。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:NetStream:preloadEmbeddedData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">preloadEmbeddedData</apiName><shortdesc class="- topic/shortdesc ">
     从本地存储的媒体文件中提取任何 DRM 元数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">param</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:NetStreamPlayOptions</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">描述在处理内容文件期间要使用的选项的 NetStreamPlayOptions。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从本地存储的媒体文件中提取任何 DRM 元数据。
     
     <p class="- topic/p ">使用 <codeph class="+ topic/ph pr-d/codeph ">preloadEmbeddedMetaData()</codeph> 作为下载和缓存脱机播放所需的 DRM 凭证的第一步。在媒体文件中检测到嵌入的 DRM 元数据时，将向 NetStream client 的 <codeph class="+ topic/ph pr-d/codeph ">onDRMContentData</codeph> 函数传递一个 DRMContentData 对象。此 DRMContentData 对象包含获取凭证所需的信息，在播放内容时需要该凭证。将 DRMContentDataObject 对象传递给 DRMManager <codeph class="+ topic/ph pr-d/codeph ">loadVoucher()</codeph> 方法，以下载凭证。</p>
     
     <p class="- topic/p ">预加载 DRM 凭证的步骤包括：</p>
     <ul class="- topic/ul "><li class="- topic/li ">
     <p class="- topic/p ">新建一个 NetStream 对象用于预加载元数据。</p>
     </li><li class="- topic/li ">将一个回调函数赋给 NetStream <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 的 <codeph class="+ topic/ph pr-d/codeph ">onDRMContentData</codeph> 属性。</li><li class="- topic/li ">新建一个 NetStreamPlayOptions 对象，并将其 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 属性设置为本地视频文件的 URL 字符串。</li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">preloadEmbeddedMetadata()</codeph>，同时传入 NetStreamPlayOptions 对象。</li><li class="- topic/li ">作为对 <codeph class="+ topic/ph pr-d/codeph ">onDRMContentData</codeph> 回调的响应，调用 DRMManager <codeph class="+ topic/ph pr-d/codeph ">loadVoucher()</codeph> 方法，同时传入 DRMContentData 对象。如果 DRMContentData 对象的 <codeph class="+ topic/ph pr-d/codeph ">authenticationMethod</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">userNameAndPassWord</codeph>，则在加载凭证之前在媒体权限服务器上验证用户的身份。</li><li class="- topic/li ">关闭用于预加载的 NetStream。</li></ul>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>要使用同一个 NetStream 对象预加载元数据和播放内容，则在开始播放前需要等待预加载操作生成 <codeph class="+ topic/ph pr-d/codeph ">onPlayStatus</codeph> 调用。</p>
     
     <p class="- topic/p ">下载的凭证存储在本地缓存中。在线播放内容也会下载和缓存凭证。在查看受 DRM 保护的内容文件时，将自动从本地存储区检索缓存的凭证。使用 DRMManager 可管理凭证缓存。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>不支持通过 HTTP、HTTPS 或 RTMP 连接预加载 DRM 元数据。只能从文件系统上存储的文件预加载元数据。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/event:onDRMContentData" class="- topic/link "><linktext class="- topic/linktext ">onDRMContentData</linktext></link><link href="flash.net.drm.xml#DRMContentData" class="- topic/link "><linktext class="- topic/linktext ">flash.net.drm.DRMContentData</linktext></link><link href="flash.net.drm.xml#DRMManager/loadVoucher()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.drm.DRMManager.loadVoucher()</linktext></link><link href="flash.net.drm.xml#DRMVoucher" class="- topic/link "><linktext class="- topic/linktext ">flash.net.drm.DRMVoucher</linktext></link><link href="flash.net.xml#NetStream/client" class="- topic/link "><linktext class="- topic/linktext ">client</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:publish" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">publish</apiName><shortdesc class="- topic/shortdesc ">
     将流音频、视频和数据消息从客户端发送到 Flash Media Server，可以选择在传输期间录制此流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">name</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">标识该流的字符串。订阅此流的客户端将在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 时传递此名称。流名称后面不要跟“/”。例如，不要使用流名称“<codeph class="+ topic/ph pr-d/codeph ">bolero/</codeph>”。
     
     <p class="- topic/p ">
     可以使用下表中所述的格式记录文件（不可以将 <codeph class="+ topic/ph pr-d/codeph ">publish()</codeph> 用于 MP3 格式文件）。语法将随文件格式的不同而不同。</p>
     <p class="- topic/p ">
     <adobetable class="innertable"><tgroup cols="3" class="- topic/tgroup "><thead class="- topic/thead "><row class="- topic/row "><entry class="- topic/entry ">文件格式</entry><entry class="- topic/entry ">语法</entry><entry class="- topic/entry ">示例</entry></row></thead><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry ">FLV</entry><entry class="- topic/entry ">以字符串形式指定流名称，不带文件扩展名。</entry><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">ns.publish("myflvstream");</codeph></entry></row><row class="- topic/row "><entry class="- topic/entry ">基于 MPEG-4 的文件（如 F4V 和 MP4）</entry><entry class="- topic/entry ">以字符串形式指定流名称，带有前缀 <codeph class="+ topic/ph pr-d/codeph ">mp4:</codeph>，带有或不带文件扩展名。Flash Player 不使用 H.264 进行编码，但 Flash Media Server 可以录制 F4V 容器中的任何编解码器。Flash Media Live Encoder 可以使用 H.264 进行编码。
     </entry><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">:myvideo.fv")</codeph> <codeph class="+ topic/ph pr-d/codeph ">ns.publish("mp4:4"); ns.publish("mp4:myvideo");</codeph></entry></row><row class="- topic/row "><entry class="- topic/entry ">RAW</entry><entry class="- topic/entry ">使用前缀 <codeph class="+ topic/ph pr-d/codeph ">raw:</codeph> 以字符串形式指定流名称</entry><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">ns.publish("raw:myvideo");</codeph></entry></row></tbody></tgroup></adobetable>
     </p>
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">type</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">用于指定如何发布该流的字符串。有效值是“<codeph class="+ topic/ph pr-d/codeph ">record</codeph>”、“<codeph class="+ topic/ph pr-d/codeph ">append</codeph>”、“<codeph class="+ topic/ph pr-d/codeph ">appendWithGap</codeph>”和“<codeph class="+ topic/ph pr-d/codeph ">live</codeph>”。默认值为“<codeph class="+ topic/ph pr-d/codeph ">live</codeph>”。
     <ul class="- topic/ul "><li class="- topic/li ">如果传递“<codeph class="+ topic/ph pr-d/codeph ">record</codeph>”，则服务器将发布并录制实时数据，同时将录制的数据保存到名称与传递给 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 参数的值相匹配的新文件中。如果该文件存在，则覆盖该文件。</li><li class="- topic/li ">如果传递“<codeph class="+ topic/ph pr-d/codeph ">append</codeph>”，则服务器将发布并录制实时数据，同时将录制的数据附加到名称与传递给 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 参数的值相匹配的文件中。如果未找到与 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 参数相匹配的文件，则创建一个文件。 </li><li class="- topic/li ">如果您传递“<codeph class="+ topic/ph pr-d/codeph ">appendWithGap</codeph>”，则会传递关于时间协调的其他信息，以帮助服务器在动态流式处理时确定正确的转换点。</li><li class="- topic/li ">如果省略此参数或传递“<codeph class="+ topic/ph pr-d/codeph ">live</codeph>”，则服务器将发布实时数据而不进行录制。如果存在名称与传递给 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 参数的值相匹配的文件，则删除它。</li></ul>
     
     
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将流音频、视频和数据消息从客户端发送到 Flash Media Server，可以选择在传输期间录制此流。此方法使用与流有关的信息调度 NetStatusEvent 对象。调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.publish()</codeph> 之前，请捕获 <codeph class="+ topic/ph pr-d/codeph ">"NetConnection.Connect.Success"</codeph> 事件以验证应用程序已成功连接到 Flash Media Server。
     
     <p class="- topic/p ">发布时，可以用 FLV 或 F4V 格式录制文件。如果录制 F4V 格式的文件，可使用 flattener 工具在另一个应用程序中编辑或播放该文件。要下载此工具，请参阅 <xref href="http://www.adobe.com/go/fms_tools_cn" scope="external" class="- topic/xref ">www.adobe.com/go/fms_tools_cn</xref>。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>不要使用此方法播放流。要播放流，请调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法。</p>
     
     <p class="- topic/p ">发布流的工作流程</p>
     
     <ol class="- topic/ol "><li class="- topic/li ">创建 NetConnection 对象并调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph>。</li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.addEventListener()</codeph>，以便侦听 NetStatusEvent 事件。</li><li class="- topic/li ">对 <codeph class="+ topic/ph pr-d/codeph ">"NetConnection.Connect.Success"</codeph> 事件创建 NetStream 对象，然后将 NetConnection 对象传递给构造函数。</li><li class="- topic/li ">要捕获音频和视频，请调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachAudio()</codeph> 方法和 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachCamera()</codeph> 方法。</li><li class="- topic/li ">要发布流，请调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.publish()</codeph> 方法。您可以在发布数据时进行录制，以便用户可以在以后播放该数据。</li></ol>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>NetStream 可以发布流或播放流，但不能同时执行这两个操作。要发布流，请从服务器查看播放，创建两个 NetStream 对象。通过一个 NetConnection 对象可以发送多个 NetStream 对象。</p>
     
     <p class="- topic/p ">Flash Media Server 录制流时，会创建一个文件。默认情况下，服务器会使用传递给 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph> 的应用程序实例名称创建一个目录，并将文件存储在该目录中。例如，下面的代码连接到“lectureseries”应用程序的默认实例，并录制“lecture”流。文件“lecture.flv”录制到 applications/lectureseries/streams/_definst_ 目录下：
     </p>
     
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     var nc:NetConnection = new NetConnection();
     nc.connect("rtmp://fms.example.com/lectureseries");
     nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
     
     function netStatusHandler(event:NetStatusEvent):void{
       if (event.info.code == "NetConnection.Connect.Success"){
            var ns:NetStream = new NetStream(nc);
            ns.publish("lecture", "record");
       }
     }
     </codeblock>
     
     <p class="- topic/p ">下面的示例连接到同一应用程序的“monday”实例。文件“lecture.flv”录制到 /applications/lectureseries/streams/monday 目录下：</p>
     
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     var nc:NetConnection = new NetConnection();
     nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
     nc.connect("rtmp://fms.example.com/lectureseries/monday");
     
     function netStatusHandler(event:NetStatusEvent):void{
       if (event.info.code == "NetConnection.Connect.Success"){
            var ns:NetStream = new NetStream(nc);
            ns.publish("lecture", "record");
       }
     }
     </codeblock>
     
     </apiDesc><example conref="examples\NetStream_publish.as" class="- topic/example "> 下面的示例从摄像头捕获视频并通过 NetStream 将其发布到 Flash Media Server。本示例在从 Flash Media Server 播放视频时显示该视频。
 <p class="- topic/p ">要运行此示例，需要在计算机上连接摄像头。还需要向库中添加 Button 组件和 Label 组件。</p>
 <p class="- topic/p ">只有应用程序成功连接到服务器之后，应用程序才会具有发布流（将其发送到 Flash Media Server）的按钮。只有成功发布流之后，应用程序才会播放来自服务器的流。<codeph class="+ topic/ph pr-d/codeph ">NetStatusEvent</codeph> 返回具有 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性的 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 对象，用于指定上述情况。<codeph class="+ topic/ph pr-d/codeph ">netStatusHandler</codeph> 函数为 NetConnection 和 NetStream 类处理这些事件。</p>
 <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.media.Video;
    import flash.media.Camera;
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import fl.controls.Button;
    import fl.controls.Label;

    public class NetStream_publish extends Sprite {
        private var connectionURL:String = "rtmp://localhost/live/";
        private var videoURL:String = "liveVideo";
        private var nc:NetConnection;
        private var ns_publish:NetStream;
        private var ns_playback:NetStream;
        private var video_publish:Video;
        private var video_playback:Video;
        private var cam:Camera;
        private var b:Button;
        private var l:Label;

        public function NetStream_publish() {
            setUpUI();
            
            nc = new NetConnection();
            nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            
            // Add bandwidth detection handlers on the NetConnection Client to
            // prevent Reference Errors at runtime when using the "live" and "vod" applications.          
            var clientObj:Object = new Object();
            clientObj.onBWDone = onBWDone;
            clientObj.onBWCheck = onBWCheck;
            nc.client = clientObj;
            
            // Connect to the "live" application on Flash Media Server.
            nc.connect(connectionURL);
        }

        private function netStatusHandler(event:NetStatusEvent):void {
            trace(event.info.code + " | " + event.info.description);
            switch (event.info.code) {
                case "NetConnection.Connect.Success":
                    // Enable the "Publish" button after the client connects to the server.
                    b.enabled = true;
                    break;
                case "NetStream.Publish.Start":
                    playbackVideo();
                    break;
            }
        }
    
        private function publishVideo(event:MouseEvent):void{
            // Disable the button so that you can only publish once.
            b.enabled = false;
            // Create a NetStream to send video to FMS.
            ns_publish = new NetStream(nc);
            ns_publish.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            // Publish (send) the video to FMS.
            cam = Camera.getCamera();
            ns_publish.attachCamera(cam);
               ns_publish.publish(videoURL);
        }

        private function playbackVideo():void {
            // Create a NetStream to receive the video from FMS.
            ns_playback = new NetStream(nc);
            ns_playback.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            ns_playback.play(videoURL);    
            // Display the video that was published to FMS.
            video_playback = new Video(cam.width, cam.height);
            video_playback.x = cam.width + 20;
            video_playback.y = 10;
            video_playback.attachNetStream(ns_playback);
            addChild(video_playback);
        }
        
        
        private function setUpUI():void { 
            b = new Button(); 
            b.addEventListener(MouseEvent.CLICK, publishVideo);
            b.width = 150;
            b.label = "Publish video to server";
            b.move(10, 150);
            b.enabled = false;
            
            l = new Label();
            l.width = 150;
            l.text = "Playing back from server"
            l.move(190, 150);
            
            addChild(b);
            addChild(l);
        }
        
        // Handlers called by the Flash Media Server "live" and "vod" applications.
        public function onBWDone(... rest):Boolean {
            return true;
        }
        
        public function onBWCheck(... rest):Number {
            return 0;
        }
    }
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection/connect()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection.connect()</linktext></link><link href="flash.events.xml#NetStatusEvent/info" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:receiveAudio" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">receiveAudio</apiName><shortdesc class="- topic/shortdesc ">
     指定传入的音频是否在流上播放。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">flag</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定传入音频是在流上播放 (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>) 还是不播放 (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>)。默认值为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。如果指定的流仅包含音频数据，则当您传递 <codeph class="+ topic/ph pr-d/codeph ">false</codeph> 时，<codeph class="+ topic/ph pr-d/codeph ">NetStream.time</codeph> 停止递增。
     
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定传入的音频是否在流上播放。此方法仅供订阅了指定流的客户端使用。它对流的发布者不可用。在您调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法前后调用此方法。例如，将此方法附加到按钮以允许用户对音频静音和取消静音。仅对从 Flash Media Server 播放的单播流使用此方法。对于 RTMFP 多播流或当使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.appendBytes()</codeph> 方法时，此方法不起作用。
     
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetStream:receiveVideoFPS" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">receiveVideoFPS</apiName><shortdesc class="- topic/shortdesc ">
     指定传入视频的帧速率。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">FPS</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定播放传入视频的每秒帧速率。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定传入视频的帧速率。此方法仅供订阅了指定流的客户端使用。它对流的发布者不可用。在您调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法前后调用此方法。例如，调用此方法以允许用户设置视频帧速率。要确定当前帧速率，请使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.currentFPS</codeph>。要停止接收视频，请传递 <codeph class="+ topic/ph pr-d/codeph ">0</codeph>。
	 <p class="- topic/p ">当您将值传递到 FPS 参数以限制视频的帧速率时，Flash Media Server 尝试降低帧速率，同时保留视频的完整性。在每二个关键帧之间，服务器发送满足合适速率所需的最小帧数量。请注意 I 帧（或中间帧）必须连续发送，否则视频会损坏。因此，在关键帧后需要立即连续发送需要的帧数。由于各个帧不是均匀分布的，因此在由于中断而截断的部分中，动作仍会平滑地显示。</p>
	 <p class="- topic/p ">仅对从 Flash Media Server 播放的单播流使用此方法。对于 RTMFP 多播流或当使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.appendBytes()</codeph> 方法时，此方法不起作用。</p>
	 
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetStream:receiveVideo" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">receiveVideo</apiName><shortdesc class="- topic/shortdesc ">
     指定传入的视频是否在流上播放。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">flag</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定传入视频是在此流上播放 (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>) 还是不播放 (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>)。默认值为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。如果指定的流仅包含视频数据，则当您传递 <codeph class="+ topic/ph pr-d/codeph ">false</codeph> 时，<codeph class="+ topic/ph pr-d/codeph ">NetStream.time</codeph> 停止递增。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定传入的视频是否在流上播放。此方法仅供订阅了指定流的客户端使用。它对流的发布者不可用。在您调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法前后调用此方法。例如，将此方法附加到按钮以允许用户显示和隐藏视频。仅对从 Flash Media Server 播放的单播流使用此方法。对于 RTMFP 多播流或当使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.appendBytes()</codeph> 方法时，此方法不起作用。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetStream:resetDRMVouchers" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">resetDRMVouchers</apiName><shortdesc class="- topic/shortdesc ">
     删除所有本地缓存的数字权限管理 (DRM) 凭证数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream, resetDRMVouchers
     
      </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法删除凭证数据。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     删除所有本地缓存的数字权限管理 (DRM) 凭证数据。
     <p class="- topic/p ">
     应用程序必须从媒体权限服务器重新下载任何必要的凭证，用户才能访问受保护的内容。调用此函数等同于调用 DRMManager 对象的 <codeph class="+ topic/ph pr-d/codeph ">resetDRMVouchers()</codeph> 函数。</p>
     
     </apiDesc><example conref="examples\NetStream.resetDRMVouchers.1.as" class="- topic/example "> 下例重置所有 DRM 凭证：
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">

NetStream.resetDRMVouchers();
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.drm.xml#DRMManager/resetDRMVouchers()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.drm.DRMManager.resetDRMVouchers()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:resume" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">resume</apiName><shortdesc class="- topic/shortdesc ">
     恢复播放暂停的视频流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.resume, resume
     
     </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     恢复播放暂停的视频流。如果视频已在播放，则调用此方法将不会执行任何操作。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/close()" class="- topic/link "><linktext class="- topic/linktext ">close()</linktext></link><link href="flash.net.xml#NetStream/pause()" class="- topic/link "><linktext class="- topic/linktext ">pause()</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.net.xml#NetStream/togglePause()" class="- topic/link "><linktext class="- topic/linktext ">togglePause()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:seek" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">seek</apiName><shortdesc class="- topic/shortdesc ">
     
     搜索与指定位置最接近的关键帧（在视频行业中也称为 I 帧）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.seek, seek
     
     </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">offset</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要在视频文件中移动到的时间近似值（以秒为单位）。使用 Flash Media Server 时，如果在 Application.xml 配置文件中将 <codeph class="+ topic/ph pr-d/codeph ">&lt;EnhancedSeek></codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>（这是默认设置），服务器将在 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 位置生成一个关键帧。
     
     <ul class="- topic/ul "><li class="- topic/li ">要返回到该流的开始处，请将 0 传递给 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph>。</li><li class="- topic/li ">要从流的开始处向前搜寻，应传递将要前进的秒数。例如，要将播放头放在距开始处 15 秒的位置（或 15 秒之前的关键帧），请使用 <codeph class="+ topic/ph pr-d/codeph ">myStream.seek(15)</codeph>。</li><li class="- topic/li ">要搜索当前位置的相对位置，请传递 <codeph class="+ topic/ph pr-d/codeph ">NetStream.time + n</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">NetStream.time - n</codeph>，以分别从当前位置向前或向后搜索 <codeph class="+ topic/ph pr-d/codeph ">n</codeph> 秒的位置。例如，要从当前位置后退 20 秒，请使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.seek(NetStream.time - 20)</codeph>。</li></ul>
     
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
     搜索与指定位置最接近的关键帧（在视频行业中也称为 I 帧）。关键帧位于从流的开始处算起的偏移位置（以秒为单位）。
     
     <p class="- topic/p ">
     视频流通常是使用以下两种类型的帧进行编码的：关键帧（或 I 帧）和 P 帧。关键帧包含完整图像；而 P 帧是一个中间帧，它在两个关键帧之间提供额外的视频信息。通常，视频流每 10 到 50 帧中有一个关键帧。
     </p>
     
     <p class="- topic/p ">Flash Media Server 具有多种搜索行为：增强型搜索和智能搜索。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">增强型搜索</b></p>
     
     <p class="- topic/p "> 默认情况下启用增强型搜索。要禁用增强型搜索，请在 Flash Media Server 上将 <codeph class="+ topic/ph pr-d/codeph ">Application.xml</codeph> 配置文件中的 <codeph class="+ topic/ph pr-d/codeph ">EnhancedSeek</codeph> 元素设置为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
     </p>
     
     <p class="- topic/p ">如果启用了增强型搜索，服务器将基于前一个关键帧和任何中间的 P 帧在 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 位置生成一个新的关键帧。但是，生成关键帧将导致服务器上的处理负载很高，并且生成的关键帧中可能发生失真。如果视频编解码器为 On2，则会将搜索点之前的关键帧以及该关键帧和搜索点之间的所有 P 帧发送到客户端。
     </p>
     
     <p class="- topic/p ">
     如果禁用了增强型搜索，服务器将开始从最近关键帧进行流式播放。例如，假设视频在第 0 秒和第 10 秒处各有一个关键帧。则搜索第 4 秒将导致使用 0 秒处的关键帧在第 4 秒处开始播放。在到达下一个关键帧（在第 10 秒处）之前，视频将保持冻结。为了获得更好的搜索体验，您需要缩短关键帧间隔。在标准搜索模式下，无法在两个关键帧之间的位置启动视频。
     </p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">智能搜索</b></p>
     
     <p class="- topic/p ">要启用智能搜索，请将 <codeph class="+ topic/ph pr-d/codeph ">NetStream.inBufferSeek</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。</p>
     
     <p class="- topic/p ">智能搜索允许 Flash Player 在现有后退缓冲和前进缓冲内进行搜索。如果禁用智能搜索，每次调用 <codeph class="+ topic/ph pr-d/codeph ">seek()</codeph> 时，Flash Player 将刷新缓冲并从服务器请求数据。有关详细信息，请参阅 <codeph class="+ topic/ph pr-d/codeph ">NetStream.inBufferSeek</codeph>。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">在数据生成模式下搜索</b></p>
     
     <p class="- topic/p ">对处于数据生成模式的 NetStream 调用 <codeph class="+ topic/ph pr-d/codeph ">seek()</codeph> 时，将丢弃随后传递给 <codeph class="+ topic/ph pr-d/codeph ">appendBytes()</codeph> 的所有字节（即，未放置在缓冲区中、在部分消息 FIFO 中积累或对搜索点解析的字节），直到您调用 <codeph class="+ topic/ph pr-d/codeph ">appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN)</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">appendBytesAction(NetStreamAppendBytesAction.RESET_SEEK)</codeph> 以重置该解析程序。有关数据生成模式的信息，请参阅 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph>。</p>
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/inBufferSeek" class="- topic/link "><linktext class="- topic/linktext ">inBufferSeek</linktext></link><link href="flash.net.xml#NetStream/backBufferLength" class="- topic/link "><linktext class="- topic/linktext ">backBufferLength</linktext></link><link href="flash.net.xml#NetStream/backBufferTime" class="- topic/link "><linktext class="- topic/linktext ">backBufferTime</linktext></link><link href="flash.net.xml#NetStream/step()" class="- topic/link "><linktext class="- topic/linktext ">step()</linktext></link><link href="flash.net.xml#NetStream/time" class="- topic/link "><linktext class="- topic/linktext ">time</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:send" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">send</apiName><shortdesc class="- topic/shortdesc ">
     在发布的流上向所有订阅客户端发送一条消息。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">handlerName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要发送的消息；还有用于接收消息的 ActionScript 处理函数的名称。处理函数的名称只能为单级形式（即不能是父/子多级形式）并相对于流对象。不要对处理函数名称使用保留字。例如，将“<codeph class="+ topic/ph pr-d/codeph ">close</codeph>”用作处理函数名称将导致方法失败。如果使用 Flash Media Server，请使用 <codeph class="+ topic/ph pr-d/codeph ">@setDataFrame</codeph> 将元数据关键帧添加到实时流中，或者使用 <codeph class="+ topic/ph pr-d/codeph ">@clearDataFrame</codeph> 删除关键帧。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">arguments</apiItemName><apiType value="restParam" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可以是任何类型的可选参数。它们经过序列化并通过该连接发送，而接收处理函数则以相同的顺序接收它们。如果某个参数为循环对象（如循环的链接列表），则序列化函数可以正确处理引用。使用 Flash Media Server 时，如果 <codeph class="+ topic/ph pr-d/codeph ">@setDataFrame</codeph> 是第一个参数，请使用 <codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 作为第二个参数；对于第三个参数，请传递将元数据设置为属性的 <codeph class="+ topic/ph pr-d/codeph ">Object</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">Array</codeph> 实例。有关建议的属性名称的列表，请参阅<xref href="http://www.adobe.com/go/learn_fms_devguide_cn" scope="external" class="- topic/xref ">《Flash Media Server 开发人员指南》</xref>。如果将 <codeph class="+ topic/ph pr-d/codeph ">@clearDataFrame</codeph> 作为第一个参数，请使用 <codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 作为第二个参数，而不使用第三个参数。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在发布的流上向所有订阅客户端发送一条消息。此方法仅供指定流的发布者使用。此方法仅可用于 Flash Media Server。要处理并响应该消息，请在 <codeph class="+ topic/ph pr-d/codeph ">NetStream</codeph> 对象上创建一个处理函数，例如，<codeph class="+ topic/ph pr-d/codeph ">ns.HandlerName</codeph>。
     
     <p class="- topic/p ">
     <ph class="- topic/ph ">Flash Player 或</ph>AIR 不对方法或方法的数据、对象原型变量或不可枚举的变量进行序列化处理。对于显示对象，<ph class="- topic/ph ">Flash Player 或 </ph> AIR 仅对路径而不对数据进行序列化处理。
     </p>
     
     <p class="- topic/p ">
     您可以调用 <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> 方法，将数据关键帧添加到已发布到 Flash Media Server 的实时流中。数据关键帧是发布者添加到实时流中的消息。通常，在从摄像头和麦克风为实时流捕获数据之前，使用数据关键帧将元数据添加到该流中。在发布实时流期间，发布者可以随时添加数据关键帧。只要发布者连接到服务器上，就会将数据关键帧保存在服务器的内存中。
     </p>
     <p class="- topic/p ">
     如果客户端是在添加数据关键帧之前订阅实时流的，则会在添加后立即收到该关键帧。如果客户端是在添加数据关键帧之后订阅实时流的，则会在订阅时收到该关键帧。
     </p>
     <p class="- topic/p ">
     要将元数据关键帧添加到发送给 Flash Media Server 的实时流中，请使用 <codeph class="+ topic/ph pr-d/codeph ">@setDataFrame</codeph> 作为处理函数名称，后跟两个其他参数，例如：
     </p>
     
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     var ns:NetStream = new NetStream(nc);
     ns.send("@setDataFrame", "onMetaData", metaData);
     </codeblock>
     
     
     
     <p class="- topic/p ">
     <codeph class="+ topic/ph pr-d/codeph ">@setDataFrame</codeph> 参数引用 Flash Media Server 中内置的一个特殊处理函数。<codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 参数是客户端应用程序中侦听 <codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 事件并检索元数据的回调函数的名称。第三项 <codeph class="+ topic/ph pr-d/codeph ">metaData</codeph> 是包含用于定义元数据值的属性的 <codeph class="+ topic/ph pr-d/codeph ">Object</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">Array</codeph> 实例。
     </p>
     
     <p class="- topic/p ">可以使用 <codeph class="+ topic/ph pr-d/codeph ">@clearDataFrame</codeph> 清除已在流中设置的元数据关键帧：
     </p>
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     ns.send("@clearDataFrame", "onMetaData");
     </codeblock>
     
     
     </apiDesc><example conref="examples\NetStream.send.1.as" class="- topic/example "> 下面的示例创建两个 <codeph class="+ topic/ph pr-d/codeph ">NetStream</codeph> 对象。一个对象用于将实时流发布到服务器上；另一个对象用于订阅该流。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" class="- topic/example "> 下面的示例创建元数据，并将其添加到实时流中：
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" class="- topic/example "> 为了响应添加到视频中的数据关键帧，客户端需要定义 <codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 事件处理函数。<codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 事件处理函数不是使用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 注册的，而是一个具有名称 <codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 的回调函数，例如：
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
 public function onMetaData(info:Object):void {
    trace("width: " + info.width);
    trace("height: " + info.height);
 }
</codeblock></example><example conref="examples\NetStream.send.4.as" class="- topic/example ">  下面的示例说明如何在服务器上创建播放列表：
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" class="- topic/example ">  如果录制的视频文件只包含数据消息，您可以按最初录制视频文件时的速度进行播放，也可以同时获取所有数据消息。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#NetStream/client" class="- topic/link "><linktext class="- topic/linktext ">client</linktext></link><link href="flash.net.xml#NetStream/dataReliable" class="- topic/link "><linktext class="- topic/linktext ">dataReliable</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:setDRMAuthenticationCredentials" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">setDRMAuthenticationCredentials</apiName><shortdesc class="- topic/shortdesc ">
     设置查看基础加密内容所需要的 DRM 身份验证凭据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream, setDRMAuthenticationCredentials
     
      </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">userName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">有效的用户名凭据。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">password</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">与提供的用户名对应的密码凭据。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">type</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个字符串，指定提供哪种类型的身份验证凭据。有效值为<codeph class="+ topic/ph pr-d/codeph ">“drm”</codeph>和<codeph class="+ topic/ph pr-d/codeph ">“proxy”</codeph>。默认值为<codeph class="+ topic/ph pr-d/codeph ">“drm”</codeph>。
     <ul class="- topic/ul "><li class="- topic/li ">使用 <codeph class="+ topic/ph pr-d/codeph ">"drm"</codeph> 身份验证类型时，将针对 Flash Access 对提供的凭据进行身份验证。</li><li class="- topic/li ">使用<codeph class="+ topic/ph pr-d/codeph ">“proxy”</codeph>身份验证类型时，提供的凭据将针对代理服务器进行身份验证且必须与代理服务器所需的凭据相匹配。例如，<codeph class="+ topic/ph pr-d/codeph ">“proxy”</codeph>选项允许应用程序针对代理服务器进行身份验证（如果企业要求用户通过此步骤后才能访问 Internet）。除非使用匿名身份验证，否则在代理身份验证之后，用户仍需要针对 Flash Access 进行身份验证才能获取凭证并播放内容。您可以再次与 <codeph class="+ topic/ph pr-d/codeph ">"drm"</codeph> 选项一起使用 <codeph class="+ topic/ph pr-d/codeph ">setDRMAuthenticationcredentials()</codeph> 以针对 Flash Access 进行身份验证。</li></ul>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     设置查看基础加密内容所需要的 DRM 身份验证凭据。
     <p class="- topic/p ">
     <codeph class="+ topic/ph pr-d/codeph ">setDRMAuthenticationCredentials()</codeph> 方法提供的凭据与内容提供程序或代理服务器已知并接受的凭据相匹配。这些凭据与用户获取权限以查看内容时使用的凭据相同。
     </p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.events.xml#DRMAuthenticateEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.DRMAuthenticateEvent</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:step" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">step</apiName><shortdesc class="- topic/shortdesc ">
    前进或后退（相对于当前显示的帧）指定帧数的步骤。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">frames</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    前进或后退（相对于当前显示的帧）指定帧数的步骤。指定一个正数前进一步，指定一个负数后退一步。调用此方法以创建准确快速的快进或后退功能。
    
    <p class="- topic/p ">只有数据流来自 Flash Media Server 3.5.3 或更高版本，并且 <codeph class="+ topic/ph pr-d/codeph ">NetStream.inBufferSeek</codeph> 为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 时，此方法才可用。此外，目标帧必须位于缓冲区内。例如，如果当前显示的帧的帧编号为 120 且您指定值 1000，则如果帧编号 1120 不在缓冲区内，此方法将失败。</p>
    
    <p class="- topic/p ">此方法计划是与 <codeph class="+ topic/ph pr-d/codeph ">pause()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">togglePause()</codeph> 方法结合使用。如果在播放期间不停顿地向前或向后跳过 10 帧，您可能不会注意到这些步骤，或者这些步骤看起来像是个小故障。此外，在调用 <codeph class="+ topic/ph pr-d/codeph ">pause()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">togglePause</codeph> 时，会禁止音频。</p>
    
    <p class="- topic/p ">如果调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.step()</codeph> 成功，则会将“NetStream.Step.Notify”用作 info 对象的 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性的值来发送 NetStatusEvent。 </p>
    
    <p class="- topic/p ">  </p>
    
    </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/inBufferSeek" class="- topic/link "><linktext class="- topic/linktext ">inBufferSeek</linktext></link><link href="flash.net.xml#NetStream/backBufferTime" class="- topic/link "><linktext class="- topic/linktext ">backBufferTime</linktext></link><link href="flash.net.xml#NetStream/backBufferLength" class="- topic/link "><linktext class="- topic/linktext ">backBufferLength</linktext></link><link href="flash.net.xml#NetStream/bufferTime" class="- topic/link "><linktext class="- topic/linktext ">bufferTime</linktext></link><link href="flash.net.xml#NetStream/bufferLength" class="- topic/link "><linktext class="- topic/linktext ">bufferLength</linktext></link><link href="flash.net.xml#NetStream/step()" class="- topic/link "><linktext class="- topic/linktext ">step()</linktext></link><link href="flash.net.xml#NetStream/seek()" class="- topic/link "><linktext class="- topic/linktext ">seek()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetStream:togglePause" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">togglePause</apiName><shortdesc class="- topic/shortdesc ">
     暂停或恢复流的播放。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.resume, resume
     
     </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     暂停或恢复流的播放。第一次调用此方法时，将暂停播放；下一次调用此方法时，将恢复播放。您可以使用此方法，允许用户通过按某个按钮来暂停或恢复播放。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/close()" class="- topic/link "><linktext class="- topic/linktext ">close()</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.net.xml#NetStream/pause()" class="- topic/link "><linktext class="- topic/linktext ">pause()</linktext></link><link href="flash.net.xml#NetStream/resume()" class="- topic/link "><linktext class="- topic/linktext ">resume()</linktext></link></related-links></apiOperation><apiValue id="flash.net:NetStream:CONNECT_TO_FMS" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">CONNECT_TO_FMS</apiName><shortdesc class="- topic/shortdesc ">
     一个静态对象，用作 NetStream 实例的构造函数的参数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">connectToFMS</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     一个静态对象，用作 NetStream 实例的构造函数的参数。它是 NetStream 构造函数中的第二个参数的默认值；对于渐进式媒体播放，应用程序将不使用默认值。若使用此参数，则会导致构造函数建立与 Flash Media Server 实例的连接。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:DIRECT_CONNECTIONS" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">DIRECT_CONNECTIONS</apiName><shortdesc class="- topic/shortdesc ">
     创建同级对同级发行者连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">directConnections</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建同级对同级发行者连接。将第二个（可选）参数的此字符串传递给 NetStream 实例的构造函数。利用此字符串，应用程序可以出于向客户端发布音频和视频的目的而创建 NetStream 连接。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:audioReliable:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">audioReliable</apiName><shortdesc class="- topic/shortdesc ">
     
     对于 RTMFP 连接，指定音频发送是否具有完全可靠性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
     对于 RTMFP 连接，指定音频发送是否具有完全可靠性。为 TRUE 时，通过此 NetStream 传输的所有音频完全可靠。为 FALSE 时，传输的音频不完全可靠，但将在有限的时间内重新传输该音频，然后删除该音频。可使用 FALSE 值减少延迟，但这是以牺牲音频质量为代价的。
     
     <p class="- topic/p ">如果您基于不支持部分可靠性的网络协议，尝试将此属性设置为 FALSE，则尝试将被忽略并将属性设置为 TRUE。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/dataReliable" class="- topic/link "><linktext class="- topic/linktext ">dataReliable</linktext></link><link href="flash.net.xml#NetStream/videoReliable" class="- topic/link "><linktext class="- topic/linktext ">videoReliable</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:audioSampleAccess:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">audioSampleAccess</apiName><shortdesc class="- topic/shortdesc ">
     
     对于 RTMFP 连接，指定是否允许此 NetStream 中的对等订户捕获音频流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
     对于 RTMFP 连接，指定是否允许此 NetStream 中的对等订户捕获音频流。当为 FALSE 时，订阅者尝试捕获此音频流将显示权限错误。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/videoSampleAccess" class="- topic/link "><linktext class="- topic/linktext ">videoSampleAccess</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:backBufferLength:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">backBufferLength</apiName><shortdesc class="- topic/shortdesc ">
    当前为后退和播放而缓存的以前显示的数据的秒数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    当前为后退和播放而缓存的以前显示的数据的秒数。
    
    <p class="- topic/p ">此属性仅当数据流来自于 Flash Media Server 3.5.3 或更高版本时可用；有关 Flash Media Server 的详细信息，请参阅类说明。</p>
    
    <p class="- topic/p ">要指定以前显示的数据的缓存时间，请使用 <codeph class="+ topic/ph pr-d/codeph ">Netstream.backBufferTime</codeph> 属性。 </p>
    
    <p class="- topic/p "> 要防止数据缓存，请将 <codeph class="+ topic/ph pr-d/codeph ">Netstream.inBufferSeek</codeph> 属性设置为 FALSE。</p>
    
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/backBufferTime" class="- topic/link "><linktext class="- topic/linktext ">backBufferTime</linktext></link><link href="flash.net.xml#NetStream/inBufferSeek" class="- topic/link "><linktext class="- topic/linktext ">inBufferSeek</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:backBufferTime:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">backBufferTime</apiName><shortdesc class="- topic/shortdesc ">
    指定 Flash Player 尝试为后退和播放而缓存的先前显示的数据的数量（以秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定 Flash Player 尝试为后退和播放而缓存的先前显示的数据的数量（以秒为单位）。桌面应用程序的缓存时间默认值为 30 秒，移动应用程序的缓存时间默认值为 3 秒。
    
    <p class="- topic/p ">此属性仅当数据流来自 Flash Media Server 3.5.3 版本或更高版本时才可用；有关 Flash Media Server 的详细信息，请参阅类描述。</p>
    
    <p class="- topic/p ">使用此属性可提高后退操作的性能，因为不会再次从服务器检索已显示的数据。而是开始从缓冲区重放流。在播放期间，继续从服务器流式传输数据直到缓冲区已满为止。 </p>
    
    <p class="- topic/p ">如果后退位置远远落后于缓存中的数据，则将刷新缓冲区；然后在请求的位置处从服务器开始流式传输数据。 </p>
    
    <p class="- topic/p ">要使用此属性，请将 <codeph class="+ topic/ph pr-d/codeph ">Netstream.inBufferSeek</codeph> 属性设置为 TRUE。</p>
    
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/backBufferLength" class="- topic/link "><linktext class="- topic/linktext ">backBufferLength</linktext></link><link href="flash.net.xml#NetStream/bufferTime" class="- topic/link "><linktext class="- topic/linktext ">bufferTime</linktext></link><link href="flash.net.xml#NetStream/inBufferSeek" class="- topic/link "><linktext class="- topic/linktext ">inBufferSeek</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:bufferLength:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bufferLength</apiName><shortdesc class="- topic/shortdesc ">
     数据当前存在于缓冲区中的秒数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.bufferLength, bufferLength
     
     </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     数据当前存在于缓冲区中的秒数。您可以将此属性与 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 属性一起使用，以评估缓冲区将近填满的程度；例如，向正等待数据加载到缓冲区中的用户显示反馈。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/backBufferLength" class="- topic/link "><linktext class="- topic/linktext ">backBufferLength</linktext></link><link href="flash.net.xml#NetStream/bufferTime" class="- topic/link "><linktext class="- topic/linktext ">bufferTime</linktext></link><link href="flash.net.xml#NetStream/bytesLoaded" class="- topic/link "><linktext class="- topic/linktext ">bytesLoaded</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:bufferTimeMax:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bufferTimeMax</apiName><shortdesc class="- topic/shortdesc ">
    指定实时流内容的最大缓冲区长度（以秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定实时流内容的最大缓冲区长度（以秒为单位）。默认值为 0。由于网络和设备问题（如发送方和接收方之间存在时钟偏移），缓冲区长度可随时间不断增加。设置此属性可使实时应用（如会议和监视）的缓冲区长度最大化。
    
    <p class="- topic/p "> 当 <codeph class="+ topic/ph pr-d/codeph ">bufferTimeMax > 0</codeph>，并且 <codeph class="+ topic/ph pr-d/codeph ">bufferLength >= bufferTimeMax</codeph> 时，将加快音频的播放速度，直到 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 达到 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph>。如果实时流仅包含视频，则视频播放较快，直到 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 达到 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph>。</p>
    
    <p class="- topic/p ">Flash Player 将捕捉速率控制在 1.5% 和 6.25% 之间，具体取决于播放延迟量（<codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 差异）。如果流中包含音频，通过缩减频率域采样，使音频失真最小化，可以加快播放。</p>
    
    <p class="- topic/p ">设置 <codeph class="+ topic/ph pr-d/codeph ">bufferTimeMax</codeph> 属性可在以下情况下启用实时缓冲流追赶：</p>
    
    <ul class="- topic/ul "><li class="- topic/li ">以数据流的方式从 Flash Media Server 传输实时介质。</li><li class="- topic/li ">以数据流的方式在数据生成模式 (<codeph class="+ topic/ph pr-d/codeph ">NetStream.appendBytes()</codeph>) 下传输实时介质。</li></ul>
    
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/bufferLength" class="- topic/link "><linktext class="- topic/linktext ">bufferLength</linktext></link><link href="flash.net.xml#NetStream/bufferTime" class="- topic/link "><linktext class="- topic/linktext ">bufferTime</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:bufferTime:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bufferTime</apiName><shortdesc class="- topic/shortdesc ">
     指定在开始显示流之前需要多长时间将消息存入缓冲区。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.setBufferTime, setBufferTime
     
     </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定在开始显示流之前需要多长时间将消息存入缓冲区。
     
     <p class="- topic/p ">默认值是 0.1（十分之一秒）。要确定当前位于缓冲区中的秒数，请使用 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 属性。</p>
     
     <p class="- topic/p ">要播放服务器端播放列表，请将 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 设置为至少 1 秒。如果出现播放问题，请增加 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 的长度。
     </p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">录制的内容：</b>若要避免在对预先录制的（非实时）内容进行流处理时失真，不要将 <codeph class="+ topic/ph pr-d/codeph ">Netstream.bufferTime</codeph> 的值设置为 0。对于预先录制的内容，默认情况下应用程序将使用输入缓冲区对媒体数据进行排队并正确播放媒体。对于预先录制的内容，请使用默认设置或延长缓冲时间。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">实时内容：</b>对实时内容进行流处理时，请将 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 属性设置为 0。</p>
     
     <p class="- topic/p ">从 Flash Player 9.0.115.0 开始，在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.pause()</codeph> 时，Flash Player 不再清除缓冲区。在 Flash Player 9.0.115.0 之前，恢复播放之前 Flash Player 将等待缓冲区填满，这通常会导致延迟。</p>
         
         <p class="- topic/p ">对于一次暂停，<codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferLength</codeph> 属性的限值为 60 秒或二倍的 <codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferTime</codeph> 值（取二者之中的较大值）。例如，如果 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 为 20 秒，在 <codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferLength</codeph> 为较大值 20~~2 (40) 或 60 之前，Flash Player 将一直进行缓冲。在本例中，在 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 为 60 之前，Flash Player 将一直进行缓冲。如果 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 为 40 秒，在 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 为较大值 40~~2 (80) 或 60 之前，Flash Player 将一直进行缓冲。在本例中，在 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 为 80 秒之前，Flash Player 将一直进行缓冲。</p>
         
         <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 属性还有一个绝对限制。如果对 <codeph class="+ topic/ph pr-d/codeph ">pause()</codeph> 的任何调用导致 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 增大到 600 秒以上或 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> * 2 的值（取二者中的较大值），Flash Player 将刷新缓冲区并将 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 重置为 0。例如，如果 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 为 120 秒，当 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 达到 600 秒时，Flash Player 将刷新缓冲区；如果 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 为 360 秒，当 <codeph class="+ topic/ph pr-d/codeph ">bufferLength</codeph> 达到 720 秒时，Flash Player 将刷新缓冲区。</p>
         
         <p class="- topic/p "><b class="+ topic/ph hi-d/b ">提示</b>：例如，在查看器监视商用版的同时，可以在代码中使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.pause()</codeph> 来缓冲数据，然后在开始播放主视频时取消暂停。</p>
         
         <p class="- topic/p ">有关新的暂停行为的详细信息，请参阅 <xref href="http://www.adobe.com/go/learn_fms_smartpause_cn" scope="external" class="- topic/xref ">http://www.adobe.com/go/learn_fms_smartpause_cn</xref>。</p>
     <p class="- topic/p ">
     <b class="+ topic/ph hi-d/b ">Flash Media Server</b>。缓冲行为取决于缓冲时间是在发布流还是订阅流中设置的。对于发布流，<codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 指定在应用程序开始删除帧之前传出缓冲区可以增长多长时间。在高速连接上，不必担心缓冲时间问题；发送数据的速度几乎与应用程序将数据存入缓冲区一样快。但在速度较慢的连接上，应用程序将数据存入缓冲区与将数据发送到客户端的速度可能会有很大差异。
     </p>
     
     <p class="- topic/p ">
     对于订阅流，<codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 指定在开始显示流之前需要花多长时间将传入数据存入缓冲区。
     </p>
     
     <p class="- topic/p ">
     在播放录制流时，如果 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 为 0，Flash 会将其设置为较小的值（大约为 10 毫秒）。如果以后播放实时流（例如，从播放列表中），则会永久保留此缓冲时间。即，流的 <codeph class="+ topic/ph pr-d/codeph ">bufferTime</codeph> 始终为非零值。
     </p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/backBufferTime" class="- topic/link "><linktext class="- topic/linktext ">backBufferTime</linktext></link><link href="flash.net.xml#NetStream/bufferLength" class="- topic/link "><linktext class="- topic/linktext ">bufferLength</linktext></link><link href="flash.net.xml#NetStream/bufferTimeMax" class="- topic/link "><linktext class="- topic/linktext ">bufferTimeMax</linktext></link><link href="flash.net.xml#NetStream/time" class="- topic/link "><linktext class="- topic/linktext ">time</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:bytesLoaded:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesLoaded</apiName><shortdesc class="- topic/shortdesc ">
     已加载到应用程序中的数据的字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.bytesLoaded, bytesLoaded
     
     </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     已加载到应用程序中的数据的字节数。您可以将此属性与 <codeph class="+ topic/ph pr-d/codeph ">bytesTotal</codeph> 属性一起使用，以评估缓冲区将近填满的程度；例如，向正等待数据加载到缓冲区中的用户显示反馈。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/bytesTotal" class="- topic/link "><linktext class="- topic/linktext ">bytesTotal</linktext></link><link href="flash.net.xml#NetStream/bufferLength" class="- topic/link "><linktext class="- topic/linktext ">bufferLength</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:bytesTotal:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesTotal</apiName><shortdesc class="- topic/shortdesc ">
     正加载到应用程序中的文件的总大小（以字节为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.bytesTotal, bytesTotal
     </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     正加载到应用程序中的文件的总大小（以字节为单位）。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/bytesLoaded" class="- topic/link "><linktext class="- topic/linktext ">bytesLoaded</linktext></link><link href="flash.net.xml#NetStream/bufferTime" class="- topic/link "><linktext class="- topic/linktext ">bufferTime</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:checkPolicyFile:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">checkPolicyFile</apiName><shortdesc class="- topic/shortdesc ">
     指定应用程序在开始加载视频文件之前，是否尝试从所加载视频文件的服务器中下载跨域策略文件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>: please review at same time: checkPolicyFile property in LoaderContext
     </internal></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定应用程序在开始加载视频文件之前，是否尝试从所加载视频文件的服务器中下载跨域策略文件。使用此属性进行渐进式视频下载并加载位于进行调用的 SWF 文件所在的域外部的文件。当使用 RTMP 时，忽略此属性。
     
     <p class="- topic/p ">将此属性设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 以对从进行调用的 SWF 外部的域中加载的视频文件调用 <codeph class="+ topic/ph pr-d/codeph ">BitmapData.draw()</codeph>。<codeph class="+ topic/ph pr-d/codeph ">BitmapData.draw()</codeph> 方法提供对视频的像素级访问。在加载时未将 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 的情况下，如果调用 <codeph class="+ topic/ph pr-d/codeph ">BitmapData.draw()</codeph>，可能会收到一个 <codeph class="+ topic/ph pr-d/codeph ">SecurityError</codeph> 异常，因为没有下载所需的策略文件。</p>
     
     <p class="- topic/p ">不要将此属性设置为 true，除非您希望对正在加载的视频进行像素级访问。检查策略文件会占用网络带宽，并可能延迟下载的开始时间。</p>
     
     <p class="- topic/p ">当您调用 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 的 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法时，<ph class="- topic/ph ">Flash Player 或</ph> AIR 运行时要么成功下载相关的跨域策略文件，要么在下载之前确定没有可下载的这类策略文件。为了确认是否存在策略文件，<ph class="- topic/ph ">Flash Player 或 </ph>AIR 运行时将执行以下操作，具体顺序如下：</p>
     
     <ol class="- topic/ol "><li class="- topic/li ">应用程序考虑已经下载的策略文件。</li><li class="- topic/li ">应用程序尝试下载在 <codeph class="+ topic/ph pr-d/codeph ">Security.loadPolicyFile()</codeph> 方法调用中指定的任何未处理的策略文件。</li><li class="- topic/li ">应用程序尝试从与传递给 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 的 URL 相对应的默认位置下载策略文件，在与该 URL 所在的同一台服务器上，该默认位置为 <codeph class="+ topic/ph pr-d/codeph ">/crossdomain.xml</codeph>。</li></ol>
     
     <p class="- topic/p ">在任何情况下，<ph class="- topic/ph ">Flash Player 或</ph> Adobe AIR 要求在视频服务器上必须存在一个相应的策略文件，并且要求它可提供对 URL （您根据策略文件的位置已传递给 <codeph class="+ topic/ph pr-d/codeph ">play()</codeph>）上对象的访问，并且它还允许调用代码文件的域通过一个或多个 <codeph class="+ topic/ph pr-d/codeph ">&lt;allow-access-from></codeph> 标签访问该视频。</p>
     
     <p class="- topic/p ">如果将 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则应用程序会等到策略文件确认完毕才下载视频。等待对视频数据执行任何像素级操作（如调用 <codeph class="+ topic/ph pr-d/codeph ">BitmapData.draw()</codeph>），直至从 NetStream 对象收到 <codeph class="+ topic/ph pr-d/codeph ">onMetaData</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">NetStatus</codeph> 事件。</p>
     
     <p class="- topic/p ">如果将 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，但未找到相关的策略文件，则您只有执行需要策略文件的操作时，才会接收到错误，然后应用程序会引发 SecurityError 异常。</p>
     
     <p class="- topic/p ">如果从使用服务器端 HTTP 重定向的 URL 中下载文件，请谨慎使用 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph>。应用程序尝试检索与您在 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 中指定的初始 URL 对应的策略文件。如果最终文件由于 HTTP 重定向而来自不同的 URL，则最初下载的策略文件可能不适用于该文件的最终 URL，该 URL 对安全决策至关重要。</p>
     
     <p class="- topic/p ">有关策略文件的详细信息，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“网站控制（策略文件）”和 Flash Player 开发人员中心主题<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.display.xml#BitmapData/draw()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.BitmapData.draw()</linktext></link><link href="flash.system.xml#Security/loadPolicyFile()" class="- topic/link "><linktext class="- topic/linktext ">flash.system.Security.loadPolicyFile()</linktext></link><link href="flash.net.xml#NetStream/event:netStatus" class="- topic/link "><linktext class="- topic/linktext ">netStatus</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData" class="- topic/link "><linktext class="- topic/linktext ">onMetaData</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:client:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">client</apiName><shortdesc class="- topic/shortdesc ">
     指定对其调用回调方法以处理流或 F4V/FLV 文件数据的对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">必须将 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性设置为非空对象。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">TypeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">TypeError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定对其调用回调方法以处理流或 F4V/FLV 文件数据的对象。默认对象为 <codeph class="+ topic/ph pr-d/codeph ">this</codeph>，将创建 NetStream 对象。如果将 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性设置为另一个对象，则将对该对象调用回调方法。<codeph class="+ topic/ph pr-d/codeph ">NetStream.client </codeph> 对象可调用下列函数并接收关联数据对象：<codeph class="+ topic/ph pr-d/codeph ">onCuePoint()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">onImageData()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">onMetaData()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">onPlayStatus()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">onSeekPoint()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">onTextData()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">onXMPData()</codeph>。
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">将 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性与事件处理函数相关联：</b></p>
     <p class="- topic/p "><ol class="- topic/ol "><li class="- topic/li ">创建一个对象并将其分配给 NetStream 对象的 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性：
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     var customClient:Object = new Object();
     my_netstream.client = customClient;
     </codeblock>
     </li><li class="- topic/li ">为所需数据事件分配一个处理函数作为客户端对象的属性：
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     customClient.onImageData = onImageDataHandler;
     </codeblock>
     </li><li class="- topic/li ">编写处理函数以接收数据事件对象，比如：
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
      public function onImageDataHandler(imageData:Object):void {
              trace("imageData length: " + imageData.data.length);
      }
     </codeblock></li></ol></p>
     <p class="- topic/p ">当数据经过流或在播放过程中传递时，将用该数据填充数据事件对象（本例中为 <codeph class="+ topic/ph pr-d/codeph ">imageData</codeph> 对象）。请参阅 <codeph class="+ topic/ph pr-d/codeph ">onImageData</codeph> 的描述，其中包括一个分配给 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性的对象的完整示例。</p>
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">将 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性与子类相关联：</b></p>
     <p class="- topic/p "><ol class="- topic/ol "><li class="- topic/li ">用处理函数创建一个子类以接收数据事件对象：
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     class CustomClient {
        public function onMetaData(info:Object):void {
            trace("metadata: duration=" + info.duration + " framerate=" + info.framerate);
     }
     </codeblock>
     </li><li class="- topic/li ">将子类的实例分配给 NetStream 对象的 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性：
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     my_netstream.client = new CustomClient();
     </codeblock>
     </li></ol></p>
     <p class="- topic/p ">当数据经过流或在播放过程中传递时，将用该数据填充数据事件对象（本例中为 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 对象）。请参阅 NetStream 类末尾的类示例，该示例演示了将一个子类实例分配给 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性的过程。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/event:onCuePoint" class="- topic/link "><linktext class="- topic/linktext ">onCuePoint</linktext></link><link href="flash.net.xml#NetStream/event:onImageData" class="- topic/link "><linktext class="- topic/linktext ">onImageData</linktext></link><link href="flash.net.xml#NetStream/event:onMetaData" class="- topic/link "><linktext class="- topic/linktext ">onMetaData</linktext></link><link href="flash.net.xml#NetStream/event:onPlayStatus" class="- topic/link "><linktext class="- topic/linktext ">onPlayStatus</linktext></link><link href="flash.net.xml#NetStream/event:onSeekPoint" class="- topic/link "><linktext class="- topic/linktext ">onSeekPoint</linktext></link><link href="flash.net.xml#NetStream/event:onTextData" class="- topic/link "><linktext class="- topic/linktext ">onTextData</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:currentFPS:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">currentFPS</apiName><shortdesc class="- topic/shortdesc ">
     每秒显示的帧的数目。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.currentFPS, currentFPS
     
      </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     每秒显示的帧的数目。如果要导出视频文件以在多个系统上播放，您可以在测试期间检查该值，以帮助确定在导出该文件时应用的压缩量。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:dataReliable:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">dataReliable</apiName><shortdesc class="- topic/shortdesc ">
     
     对于 RTMFP 连接，指定发送 NetStream.send() 调用是否完全可靠。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
     对于 RTMFP 连接，指定发送 <codeph class="+ topic/ph pr-d/codeph ">NetStream.send()</codeph> 调用是否完全可靠。为 TRUE 时，通过此 NetStream 传输的 <codeph class="+ topic/ph pr-d/codeph ">NetStream.send()</codeph> 调用完全可靠。当为 FALSE 时，传输的 <codeph class="+ topic/ph pr-d/codeph ">NetStream.send()</codeph> 调用不完全可靠，但将在有限的时间内重新传输该调用，然后删除该调用。可将此值设置为 FALSE 以减少延迟，但这是以牺牲数据质量为代价的。
     
     <p class="- topic/p ">如果您基于不支持部分可靠性的网络协议，尝试将此属性设置为 FALSE，则尝试将被忽略并将属性设置为 TRUE。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/audioReliable" class="- topic/link "><linktext class="- topic/linktext ">audioReliable</linktext></link><link href="flash.net.xml#NetStream/send()" class="- topic/link "><linktext class="- topic/linktext ">send()</linktext></link><link href="flash.net.xml#NetStream/videoReliable" class="- topic/link "><linktext class="- topic/linktext ">videoReliable</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:farID:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">farID</apiName><shortdesc class="- topic/shortdesc ">
     对于 RTMFP 连接，为连接到此 NetStream 实例的远端标识符。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于 RTMFP 连接，为连接到此 NetStream 实例的远端标识符。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:farNonce:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">farNonce</apiName><shortdesc class="- topic/shortdesc ">
     对于 RTMFP 和 RTMPE 连接，为此流的另一端实际选择的值，对此连接具有唯一性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于 RTMFP 和 RTMPE 连接，为此流的另一端实际选择的值，对此连接具有唯一性。此值出现在流的另一端作为其 <codeph class="+ topic/ph pr-d/codeph ">nearNonce</codeph> 值。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:inBufferSeek:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">inBufferSeek</apiName><shortdesc class="- topic/shortdesc ">
    指定显示的数据是否进行缓存以供智能搜索，是为 TRUE，否为 FALSE。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>The following links work only if qualified with NetStream. We don't know why.
    </internal></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    指定显示的数据是否进行缓存以供智能搜索，是为 <codeph class="+ topic/ph pr-d/codeph ">TRUE</codeph>，否为 <codeph class="+ topic/ph pr-d/codeph ">FALSE</codeph>。默认值为 FALSE。
    
    <p class="- topic/p "> Flash Media Server 3.5.3 与 Flash Player 10.1 配合使用时，支持智能搜索。智能搜索使用后退和前进缓冲进行搜索，不从服务器请求数据。标准搜索根据搜索时间刷新缓冲数据并要求服务器发送新数据。</p>
    
    <p class="- topic/p ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.step()</codeph> 以前进或后退指定的帧数。调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.seek()</codeph> 以向前和向后搜索指定的秒数。</p>
    
    <p class="- topic/p ">智能搜索可降低服务器负载并改进搜索性能。设置 <codeph class="+ topic/ph pr-d/codeph ">inBufferSeek=true</codeph> 并调用 <codeph class="+ topic/ph pr-d/codeph ">step()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">seek()</codeph> 以创建：</p>
    
    <ul class="- topic/ul "><li class="- topic/li ">客户端 DVR 功能。在客户端缓冲内搜索，而不必请求服务器发送新视频。</li><li class="- topic/li ">技巧模式。创建可逐帧进退、快进、快退和慢运作前进的播放器。</li></ul>
    
    <p class="- topic/p ">当 <codeph class="+ topic/ph pr-d/codeph ">inBufferSeek=true</codeph> 并且调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.seek()</codeph> 成功时，NetStatusEvent <codeph class="+ topic/ph pr-d/codeph ">info.description</codeph> 属性包含字符串 <codeph class="+ topic/ph pr-d/codeph ">"client-inBufferSeek"</codeph>。</p>
    
    <p class="- topic/p ">当调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.step()</codeph> 成功时，NetStatusEvent <codeph class="+ topic/ph pr-d/codeph ">info.code</codeph> 属性包含字符串 <codeph class="+ topic/ph pr-d/codeph ">"NetStream.Step.Notify"</codeph>。</p>
    
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/backBufferTime" class="- topic/link "><linktext class="- topic/linktext ">backBufferTime</linktext></link><link href="flash.net.xml#NetStream/backBufferLength" class="- topic/link "><linktext class="- topic/linktext ">backBufferLength</linktext></link><link href="flash.net.xml#NetStream/bufferTime" class="- topic/link "><linktext class="- topic/linktext ">bufferTime</linktext></link><link href="flash.net.xml#NetStream/bufferLength" class="- topic/link "><linktext class="- topic/linktext ">bufferLength</linktext></link><link href="flash.net.xml#NetStream/step()" class="- topic/link "><linktext class="- topic/linktext ">step()</linktext></link><link href="flash.net.xml#NetStream/seek()" class="- topic/link "><linktext class="- topic/linktext ">seek()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:info:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">info</apiName><shortdesc class="- topic/shortdesc ">
     返回一个 NetStreamInfo 对象，其属性包含有关服务质量的统计信息。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.net:NetStreamInfo</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回一个 NetStreamInfo 对象，其属性包含有关服务质量的统计信息。此对象是当前状态的快照。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamInfo" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStreamInfo</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:liveDelay:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">liveDelay</apiName><shortdesc class="- topic/shortdesc ">
     在实时（未缓冲的）模式下，数据在订阅流的缓冲区中停留的秒数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><category class="- topic/category ">Property
     
     </category></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在实时（未缓冲的）模式下，数据在订阅流的缓冲区中停留的秒数。此属性指定当前的网络传输延迟（延迟时间）。
     
     <p class="- topic/p ">此属性主要用于服务器（如 Flash Media Server）；有关详细信息，请参阅类说明。</p>
     
     <p class="- topic/p ">您可以获取此属性的值来粗略估量流的传输质量，并将其传达给用户。 </p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:maxPauseBufferTime:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">maxPauseBufferTime</apiName><shortdesc class="- topic/shortdesc ">
     指定在暂停模式下需要多长时间（以秒为单位）将消息存入缓冲区。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定在暂停模式下需要多长时间（以秒为单位）将消息存入缓冲区。可以使用此属性来限制暂停模式下进行的缓冲程度。<codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferLength</codeph> 的值一旦到达此限制，就会停止缓冲。
     
     <p class="- topic/p ">如果未设置此值，则将默认值限制为 60 秒或每个暂停的 <codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferTime</codeph> 值的两倍，以较大的值为准。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/bufferTime" class="- topic/link "><linktext class="- topic/linktext ">bufferTime</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:multicastAvailabilitySendToAll:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">multicastAvailabilitySendToAll</apiName><shortdesc class="- topic/shortdesc ">
     对于 RTMFP 连接，指定对等多播片段可用性消息发送到所有同级还是只发送到一个同级。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于 RTMFP 连接，指定对等多播片段可用性消息发送到所有同级还是只发送到一个同级。TRUE 值指定在每个指定的间隔内向所有同级发送一次此消息。FALSE 值指定在每个指定的间隔内仅向一个同级发送此消息。此间隔由 <codeph class="+ topic/ph pr-d/codeph ">multicastAvailabilityUpdatePeriod</codeph> 属性确定。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/multicastAvailabilityUpdatePeriod" class="- topic/link "><linktext class="- topic/linktext ">multicastAvailabilityUpdatePeriod</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:multicastAvailabilityUpdatePeriod:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">multicastAvailabilityUpdatePeriod</apiName><shortdesc class="- topic/shortdesc ">
     对于 RTMFP 连接，指定从消息发送到同级收到本地节点包含新的可用对等多播媒体片段通知的时间间隔（以秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于 RTMFP 连接，指定从消息发送到同级收到本地节点包含新的可用对等多播媒体片段通知的时间间隔（以秒为单位）。较高值可提高批处理效率并减少控制开销，但是它们会在片断位于窗口外之前减少检索片断的时间，从而降低质量。较低值可减少延迟并提高质量，但会增加控制开销。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/multicastAvailabilitySendToAll" class="- topic/link "><linktext class="- topic/linktext ">multicastAvailabilitySendToAll</linktext></link><link href="flash.net.xml#NetStream/multicastFetchPeriod" class="- topic/link "><linktext class="- topic/linktext ">multicastFetchPeriod</linktext></link><link href="flash.net.xml#NetStream/multicastWindowDuration" class="- topic/link "><linktext class="- topic/linktext ">multicastWindowDuration</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:multicastFetchPeriod:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">multicastFetchPeriod</apiName><shortdesc class="- topic/shortdesc ">
     对于 RTMFP 连接，指定从本地节点了解对等多播媒体片段可用到其尝试从同级获取该片段的时间（以秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于 RTMFP 连接，指定从本地节点了解对等多播媒体片段可用到其尝试从同级获取该片段的时间（以秒为单位）。通过此值，可在尝试从同级获取片段之前，将该片段主动推入本地节点。它也允许多个同级通知片断的可用性，因此可在多个同级之间扩展提取加载。
     
     <p class="- topic/p ">较高值可提高负载平衡和同级网格中的清晰度，但会减少可用的 <codeph class="+ topic/ph pr-d/codeph ">multicastWindowDuration</codeph> 并增加延迟。较低值可减少需要提取时的延迟，但可能会增加重复的数据接收并降低同级网格负载平衡。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/multicastAvailabilityUpdatePeriod" class="- topic/link "><linktext class="- topic/linktext ">multicastAvailabilityUpdatePeriod</linktext></link><link href="flash.net.xml#NetStream/multicastWindowDuration" class="- topic/link "><linktext class="- topic/linktext ">multicastWindowDuration</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:multicastInfo:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">multicastInfo</apiName><shortdesc class="- topic/shortdesc ">
     对于 RTMFP 连接，返回一个 NetStreamMulticastInfo 对象，其属性包含有关服务质量的统计数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.net:NetStreamMulticastInfo</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于 RTMFP 连接，返回一个 NetStreamMulticastInfo 对象，其属性包含有关服务质量的统计数据。此对象是当前状态的快照。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamMulticastInfo" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStreamMulticastInfo</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:multicastPushNeighborLimit:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">multicastPushNeighborLimit</apiName><shortdesc class="- topic/shortdesc ">
     对于 RTMFP 连接，指定主动将多播媒体推入其中的最大同级数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于 RTMFP 连接，指定主动将多播媒体推入其中的最大同级数。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:multicastRelayMarginDuration:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">multicastRelayMarginDuration</apiName><shortdesc class="- topic/shortdesc ">
     对于 RTMFP 连接，指定从对等多播数据保持可用到发送到请求超出指定持续时间的同级的持续时间（以秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于 RTMFP 连接，指定从对等多播数据保持可用到发送到请求超出指定持续时间的同级的持续时间（以秒为单位）。持续时间由 <codeph class="+ topic/ph pr-d/codeph ">multicastWindowDuration</codeph> 属性指定。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/multicastWindowDuration" class="- topic/link "><linktext class="- topic/linktext ">multicastWindowDuration</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:multicastWindowDuration:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">multicastWindowDuration</apiName><shortdesc class="- topic/shortdesc ">
     对于 RTMFP 连接，指定对等多播重组窗口的持续时间（以秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于 RTMFP 连接，指定对等多播重组窗口的持续时间（以秒为单位）。较短值可减少延迟，但可能会因为不允许使用足够的时间获取所有片断而降低质量。相反，较大值可能会因为提供更多获取所有片断的时间而提高质量，但相应地也会增加延迟。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/multicastRelayMarginDuration" class="- topic/link "><linktext class="- topic/linktext ">multicastRelayMarginDuration</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:nearNonce:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">nearNonce</apiName><shortdesc class="- topic/shortdesc ">
     对于 RTMFP 和 RTMPE 连接，为流的这一端实际选择的值，对此连接具有唯一性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于 RTMFP 和 RTMPE 连接，为流的这一端实际选择的值，对此连接具有唯一性。此值出现在流的另一端作为其 <codeph class="+ topic/ph pr-d/codeph ">farNonce</codeph> 值。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:objectEncoding:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">objectEncoding</apiName><shortdesc class="- topic/shortdesc ">
     此 NetStream 对象的对象编码（AMF 版本）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此 NetStream 对象的对象编码（AMF 版本）。NetStream 对象从关联的 NetConnection 对象继承了它的 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 值。如果 ActionScript 3.0 SWF 文件需要与在 Flash Player 9 之前发布的服务器进行通信，则了解此属性非常重要。有关详细信息，请参阅 NetConnection 类中 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性的描述。
     
     <p class="- topic/p ">此属性的值取决于流是本地还是远程的。本地流返回 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.defaultObjectEncoding</codeph> 的值。在这些流上，<codeph class="+ topic/ph pr-d/codeph ">null</codeph> 被传递给 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph> 方法。远程流返回与服务器建立的连接的对象编码。通过远程流连接到服务器。</p>
     
     <p class="- topic/p ">如果您在未连接时就尝试读取此属性，或者尝试更改此属性，则应用程序将引发一个异常。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection/objectEncoding" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection.objectEncoding</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:peerStreams:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">peerStreams</apiName><shortdesc class="- topic/shortdesc ">
     
     一个对象，其中容纳了侦听此发布方 NetStream 实例的所有订阅方 NetStream 实例。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Array</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
     一个对象，其中容纳了侦听此发布方 NetStream 实例的所有订阅方 NetStream 实例。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStream:soundTransform:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">soundTransform</apiName><shortdesc class="- topic/shortdesc ">
     在此 NetStream 对象中控制声音。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.media:SoundTransform</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在此 NetStream 对象中控制声音。有关详细信息，请参阅 SoundTransform 类。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#SoundTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.media.SoundTransform</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:time:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">time</apiName><shortdesc class="- topic/shortdesc ">
     播放头的位置（以秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetStream.time, time
     
     </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     播放头的位置（以秒为单位）。
     <p class="- topic/p ">
     <b class="+ topic/ph hi-d/b ">Flash Media Server</b> 对于订阅流，是指流已播放的秒数。对于发布流，是指流已发布的秒数。此数字精确到千分位；将其乘以 1000 可得出流已播放的毫秒数。
     </p>
     <p class="- topic/p ">
     对于订阅流，如果服务器停止发送数据，但流保持打开，则 <codeph class="+ topic/ph pr-d/codeph ">time</codeph> 属性的值将停止增加。当服务器再次开始发送数据时，该值将继续增加，起始位置为上次停止处（服务器停止发送数据时）。
     </p>
     <p class="- topic/p ">
     当流从一个播放列表元素切换到另一个播放列表元素时，<codeph class="+ topic/ph pr-d/codeph ">time</codeph> 的值将继续增加。如果调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 并将 <codeph class="+ topic/ph pr-d/codeph ">reset</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">1</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，或者调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.close()</codeph>，则会将此属性设置为 0。
     </p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/bufferLength" class="- topic/link "><linktext class="- topic/linktext ">bufferLength</linktext></link><link href="flash.net.xml#NetStream/bytesLoaded" class="- topic/link "><linktext class="- topic/linktext ">bytesLoaded</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:videoReliable:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">videoReliable</apiName><shortdesc class="- topic/shortdesc ">
     
     对于 RTMFP 连接，指定视频发送是否具有完全可靠性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
     对于 RTMFP 连接，指定视频发送是否具有完全可靠性。为 TRUE 时，通过此 NetStream 传输的所有视频完全可靠。为 FALSE 时，传输的视频不完全可靠，但将在有限的时间内重新传输该视频，然后删除该视频。可使用此 FALSE 值减少延迟，但会以牺牲视频质量为代价。
     
     <p class="- topic/p ">如果您基于不支持部分可靠性的网络协议，尝试将此属性设置为 FALSE，则尝试将被忽略并将属性设置为 TRUE。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/audioReliable" class="- topic/link "><linktext class="- topic/linktext ">audioReliable</linktext></link><link href="flash.net.xml#NetStream/dataReliable" class="- topic/link "><linktext class="- topic/linktext ">dataReliable</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStream:videoSampleAccess:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">videoSampleAccess</apiName><shortdesc class="- topic/shortdesc ">
     
     对于 RTMFP 连接，指定是否允许此 NetStream 中的对等订户捕获视频流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
     对于 RTMFP 连接，指定是否允许此 NetStream 中的对等订户捕获视频流。当为 FALSE 时，订阅者尝试捕获此视频流将显示权限错误。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/audioSampleAccess" class="- topic/link "><linktext class="- topic/linktext ">audioSampleAccess</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetMonitor" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetMonitor</apiName><shortdesc class="- topic/shortdesc ">
 使用 NetMonitor 类可以监视应用程序使用的 NetStream 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.3" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="2.7" name="Flash" version="AIR" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 使用 NetMonitor 类可以监视应用程序使用的 NetStream 对象。
 
 <p class="- topic/p ">使用 NetMonitor 类可以获取应用程序中正在使用的 NetStream 对象的当前列表。每当创建新的 NetStream 对象时，此类的实例都会调度 <codeph class="+ topic/ph pr-d/codeph ">netStreamCreate</codeph> 事件。</p>
 
 <p class="- topic/p ">可以使用 NetMonitor 类帮助跟踪视频播放和相关事件，而不考虑正在使用的具体视频播放器。当实现媒体度量、分析和使用情况跟踪库时，此工具可能非常有用。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b "/></p>
 
 </apiDesc><example conref="examples\NetMonitorExample.as" class="- topic/example "> 本例演示了如何使用 NetMonitor 类获取对 NetStream 信息的访问权，而无需清楚地了解正在使用的具体视频播放器。这里，使用的是 Open Screen Media Framework (OSMF) 项目中的 MediaPlayerSprite 类，但可以替换为任何视频播放器。
 
 <p class="- topic/p ">可以使用空格键暂停或取消暂停本例中的视频，使用向右和向左箭头键向前或向后查找 30 秒，了解这些操作对已调度事件的效果。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package
{
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.KeyboardEvent;
    import flash.events.NetDataEvent;
    import flash.events.NetMonitorEvent;
    import flash.events.NetStatusEvent;
    import flash.net.NetMonitor;
    import flash.net.NetStream;
    import flash.ui.Keyboard;
    
    import org.osmf.elements.VideoElement;
    import org.osmf.media.MediaPlayer;
    import org.osmf.media.MediaPlayerSprite;
    import org.osmf.net.DynamicStreamingItem;
    import org.osmf.net.DynamicStreamingResource;

    public class NetMonitorExample extends Sprite
    {
        private var netmon:NetMonitor;
        private var mediaPlayer:MediaPlayer;
        
        public function NetMonitorExample()
        {
            //Configure stage
            this.stage.align = StageAlign.TOP_LEFT;
            this.stage.scaleMode = StageScaleMode.NO_SCALE;
             
            //Create NetMonitor object
            netmon = new flash.net.NetMonitor();
            netmon.addEventListener(NetMonitorEvent.NET_STREAM_CREATE, newNetStream );    
            
            //Setup video player
            var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
            var videoElement:VideoElement = new VideoElement();
            var dynResource:DynamicStreamingResource = new DynamicStreamingResource( "rtmp://cp67126.edgefcs.net/ondemand" );
            
            dynResource.streamItems = Vector.&lt;DynamicStreamingItem>(
                [     new DynamicStreamingItem( "mp4:mediapm/ovp/content/demo/video/elephants_dream/elephants_dream_768x428_24.0fps_408kbps.mp4", 408, 768, 428 )
                    , new DynamicStreamingItem( "mp4:mediapm/ovp/content/demo/video/elephants_dream/elephants_dream_768x428_24.0fps_608kbps.mp4", 608, 768, 428 )
                    , new DynamicStreamingItem( "mp4:mediapm/ovp/content/demo/video/elephants_dream/elephants_dream_1024x522_24.0fps_908kbps.mp4", 908, 1024, 522 )
                    , new DynamicStreamingItem( "mp4:mediapm/ovp/content/demo/video/elephants_dream/elephants_dream_1024x522_24.0fps_1308kbps.mp4", 1308, 1024, 522 )
                    , new DynamicStreamingItem( "mp4:mediapm/ovp/content/demo/video/elephants_dream/elephants_dream_1280x720_24.0fps_1708kbps.mp4", 1708, 1280, 720 )
                ]);
            
            videoElement.resource = dynResource;
            
            addChild( mediaPlayerSprite );
            mediaPlayerSprite.media = videoElement;  
            mediaPlayer = mediaPlayerSprite.mediaPlayer;
            this.stage.addEventListener( KeyboardEvent.KEY_DOWN, keyControl ); 
        }    
        
        //On new NetStream
        private function newNetStream( event:NetMonitorEvent ):void
        {
            trace( "New Netstream object ");
            var stream:NetStream = event.netStream;
            stream.addEventListener(NetDataEvent.MEDIA_TYPE_DATA, onStreamData);
            stream.addEventListener(NetStatusEvent.NET_STATUS, onStatus);
        }
        
        //On data events from a NetStream object 
        private function onStreamData( event:NetDataEvent ):void
        {
            trace( "Data event at " + event.timestamp );
            var netStream:NetStream = event.target as NetStream;
            switch( event.info.handler )
            {
                case "onMetaData":
                    trace( "--MetaData: " +  stringify( netStream.info.metaData ));
                    break;
                case "onXMPData":
                    trace( "--XMPData: " + stringify( netStream.info.xmpData ));
                    break;
                default:
                    trace( "--" + event.info.handler + ": " + stringify(event.info.args[0]) );
                    
            }
        }
        
        //On status events from a NetStream object
        private function onStatus( event:NetStatusEvent ):void
        {
            trace( "Status: " + stringify( event.info ) );
        }
        
        //Utility function to print out object properties
        private function stringify( object:Object ):String
        {
            var string:String = "";
            
            var prop:String;
            var comma:Boolean = false;
            for ( prop in object )
            {
                if( comma ) string += ", ";
                else comma = true;
                
                if( typeof(object[prop]) == "object" ) 
                {
                    stringify( object[prop] )
                } else    string +=  prop + " = " + object[prop];
            }
            return string;
        }
        
        //Simple keyboard control for the video player
        private function keyControl( event:KeyboardEvent ):void
        {
            switch ( event.keyCode )
            {
                case Keyboard.SPACE:
                    if( mediaPlayer.paused ) mediaPlayer.play();
                    else mediaPlayer.pause();
                    break;
                case Keyboard.RIGHT:
                    mediaPlayer.seek( mediaPlayer.currentTime + 30 );
                    break;
                case Keyboard.LEFT:
                    mediaPlayer.seek( mediaPlayer.currentTime - 30 );
                    break;
                default:
                    //do nothing
            }
        }    
    }
} 
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream" class="- topic/link "><linktext class="- topic/linktext ">NetStream</linktext></link></related-links><adobeApiEvent id="flash.net:NetMonitor_flash.events.NetMonitorEvent.NET_STREAM_CREATE_netStreamCreate" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">netStreamCreate</apiName><shortdesc class="- topic/shortdesc ">
 在此·NetMonitor 实例的安全上下文中创建新的 NetStream 对象时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.3" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="2.7" name="Flash" version="AIR" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.NetMonitorEvent.NET_STREAM_CREATE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.NetMonitorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在此·NetMonitor 实例的安全上下文中创建新的 NetStream 对象时调度。
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果当前平台不支持 NetStream 监视，则不会调度 <codeph class="+ topic/ph pr-d/codeph ">netStreamCreate</codeph> 事件。</p>
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.net:NetMonitor:listStreams" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">listStreams</apiName><shortdesc class="- topic/shortdesc ">
	 检索属于此 NetMonitor 对象的安全上下文的所有 NetStream 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.3" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="2.7" name="Flash" version="AIR" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">NetStream 对象的矢量。
 	</apiDesc><apiType value="Vector$flash.net:NetStream" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 检索属于此 NetMonitor 对象的安全上下文的所有 NetStream 对象。
 	 
 	 <p class="- topic/p ">避免缓存 NetStream 对象的列表。</p>
 	  
	 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果当前平台上不支持 NetStream 监视，则此函数返回的列表始终为空。</p>
	 
 	 </apiDesc></apiOperationDetail></apiOperation></apiClassifier><apiClassifier languages="" id="flash.net:NetStreamInfo" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetStreamInfo</apiName><shortdesc class="- topic/shortdesc ">
 
 NetStreamInfo 类指定与 NetStream 对象以及音频、视频和数据的基础流缓冲区相关的各种服务质量 (QOS) 统计数据和其他信息。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 
 NetStreamInfo 类指定与 NetStream 对象以及音频、视频和数据的基础流缓冲区相关的各种服务质量 (QOS) 统计数据和其他信息。在响应 <codeph class="+ topic/ph pr-d/codeph ">NetStream.info</codeph> 调用时将返回 NetStreamInfo 对象，该调用获取当前 QOS 状态的快照并通过 NetStreamInfo 属性提供 QOS 统计数据。
 
 </apiDesc></apiClassifierDetail><apiOperation id="flash.net:NetStreamInfo:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc ">
     返回列出 NetStreamInfo 对象属性的文本值。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个字符串，它包含 NetStreamInfo 对象的属性值
     
     
      </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">返回列出此 NetStreamInfo 对象属性的文本值。
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回列出 NetStreamInfo 对象属性的文本值。
     
     </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:NetStreamInfo:SRTT:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">SRTT</apiName><shortdesc class="- topic/shortdesc ">
     NetStream 会话的平滑往返行程时间 (SRTT)（以毫秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     NetStream 会话的平滑往返行程时间 (SRTT)（以毫秒为单位）。此属性仅包含 RTMFP 流的有效值。对于 RTMP 流，该值为 0。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:audioBufferByteLength:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">audioBufferByteLength</apiName><shortdesc class="- topic/shortdesc ">
     提供 NetStream 音频缓冲区大小，以字节为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     提供 NetStream 音频缓冲区大小，以字节为单位。它指定用于实时流和录制流媒体中的音频数据的缓冲区大小。此属性类似于 <codeph class="+ topic/ph pr-d/codeph ">Netstream.bytesLoaded</codeph>，后者用于渐进式下载。
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:audioBufferLength:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">audioBufferLength</apiName><shortdesc class="- topic/shortdesc ">
     提供 NetStream 音频缓冲区大小，以秒为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     提供 NetStream 音频缓冲区大小，以秒为单位。此属性扩展 <codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferLength</codeph> 属性并特别针对音频数据提供以时间表示的缓冲区长度。
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:audioByteCount:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">audioByteCount</apiName><shortdesc class="- topic/shortdesc ">
     指定已到达队列的音频字节总数，这与已播放或已刷新的字节数无关。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定已到达队列的音频字节总数，这与已播放或已刷新的字节数无关。可使用此值计算传入音频数据的速率（使用您选择的度量单位），方法是创建一个计时器并计算连续计时器调用之间的值差异。或者使用 <codeph class="+ topic/ph pr-d/codeph ">audioBytesPerSecond</codeph>。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamInfo/audioBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">audioBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:audioBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">audioBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定填充 NetStream 音频缓冲区的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定填充 NetStream 音频缓冲区的速率，以每秒字节数为单位。作为最后一秒内接收的音频数据的平均值计算该值。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:audioLossRate:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">audioLossRate</apiName><shortdesc class="- topic/shortdesc ">
     指定 NetStream 会话的音频丢失。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定 NetStream 会话的音频丢失。此值仅对 RTMFP 流返回有效值，对 RTMP 流返回 0。丢失率是指丢失的消息数与总消息数的比率。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:byteCount:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">byteCount</apiName><shortdesc class="- topic/shortdesc ">
     指定已到达队列的总字节数，这与已播放或已刷新的字节数无关。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定已到达队列的总字节数，这与已播放或已刷新的字节数无关。可使用此值计算传入数据的速率（使用您选择的度量单位），方法是创建一个计时器并计算连续计时器调用之间的值差异。或者使用 <codeph class="+ topic/ph pr-d/codeph ">currentBytesPerSecond</codeph>。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamInfo/currentBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">currentBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:currentBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">currentBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定填充 NetStream 缓冲区的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定填充 NetStream 缓冲区的速率，以每秒字节数为单位。作为最后一秒内接收的总数据的平均值计算该值。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:dataBufferByteLength:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">dataBufferByteLength</apiName><shortdesc class="- topic/shortdesc ">
     提供 NetStream 数据缓冲区大小，以字节为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     提供 NetStream 数据缓冲区大小，以字节为单位。它指定用于实时流和录制流媒体中的数据消息的缓冲区大小。此属性类似于 <codeph class="+ topic/ph pr-d/codeph ">Netstream.bytesLoaded</codeph>，后者用于渐进式下载。
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:dataBufferLength:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">dataBufferLength</apiName><shortdesc class="- topic/shortdesc ">
     提供 NetStream 数据缓冲区大小，以秒为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     提供 NetStream 数据缓冲区大小，以秒为单位。此属性扩展 <codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferLength</codeph> 属性，并提供专用于数据消息的以时间表示的缓冲区长度。
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:dataByteCount:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">dataByteCount</apiName><shortdesc class="- topic/shortdesc ">
     指定已到达队列的数据消息的字节总数，这与已播放或已刷新的字节数无关。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定已到达队列的数据消息的字节总数，这与已播放或已刷新的字节数无关。可使用此值计算传入数据消息的速率（使用您选择的度量单位），方法是创建一个计时器并计算连续计时器调用之间的值差异。或者使用 <codeph class="+ topic/ph pr-d/codeph ">dataBytesPerSecond</codeph>。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamInfo/dataBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">dataBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:dataBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">dataBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定填充 NetStream 数据缓冲区的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定填充 NetStream 数据缓冲区的速率，以每秒字节数为单位。作为最后一秒内接收的数据消息的平均值计算该值。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:droppedFrames:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">droppedFrames</apiName><shortdesc class="- topic/shortdesc ">
     返回在当前 NetStream 播放会话中放弃的视频帧数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回在当前 NetStream 播放会话中放弃的视频帧数。
     <p class="- topic/p ">在录制的流式或渐进式下载中，如果视频是高品质或高分辨率高比特率的视频，则在没有足够的系统 CPU 资源时，解码器会在解码所需的每秒帧数时发生滞后。在实时流中，如果滞后时间过长，缓冲区会放弃一些视频帧。此属性指定已放弃的和未正常显示的帧数。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:isLive:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">isLive</apiName><shortdesc class="- topic/shortdesc ">
      播放的媒体是录制的还是实时的。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.3" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2.7" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
      播放的媒体是录制的还是实时的。此属性仅与 RTMP 流相关。对于渐进式下载和 HTTP 动态流，此属性始终为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
      
 	  <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>此属性在 Android 和 Blackberry Tablet OS 上的浏览器的 Flash Player 中或 iOS 上的 AIR 中始终为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。</p>
	  
      </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:maxBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">maxBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定填充 NetStream 缓冲区的最大速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定填充 NetStream 缓冲区的最大速率，以每秒字节数为单位。此值根据 <codeph class="+ topic/ph pr-d/codeph ">NetStream</codeph> 对象最后接收到的消息提供有关客户端网络容量的信息。根据 <codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferTime</codeph> 中指定的缓冲区大小和客户端上的可用带宽，Flash Media Server 会突发填充缓冲区。此属性提供填充客户端缓冲区的最大速率。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:metaData:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">metaData</apiName><shortdesc class="- topic/shortdesc ">
      与正在播放的媒体关联的最新元数据对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.3" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2.7" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
      与正在播放的媒体关联的最新元数据对象。
      
 	  <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>此属性在 Android 和 Blackberry Tablet OS 上的浏览器的 Flash Player 中或 iOS 上的 AIR 中始终为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
	  
      </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:playbackBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">playbackBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     返回流的播放速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回流的播放速率，以每秒字节数为单位。播放缓冲区可以包含各种播放列表的内容。此属性提供的播放速率与当前播放的流的比特率非常接近。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:resourceName:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">resourceName</apiName><shortdesc class="- topic/shortdesc ">
      在调用 NetStream.play() 时使用的资源名称。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.3" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2.7" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">在调用 NetStream.play() 时使用的资源名称。
      </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
      在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 时使用的资源名称。对于渐进式下载，此属性包含完整 URL；对于 RTMP 流，此属性包含资源名称；对于 HTTP 流，此属性包含 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
      
 	  <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>此属性在 Android 和 Blackberry Tablet OS 上的浏览器的 Flash Player 中或 iOS 上的 AIR 中始终为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
	  
	  </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="" invalidHref="flash.media.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.NetStream.play()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:uri:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">uri</apiName><shortdesc class="- topic/shortdesc ">
      调用 NetConnection.connect() 时使用的 URI。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.3" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2.7" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">调用 NetConnection.connect() 时使用的 URI。
	  
      </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
      调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph> 时使用的 URI。对于渐进式下载或 HTTP 流，此值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
      
 	  <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>此属性在 Android 和 Blackberry Tablet OS 上的浏览器的 Flash Player 中或 iOS 上的 AIR 中始终为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
	  
	  </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="" invalidHref="flash.media.xml#NetConnection/uri" class="- topic/link "><linktext class="- topic/linktext ">flash.media.NetConnection.uri</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:videoBufferByteLength:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">videoBufferByteLength</apiName><shortdesc class="- topic/shortdesc ">
     提供 NetStream 视频缓冲区大小，以字节为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     提供 NetStream 视频缓冲区大小，以字节为单位。它指定用于实时流和录制流媒体中的视频数据的缓冲区大小。此属性类似于 <codeph class="+ topic/ph pr-d/codeph ">Netstream.bytesLoaded</codeph>，后者用于渐进式下载。
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:videoBufferLength:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">videoBufferLength</apiName><shortdesc class="- topic/shortdesc ">
     提供 NetStream 视频缓冲区大小，以秒为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     提供 NetStream 视频缓冲区大小，以秒为单位。此属性扩展 <codeph class="+ topic/ph pr-d/codeph ">NetStream.bufferLength</codeph> 属性并特别针对视频数据提供以时间表示的缓冲区长度。
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:videoByteCount:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">videoByteCount</apiName><shortdesc class="- topic/shortdesc ">
     指定已到达队列的视频字节总数，这与已播放或已刷新的字节数无关。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定已到达队列的视频字节总数，这与已播放或已刷新的字节数无关。可使用此值计算传入视频数据的速率（使用您选择的度量单位），方法是创建一个计时器并计算连续计时器调用之间的值差异。或者使用 <codeph class="+ topic/ph pr-d/codeph ">videoBytesPerSecond</codeph>。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamInfo/videoBytesPerSecond" class="- topic/link "><linktext class="- topic/linktext ">videoBytesPerSecond</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamInfo:videoBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">videoBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定填充 NetStream 视频缓冲区的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定填充 NetStream 视频缓冲区的速率，以每秒字节数为单位。作为最后一秒内接收的视频数据的平均值计算该值。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:videoLossRate:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">videoLossRate</apiName><shortdesc class="- topic/shortdesc ">
     提供 NetStream 视频损失率（丢失的消息与全部消息的比例）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     提供 NetStream 视频损失率（丢失的消息与全部消息的比例）。
     
     <p class="- topic/p ">当消息大小小于最大传输单元 (MTU) 时，此值与网络数据包丢失率对应。</p>
     
     <p class="- topic/p ">此属性仅返回 RTMFP 流的有效值。对于 RTMP 流，此属性返回值 0。有关详细信息，请参阅 <xref href="http://www.adobe.com/go/learn_fms_docs_cn" scope="external" class="- topic/xref ">Flash Media Server 文档</xref>。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetStreamInfo:xmpData:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">xmpData</apiName><shortdesc class="- topic/shortdesc ">
      与正在播放的媒体关联的最新 XMP 数据对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.3" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2.7" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
      与正在播放的媒体关联的最新 XMP 数据对象。 
      
 	  <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>此属性在 Android 和 Blackberry Tablet OS 上的浏览器的 Flash Player 中或 iOS 上的 AIR 中始终为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
	  
      </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:URLStream" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">URLStream</apiName><shortdesc class="- topic/shortdesc ">
 URLStream 类提供对下载 URL 的低级访问。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseInterface>flash.utils:IDataInput</apiBaseInterface><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 URLStream 类提供对下载 URL 的低级访问。数据一下载，便可随即为应用程序使用，这和使用 URLLoader 时需要等到整个文件下载完不同。并且 URLStream 类还允许在完成下载前关闭流。已下载文件的内容将作为原始二进制数据提供。
 
 <p class="- topic/p ">在 URLStream 中的读取操作是非阻塞模式的。这意味着您在读取数据之前必须使用 <codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性来确定是否能够获得足够的数据。如果不能获得足够的数据，将引发 <codeph class="+ topic/ph pr-d/codeph ">EOFError</codeph> 异常。</p>
 
 <p class="- topic/p ">在默认情况下，所有二进制数据都是以 Big-endian 格式编码的，并且最高位字节于第一位。</p>
 
 <p class="- topic/p ">适用于通过 URLStream 类进行 URL 下载的安全规则与适用于 URLLoader 对象的规则相同。如有需要也可以下载策略文件。将强制执行本地文件安全规则，并根据需要发出安全警告。</p>

 
 </apiDesc><example conref="examples\URLStreamExample.as" class="- topic/example "> 下例加载一个 SWF 文件，并解析其标头的开始部分以指明压缩和版本号信息。 
 <p class="- topic/p ">为了运行该示例，请在与 SWF 文件相同的目录中放置一个名为 URLStreamExample.swf 的文件。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#URLLoader" class="- topic/link "><linktext class="- topic/linktext ">URLLoader</linktext></link><link href="flash.net.xml#URLRequest" class="- topic/link "><linktext class="- topic/linktext ">URLRequest</linktext></link></related-links><adobeApiEvent id="flash.net:URLStream_flash.events.ProgressEvent.PROGRESS_progress" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">progress</apiName><shortdesc class="- topic/shortdesc ">
 在下载操作过程中收到数据时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.ProgressEvent.PROGRESS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ProgressEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在下载操作过程中收到数据时调度。可以使用 URLStream 类方法立即读取已接收的数据。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLStream/load()" class="- topic/link "><linktext class="- topic/linktext ">URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.Event.OPEN_open" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><shortdesc class="- topic/shortdesc ">
 在加载操作开始时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.OPEN</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在加载操作开始时调度。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLStream/load()" class="- topic/link "><linktext class="- topic/linktext ">URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.IOErrorEvent.IO_ERROR_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><shortdesc class="- topic/shortdesc ">
 在出现输入/输出错误并由此导致加载操作失败时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在出现输入/输出错误并由此导致加载操作失败时调度。 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLStream/load()" class="- topic/link "><linktext class="- topic/linktext ">URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS_httpResponseStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpResponseStatus</apiName><shortdesc class="- topic/shortdesc ">
 在 URLStream.load() 方法调用尝试通过 HTTP 访问数据，并且 Adobe AIR 可以检测并返回请求的状态代码时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 <codeph class="+ topic/ph pr-d/codeph ">URLStream.load()</codeph> 方法调用尝试通过 HTTP 访问数据，并且 Adobe AIR 可以检测并返回请求的状态代码时调度。 
 
 <p class="- topic/p ">如果为 <codeph class="+ topic/ph pr-d/codeph ">httpStatusEvent</codeph> 事件注册了 URLStream 对象，则在传输错误响应时会将其视为内容。因此，在将错误数据加载到 URLStream 中时，URLStream 将调度 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件，而不调度 <codeph class="+ topic/ph pr-d/codeph ">ioError</codeph> 事件。</p>
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLStream/load()" class="- topic/link "><linktext class="- topic/linktext ">URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.HTTPStatusEvent.HTTP_STATUS_httpStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpStatus</apiName><shortdesc class="- topic/shortdesc ">
 在 URLStream.load() 调用尝试通过 HTTP 访问数据，并且 Flash Player 或 Adobe AIR 可以检测并返回请求的状态代码时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.HTTPStatusEvent.HTTP_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 <codeph class="+ topic/ph pr-d/codeph ">URLStream.load()</codeph> 调用尝试通过 HTTP 访问数据，并且 <ph class="- topic/ph ">Flash Player 或 </ph>Adobe AIR 可以检测并返回请求的状态代码时调度。（有些浏览器环境可能无法提供此信息。）请注意，在发送任何 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">error</codeph> 事件之前还将发送 <codeph class="+ topic/ph pr-d/codeph ">httpStatus</codeph>（如果有）。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLStream/load()" class="- topic/link "><linktext class="- topic/linktext ">URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><shortdesc class="- topic/shortdesc ">
 若对 URLStream.load() 的调用尝试从安全沙箱外部的服务器加载数据，则进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 若对 <codeph class="+ topic/ph pr-d/codeph ">URLStream.load()</codeph> 的调用尝试从安全沙箱外部的服务器加载数据，则进行调度。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLStream/load()" class="- topic/link "><linktext class="- topic/linktext ">URLStream.load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:URLStream_flash.events.Event.COMPLETE_complete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">complete</apiName><shortdesc class="- topic/shortdesc ">
 成功加载数据后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.Event.COMPLETE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 成功加载数据后调度。 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.net:URLStream:close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     立即关闭该流并取消下载操作。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法关闭该流，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     立即关闭该流并取消下载操作。无法在调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 方法后从该流中读取数据。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:load" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">load</apiName><shortdesc class="- topic/shortdesc ">
     开始下载 request 参数中指定的 URL。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><codeph class="+ topic/ph pr-d/codeph ">URLRequest.requestHeader</codeph> 对象不能包含某些被禁用的 HTTP 请求标头。有关详细信息，请参阅 URLRequestHeader 类的描述。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">此错误可能由以下原因引起：
     
     <ol class="- topic/ol "><li class="- topic/li ">Flash Player 或 Adobe AIR 无法将 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.data</codeph> 参数从 UTF8 转换为 MBCS。若传递给 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 的 URLRequest 对象设置为执行 <codeph class="+ topic/ph pr-d/codeph ">GET</codeph> 操作并且 <codeph class="+ topic/ph pr-d/codeph ">System.useCodePage</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，就会发生该错误。</li><li class="- topic/li ">Flash Player 或 Adobe AIR 无法为 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 数据分配内存。如果传递给 load 的 URLRequest 对象设置为执行 <codeph class="+ topic/ph pr-d/codeph ">POST</codeph> 操作，将发生该错误。</li></ol>
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">MemoryError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:MemoryError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">本地不受信任的 SWF 文件可能无法与 Internet 进行通信。可通过将此 SWF 文件重新分类为只能与远程内容交互或受信任来解决此问题。
     
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">正在尝试连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">request</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:URLRequest</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 URLRequest 对象，指定要下载的 URL。如果此参数的值或所传递的 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.url</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则应用程序会引发空指针错误。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     开始下载 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> 参数中指定的 URL。
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：如果要加载的文件包含非 ASCII 字符（在许多非英语的语言中出现），则建议使用 UTF-8 或 UTF-16 编码（而不是 ASCII 等非 Unicode 格式）来保存文件。</p>
     
     <p class="- topic/p ">如果加载操作很快失败，将引发描述失败情况的 IOError 或 SecurityError（包括本地文件安全错误）异常。否则，如果 URL 下载开始成功下载，将调度 <codeph class="+ topic/ph pr-d/codeph ">open</codeph> 事件；如果发生错误，将调度错误事件。</p>
     
     <p class="- topic/p ">默认情况下，执行调用的 SWF 文件和加载的 URL 必须在同一域中。例如，位于 www.adobe.com 的 SWF 文件只能从同样位于 www.adobe.com 的源中加载数据。要从不同的域中加载数据，请在承载数据的服务器上放置一个 URL 策略文件。</p>
     
     <p class="- topic/p ">在 Flash Player 中，无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。</p>
     
     <p class="- topic/p ">在 Flash Player 中，可以通过在包含 SWF 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数来禁止 SWF 文件使用此方法。</p>
     
     <p class="- topic/p "> 在 Flash Player 10 和更高版本中以及在 AIR 1.5 和更高版本中，如果使用包含上载（由 POST 正文内“content-disposition”标头中的“filename”参数所指）的 multipart Content-Type（例如“multipart/form-data”），则 POST 操作受应用于上载的安全规则的约束：</p>
     <ul class="- topic/ul "><li class="- topic/li ">必须执行 POST 操作以响应用户启动的操作（如鼠标单击或按键）。</li><li class="- topic/li ">如果 POST 操作是跨域的（POST 目标与发送 POST 请求的 SWF 文件不在同一台服务器上），则目标服务器必须提供一个允许跨域访问的 URL 策略文件。</li></ul>
     <p class="- topic/p ">另外，对于任何 multipart Content-Type，语法必须有效（根据 RFC2046 标准）。如果语法无效，则 POST 操作受应用于上载的安全规则约束。</p>
     
     <p class="- topic/p ">这些规则同样适用于非应用程序沙箱中的 AIR 内容。但在 Adobe AIR 中，应用程序沙箱中的内容（随 AIR 应用程序安装的内容）不受这些安全限制的约束。</p>
     
     <p class="- topic/p ">有关安全性的详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_en" scope="external" class="- topic/xref ">安全性</xref>。</p>
     
     <p class="- topic/p ">在 AIR 中，URLRequest 对象可以注册 <codeph class="+ topic/ph pr-d/codeph ">httpResponse</codeph> 状态事件。与 <codeph class="+ topic/ph pr-d/codeph ">httpStatus</codeph> 事件不同，<codeph class="+ topic/ph pr-d/codeph ">httpResponseStatus</codeph> 事件在传送任何响应数据之前传送。此外，<codeph class="+ topic/ph pr-d/codeph ">httpResponseStatus</codeph> 事件还包括 <codeph class="+ topic/ph pr-d/codeph ">responseHeaders</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">responseURL</codeph> 属性的值（对于 <codeph class="+ topic/ph pr-d/codeph ">httpStatus</codeph>，这些属性未定义）。请注意，在发送任何 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">error</codeph> 事件之前还将发送 <codeph class="+ topic/ph pr-d/codeph ">httpResponseStatus</codeph>（如果有）。 
     </p>
     
     
     <p class="- topic/p ">如果<i class="+ topic/ph hi-d/i ">有</i> <codeph class="+ topic/ph pr-d/codeph ">httpResponseStatus</codeph> 事件侦听器，则<i class="+ topic/ph hi-d/i ">始终</i> 将发送响应消息的正文；而 HTTP 状态代码响应始终将产生 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件。无论 HTTP 响应状态代码表示成功还是错误，这种情况都适用。</p> 
     
     <p class="- topic/p "><ph class="- topic/ph ">在 AIR 中，如果</ph><i class="+ topic/ph hi-d/i ">没有</i> <codeph class="+ topic/ph pr-d/codeph ">httpResponseStatus</codeph> 事件侦听器，则行为因 <ph class="- topic/ph ">SWF</ph> 版本而异：</p>
     
     <ul class="- topic/ul "><li class="- topic/li "><ph class="- topic/ph ">对于 SWF 9 内容</ph>，<i class="+ topic/ph hi-d/i ">只有</i> 在 HTTP 响应状态代码指示成功时才会发送 HTTP 响应消息的正文。否则（如果有错误），将不发送正文，且 URLRequest 对象将调度一个 IOError 事件。</li><li class="- topic/li "><ph class="- topic/ph ">对于 SWF 10 内容</ph>，将<i class="+ topic/ph hi-d/i ">始终</i> 发送 HTTP 响应消息的正文。如果有错误，则 URLRequest 对象将调度一个 IOError 事件。</li></ul>
     
     
     </apiDesc></apiOperationDetail><adobeApiEvent id="flash.net:URLStream:load_complete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">complete</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在成功加载数据后调度。如果有 <codeph class="+ topic/ph pr-d/codeph ">httpResponseStatus</codeph> 事件侦听器，则 URLRequest 对象还会调度一个 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件，无论 HTTP 响应状态代码指示成功<i class="+ topic/ph hi-d/i ">还是</i>错误。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在成功加载数据后调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLStream:load_httpStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpStatus</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果通过 HTTP 进行访问，<ph class="- topic/ph ">并且当前环境支持获取状态代码</ph>，则除了 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">error</codeph> 事件之外，还可以接收这些事件。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">如果通过 HTTP 进行访问，并且当前环境支持获取状态代码，则除了 complete 或 error 事件之外，还可以接收这些事件。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLStream:load_httpResponseStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">httpResponseStatus</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:HTTPStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在对 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法的调用试图通过 HTTP 访问数据，并且 Adobe AIR 可以检测并返回请求的状态代码时调度。 
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在对 load() 方法的调用试图通过 HTTP 访问数据，并且 Adobe AIR 可以检测并返回请求的状态代码时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLStream:load_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法完成加载操作。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">无法完成加载操作。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLStream:load_open" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:Event</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在加载操作开始时调度。
     
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在加载操作开始时调度。</shortdesc></adobeApiEvent><adobeApiEvent id="flash.net:URLStream:load_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">加载操作尝试从调用方安全沙箱外部的服务器检索数据。可以通过在服务器上使用策略文件来解决此问题。
      
      </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">加载操作尝试从调用方安全沙箱外部的服务器检索数据。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:URLStream:readBoolean" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readBoolean</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取一个布尔值。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">如果字节不为零，则返回 <codeph class="+ topic/ph pr-d/codeph ">True</codeph>；否则返回 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取一个布尔值。读取单个字节，如果字节非零，则返回 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，否则返回 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readByte" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readByte</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取一个带符号字节。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">值的范围为 -128...127。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取一个带符号字节。
     <p class="- topic/p ">返回值在 -128...127 之间。</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readBytes" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readBytes</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取 length 字节的数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">bytes</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.utils:ByteArray</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要将数据读入的 ByteArray 对象。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">offset</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">在 <codeph class="+ topic/ph pr-d/codeph ">bytes</codeph> 中的偏移量，即数据读取的起始位置。默认值为 0。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">length</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要读取的字节数。默认值 0 将导致读取所有可用的数据。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取 <codeph class="+ topic/ph pr-d/codeph ">length</codeph> 字节的数据。这些字节会被读取到由 <codeph class="+ topic/ph pr-d/codeph ">bytes</codeph> 指定的 ByteArray 对象中，其起始位置是在 ByteArray 对象中偏移 <codeph class="+ topic/ph pr-d/codeph ">offset</codeph> 字节处。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readDouble" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readDouble</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取一个 IEEE 754 双精度浮点数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">流中的一个 IEEE 754 双精度浮点数。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取一个 IEEE 754 双精度浮点数。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readFloat" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readFloat</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取一个 IEEE 754 单精度浮点数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">流中的一个 IEEE 754 单精度浮点数。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取一个 IEEE 754 单精度浮点数。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readInt" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readInt</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取一个带符号的 32 位整数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">值的范围为 -2147483648...2147483647。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取一个带符号的 32 位整数。
     <p class="- topic/p ">返回值在 -2147483648...2147483647 之间。</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readMultiByte" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readMultiByte</apiName><shortdesc class="- topic/shortdesc ">
     使用指定的字符集从字节流中读取指定长度的多字节字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">URLStream, URLStream.readMultiByte, readMultiByte
      
      </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">UTF-8 编码的字符串。
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">length</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要从字节流中读取的字节数。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">charSet</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">表示用于解释字节的字符集的字符串。可能的字符集字符串包括 <codeph class="+ topic/ph pr-d/codeph ">"shift_jis"</codeph>、<codeph class="+ topic/ph pr-d/codeph ">"CN-GB"</codeph>、<codeph class="+ topic/ph pr-d/codeph ">"iso-8859-1"</codeph>”等。有关完整列表，请参阅<xref href="../../charset-codes.html" class="- topic/xref ">支持的字符集</xref>。    
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果当前系统无法识别 <codeph class="+ topic/ph pr-d/codeph ">charSet</codeph> 参数的值，则应用程序将使用系统的默认代码页作为字符集。例如，<codeph class="+ topic/ph pr-d/codeph ">charSet</codeph> 参数的值（如在使用 <codeph class="+ topic/ph pr-d/codeph ">01</codeph> 而不是 <codeph class="+ topic/ph pr-d/codeph ">1</codeph> 的 <codeph class="+ topic/ph pr-d/codeph ">myTest.readMultiByte(22, "iso-8859-01")</codeph> 中）可能在您的开发计算机上起作用，但在其他计算机上可能不起作用。在其它计算机上，应用程序将使用系统的默认代码页。</p>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     使用指定的字符集从字节流中读取指定长度的多字节字符串。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readObject" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readObject</apiName><shortdesc class="- topic/shortdesc ">
     从以 Action Message Format (AMF) 编码的套接字读取一个对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">反序列化的对象。
     </apiDesc><apiType value="any" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从以 Action Message Format (AMF) 编码的套接字读取一个对象。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#ObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding</linktext></link></related-links></apiOperation><apiOperation id="flash.net:URLStream:readShort" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readShort</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取一个带符号的 16 位整数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">值的范围为 -32768...32767。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取一个带符号的 16 位整数。
     <p class="- topic/p ">返回值在 -32768...32767 之间。</p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readUTFBytes" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readUTFBytes</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取长度为 length 的 UTF-8 字节序列，并返回一个字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">由指定长度字符的字节表示形式生成的 UTF-8 字符串。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">length</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 UTF-8 字节序列。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取长度为 <codeph class="+ topic/ph pr-d/codeph ">length</codeph> 的 UTF-8 字节序列，并返回一个字符串。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readUTF" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readUTF</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取一个 UTF-8 字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">UTF-8 字符串。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取一个 UTF-8 字符串。假定字符串的前缀是无符号的短整型（以字节表示长度）。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readUnsignedByte" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readUnsignedByte</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取一个无符号字节。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     

     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">值的范围为 0...255。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取一个无符号字节。
     <p class="- topic/p ">返回值在 0...255 之间。 </p>     
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readUnsignedInt" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readUnsignedInt</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取一个无符号的 32 位整数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">值的范围为 0...4294967295。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取一个无符号的 32 位整数。
     <p class="- topic/p ">返回值在 0...4294967295 之间。 </p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:URLStream:readUnsignedShort" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">readUnsignedShort</apiName><shortdesc class="- topic/shortdesc ">
     从该流读取一个无符号的 16 位整数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc "><ph class="- topic/ph ">可读取的数据不足。若本地 SWF 文件触发了安全警告，则 Flash Player 会阻止将 URLStream 数据用于 ActionScript。当发生这种情况时，即使收到了数据，<codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性也将返回 0，而且任何读方法都将引发 EOFError 异常。</ph>
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">EOFError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:EOFError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">该流发生了 I/O 错误，或者该流未打开。
      
      </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">值的范围为 0...65535。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">uint</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     从该流读取一个无符号的 16 位整数。
     <p class="- topic/p ">返回值在 0...65535 之间。 </p>
     
     </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:URLStream:bytesAvailable:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">bytesAvailable</apiName><shortdesc class="- topic/shortdesc ">
     返回可在输入缓冲区中读取的数据的字节数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回可在输入缓冲区中读取的数据的字节数。您的代码必须调用 <codeph class="+ topic/ph pr-d/codeph ">bytesAvailable</codeph> 属性，以确保尝试使用其中一种 <codeph class="+ topic/ph pr-d/codeph ">read</codeph> 方法读取前有足够可用的数据。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLStream:connected:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">connected</apiName><shortdesc class="- topic/shortdesc ">
     表示此 URLStream 对象目前是否已连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示此 URLStream 对象目前是否已连接。如果已连接 URLStream 对象，则调用该属性会返回值 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，否则会返回值 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLStream:endian:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">endian</apiName><shortdesc class="- topic/shortdesc ">
     表示数据的字节顺序。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiDefaultValue>Endian.BIG_ENDIAN
     </apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示数据的字节顺序。可能的值为 <codeph class="+ topic/ph pr-d/codeph ">Endian.BIG_ENDIAN</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">Endian.LITTLE_ENDIAN</codeph>。
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.utils.xml#Endian" class="- topic/link "><linktext class="- topic/linktext ">flash.utils.Endian</linktext></link></related-links></apiValue><apiValue id="flash.net:URLStream:objectEncoding:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">objectEncoding</apiName><shortdesc class="- topic/shortdesc ">
     在写入或读取对象时，控制所使用的 Action Message Format (AMF) 的版本。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Property documented; needs review
     </internal></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在写入或读取对象时，控制所使用的 Action Message Format (AMF) 的版本。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#URLStream/readObject()" class="- topic/link "><linktext class="- topic/linktext ">readObject()</linktext></link><link href="flash.net.xml#ObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding 类</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetGroupSendMode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetGroupSendMode</apiName><shortdesc class="- topic/shortdesc ">
NetGroupSendMode 类是用于 NetGroup.sendToNeighbor() 方法的 sendMode 参数的常量值的枚举。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">用于 NetGroup 类中 sendToNeighbor() 方法的 sendMode 参数的常量值的枚举。<codeph class="+ topic/ph pr-d/codeph ">NetGroup</codeph> 类的方法

</apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
NetGroupSendMode 类是 <codeph class="+ topic/ph pr-d/codeph ">sendMode</codeph> 参数（用于 <codeph class="+ topic/ph pr-d/codeph ">NetGroup.sendToNeighbor()</codeph> 方法）的常量值的枚举。

</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/sendToNeighbor()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNeighbor()</linktext></link></related-links><apiValue id="flash.net:NetGroupSendMode:NEXT_DECREASING" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">NEXT_DECREASING</apiName><shortdesc class="- topic/shortdesc "> 
    使用减少的方向中的最近组地址指定邻居。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">nextDecreasing</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
    使用减少的方向中的最近组地址指定邻居。
    
    </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetGroupSendMode:NEXT_INCREASING" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">NEXT_INCREASING</apiName><shortdesc class="- topic/shortdesc "> 
    使用增长的方向中的最近组地址指定邻居。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">nextIncreasing</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
    使用增长的方向中的最近组地址指定邻居。
    
    </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:SharedObject" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">SharedObject</apiName><shortdesc class="- topic/shortdesc ">
 SharedObject 类用于在用户计算机或服务器上读取和存储有限的数据量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">SharedObject, shared object, constructor
 
  
  </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 SharedObject 类用于在用户计算机或服务器上读取和存储有限的数据量。使用共享对象，可在永久贮存在本地计算机或远程服务器上的多个客户端 SWF 文件和对象之间实现实时数据共享。本地共享对象类似于浏览器 Cookie，远程共享对象类似于实时数据传输设备。为了使用远程共享对象，您需要 Adobe Flash Media Server。
 
 <p class="- topic/p ">可使用共享对象执行以下操作：</p>
 
 <ul class="- topic/ul "><li class="- topic/li "><b class="+ topic/ph hi-d/b ">保持本地永久性</b>。这是使用共享对象的最简单方法，并且无需使用 Flash Media Server。例如，可以调用 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.getLocal()</codeph> 以在应用程序中创建共享对象，如带记忆功能的计算器。用户关闭计算器时，Flash Player 将在用户计算机的共享对象中保存最后一个值。计算器下一次运行时，将包含先前所拥有的值。或者，在计算器应用程序关闭之前，如果将共享对象的属性设置为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，下次运行该应用程序时，它在打开时不包含任何值。维护本地永久性的另一示例就是跟踪用户首选项或复杂网站的其它数据，如用户在新闻网站上所阅读文章的记录。跟踪此信息将允许您以不同方式分别显示已经阅读的文章和新的未读文章。在用户计算机上存储此信息可减小服务器负载。</li><li class="- topic/li "><b class="+ topic/ph hi-d/b ">在 Flash Media Server 上存储并共享数据</b>。共享对象可以在服务器上存储数据以供其它客户端进行检索。例如，调用 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.getRemote()</codeph> 以创建一个在服务器上永久保留的远程共享对象，如电话簿。每次客户端对共享对象进行更改时，修改后的数据可供当前或以后连接到该对象的所有客户端使用。如果还在本地永久保留了该对象，并且客户端在未连接到服务器时更改了数据，下次客户端连接到远程共享对象时，则会将数据复制到该对象。</li><li class="- topic/li "><b class="+ topic/ph hi-d/b ">实时共享数据</b>。共享对象可以实现多个客户端的实时数据共享。例如，您可以打开一个存储连接到聊天室的用户列表的远程共享对象，连接到该对象的所有客户端都能看到此列表。当用户进入或离开聊天室时，将更新该对象，连接到该对象的所有客户端都能看到修改的聊天室用户列表。</li></ul>
 
 <p class="- topic/p "> 要创建本地共享对象，请调用 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.getLocal()</codeph>。要创建远程共享对象，请调用 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.getRemote()</codeph>。</p> 
 
 <p class="- topic/p "> 当应用程序关闭时，将会<i class="+ topic/ph hi-d/i ">刷新</i>共享对象或将其写入磁盘。也可以调用 <codeph class="+ topic/ph pr-d/codeph ">flush()</codeph> 方法以显式地将数据写入磁盘。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">本地磁盘空间注意事项。</b>本地共享对象具有一些限制，这些限制很重要，您在设计应用程序时要予以考虑。有时可能不允许 SWF 文件写入本地共享对象，有时可能会在您不知情的情况下删除在本地共享对象中存储的数据。Flash Player 用户可以管理对单个域或所有域可用的磁盘空间。当用户减少可用磁盘空间时，一些本地共享对象可能会被删除。Flash Player 用户还具有隐私控制能力，它们可防止第三方域（当前浏览器地址栏中域之外的域）读取或写入本地共享对象。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在本地计算机（而不是远程服务器）上存储和运行的 SWF 文件始终可以将第三方共享对象写入磁盘。有关第三方共享对象的详细信息，请参阅“Flash Player 帮助”中的<xref href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html" scope="external" class="- topic/xref ">“全局存储设置”面板</xref>。</p>
 
 <p class="- topic/p ">最好检查与磁盘空间数量和用户隐私控制有关的故障。在调用 <codeph class="+ topic/ph pr-d/codeph ">getLocal()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">flush()</codeph> 时执行这些检查：
 
 <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">SharedObject.getLocal()</codeph> -- 调用此方法失败时（如用户禁用了第三方共享对象，并且您的 SWF 文件的域与浏览器地址栏中的域不匹配），Flash Player 将引发异常。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">SharedObject.flush()</codeph> -- 调用此方法失败时，Flash Player 将引发异常。调用成功时，将返回 <codeph class="+ topic/ph pr-d/codeph ">SharedObjectFlushStatus.FLUSHED</codeph>。需要额外存储空间时，将返回 <codeph class="+ topic/ph pr-d/codeph ">SharedObjectFlushStatus.PENDING</codeph>。Flash Player 提示用户增加本地保存信息的存储空间。随后，对 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件进行调度，同时信息对象将表示刷新是否成功。</li></ul></p>
 
 <p class="- topic/p ">如果您的 SWF 文件尝试创建或修改本地共享对象，请确保 SWF 文件的宽度至少为 215 像素，高度至少为 138 像素，这是用于显示提示用户增加其本地共享对象存储限制的对话框的最小尺寸。如果您的 SWF 文件小于这些尺寸，且需要增加存储限制，则 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.flush()</codeph> 失败，返回 <codeph class="+ topic/ph pr-d/codeph ">SharedObjectFlushedStatus.PENDING</codeph>，并调度 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件。</p>
 
 <p class="- topic/p ">
 <b class="+ topic/ph hi-d/b ">远程共享对象。</b>如果使用 Flash Media Server，您可以创建并使用远程共享对象，这些对象是由连接到应用程序的所有客户端实时共享的。在一个客户端更改远程共享对象的属性时，也会为所有连接的客户端更改此属性。您可以使用远程共享对象同步客户端，例如，在玩多人游戏的用户。
 </p>
 
 <p class="- topic/p ">
 每个远程共享对象具有一个 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性，此对象包含存储数据的属性。可以调用 <codeph class="+ topic/ph pr-d/codeph ">setProperty()</codeph> 以更改数据对象的属性。服务器将更新这些属性，调度 <codeph class="+ topic/ph pr-d/codeph ">sync</codeph> 事件，并将这些属性发回到连接的客户端。 
 </p>
 
 <p class="- topic/p ">
 您可以选择将远程共享对象永久保留在客户端和/或服务器上。默认情况下，Flash Player 最多在本地永久保存 100K 的远程共享对象。在尝试保存较大的对象时，Flash Player 将显示一个“本地存储”对话框，用户可以在其中允许或拒绝共享对象的本地存储。请确保舞台大小至少为 215 x 138 像素；这是 Flash 显示该对话框所需的最小大小。
 </p>
 <p class="- topic/p ">
 如果用户选择“允许”，服务器将保存共享对象并调度 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph>事件，<codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性值为 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.Flush.Success</codeph>。如果用户选择“拒绝”，服务器不会保存共享对象并调度 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件，<codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性值为 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.Flush.Failed</codeph>。
 </p>
 
 </apiDesc><example conref="examples\SharedObjectExample.as" class="- topic/example "> 以下代码使用 ID <codeph class="+ topic/ph pr-d/codeph ">"application-name"</codeph> 创建（并在后续执行过程中检索）一个共享对象： 单击“保存”按钮时，<codeph class="+ topic/ph pr-d/codeph ">saveValue()</codeph> 方法尝试将一个名为 <codeph class="+ topic/ph pr-d/codeph ">savedValue</codeph> 的属性保存到 SharedObject 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 的属性。如果 Flash Player 要求提供保存数据的权限，当用户授予或拒绝授予权限时，将调用 <codeph class="+ topic/ph pr-d/codeph ">onFlushStatus()</codeph> 方法。单击“清除”按钮时，<codeph class="+ topic/ph pr-d/codeph ">clearValue()</codeph> 方法将删除 <codeph class="+ topic/ph pr-d/codeph ">savedValue</codeph> 中保存的值；下次加载 SWF 文件时，所检索的值为 <codeph class="+ topic/ph pr-d/codeph ">undefined</codeph>。
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#SharedObject/flush()" class="- topic/link "><linktext class="- topic/linktext ">flush()</linktext></link><link href="flash.net.xml#SharedObject/getLocal()" class="- topic/link "><linktext class="- topic/linktext ">getLocal()</linktext></link><link href="flash.net.xml#SharedObject/event:netStatus" class="- topic/link "><linktext class="- topic/linktext ">netStatus</linktext></link></related-links><adobeApiEvent id="flash.net:SharedObject_flash.events.SyncEvent.SYNC_sync" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">sync</apiName><shortdesc class="- topic/shortdesc ">
 在服务器更新了远程共享对象后调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.SyncEvent.SYNC</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.SyncEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在服务器更新了远程共享对象后调度。
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/getRemote()" class="- topic/link "><linktext class="- topic/linktext ">getRemote()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:SharedObject_flash.events.NetStatusEvent.NET_STATUS_netStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">netStatus</apiName><shortdesc class="- topic/shortdesc ">
 在 SharedObject 实例报告其状态或错误条件时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.NetStatusEvent.NET_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.NetStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 SharedObject 实例报告其状态或错误条件时调度。<codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件包含 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 属性，该属性为包含事件特定信息（例如，连接尝试是否成功或共享对象是否被成功写入本地磁盘）的信息对象。 
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.events.xml#NetStatusEvent/info" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:SharedObject_flash.events.AsyncErrorEvent.ASYNC_ERROR_asyncError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">asyncError</apiName><shortdesc class="- topic/shortdesc ">
 在异步引发异常（即来自本机异步代码）时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.AsyncErrorEvent.ASYNC_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.AsyncErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在异步引发异常（即来自本机异步代码）时调度。 
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.net:SharedObject:clear" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">clear</apiName><shortdesc class="- topic/shortdesc ">
     对于本地共享对象，清除所有数据并从磁盘删除共享对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">SharedObject, SharedObject.clear, clear
     
     </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     对于本地共享对象，清除所有数据并从磁盘删除共享对象。对共享对象的引用仍然处于活动状态，但其数据属性被删除。
     
     <p class="- topic/p ">
     对于用于 Flash Media Server 的远程共享对象，<codeph class="+ topic/ph pr-d/codeph ">clear()</codeph> 将断开该对象并清除所有数据。如果在本地永久保留了共享对象，此方法还会从磁盘中删除该共享对象。对共享对象的引用仍然处于活动状态，但其数据属性被删除。
     </p>
      
     
     </apiDesc><example conref="examples\SharedObject_clear.as" class="- topic/example "> 以下代码使用值为 <codeph class="+ topic/ph pr-d/codeph ">hostName</codeph> 的 ID 创建（并在后续执行过程中检索）一个 SharedObject 对象。将名为 <codeph class="+ topic/ph pr-d/codeph ">username</codeph> 的属性添加到 SharedObject 对象的数据属性中。最后调用 <codeph class="+ topic/ph pr-d/codeph ">clear()</codeph> 方法，以清除添加到数据对象的所有信息（在本例中是一个名为 <codeph class="+ topic/ph pr-d/codeph ">username</codeph> 属性）。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     关闭远程共享对象和服务器间的连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>server-specific: This info is relevant for Flash Media Server, but not Flex Data Services.
     
     </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     关闭远程共享对象和服务器间的连接。如果一个远程共享对象永久储存在本地，那么在此方法被调用后，用户可以对该对象的本地副本进行更改。对本地对象的任何更改都将在用户下一次连接到远程共享对象时发送给服务器。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:SharedObject:connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
     通过指定的 NetConnection 对象连接到服务器上的远程共享对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Flash Player 无法连接到指定的远程共享对象。确认 NetConnection 实例有效并已连接，且已在服务器上成功创建远程共享对象。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">myConnection</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:NetConnection</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">使用实时消息传递协议 (RTMP) 的 NetConnection 对象，如用于与 Flash Media Server 进行通信的 NetConnection 对象。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">params</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个字符串，用于定义将传递给服务器上的远程共享对象的消息。不能用于 Flash Media Server。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     通过指定的 NetConnection 对象连接到服务器上的远程共享对象。应在调用 <codeph class="+ topic/ph pr-d/codeph ">getRemote()</codeph> 后使用此方法。在连接成功时，将调度 <codeph class="+ topic/ph pr-d/codeph ">sync</codeph> 事件。
     
     <p class="- topic/p ">在尝试使用远程共享对象时，应先使用 <codeph class="+ topic/ph pr-d/codeph ">try..catch..finally</codeph> 语句。接着，侦听并处理 <codeph class="+ topic/ph pr-d/codeph ">sync</codeph> 事件，然后再对共享对象进行更改。在调度 <codeph class="+ topic/ph pr-d/codeph ">sync</codeph> 事件之前，进行的任何本地更改可能会丢失。
     </p>
     
     <p class="- topic/p ">
     可以调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法以连接到远程共享对象，例如：
     </p>
     
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     var myRemoteSO:SharedObject = SharedObject.getRemote("mo", myNC.uri, false);
     myRemoteSO.connect(myNC);
     </codeblock>
     
     
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/getRemote()" class="- topic/link "><linktext class="- topic/linktext ">getRemote()</linktext></link><link href="flash.net.xml#SharedObject/event:sync" class="- topic/link "><linktext class="- topic/linktext ">sync</linktext></link><link href="../../statements.html#try..catch..finally" class="- topic/link "><linktext class="- topic/linktext ">try..catch..finally</linktext></link><link href="flash.net.xml#NetConnection" class="- topic/link "><linktext class="- topic/linktext ">NetConnection</linktext></link></related-links></apiOperation><apiOperation id="flash.net:SharedObject:flush" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">flush</apiName><shortdesc class="- topic/shortdesc ">
     将本地永久共享对象立即写入本地文件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">SharedObject, SharedObject.flush, flush
     
     </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Flash Player 不能将共享对象写入磁盘。如果用户已永久禁止对来自该域的对象进行本地信息存储，则可能出现此错误。
      
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：本地内容始终可以将来自第三方域（当前浏览器地址栏中的域以外的域）的共享对象写入磁盘，即使禁止将第三方共享对象写入磁盘。</p>
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">下列任一值：
     <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">SharedObjectFlushStatus.PENDING</codeph>：用户允许来自此域的对象进行本地信息存储，但所分配的空间量不足以存储该对象。Flash Player 将提示用户留出更多空间。要留出空间以满足共享对象在保存时的增长需要，从而避免返回值 <codeph class="+ topic/ph pr-d/codeph ">SharedObjectFlushStatus.PENDING</codeph>，请为 <codeph class="+ topic/ph pr-d/codeph ">minDiskSpace</codeph> 传递一个值。
     </li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">SharedObjectFlushStatus.FLUSHED</codeph>：共享对象已成功写入本地磁盘上的文件。</li></ul>
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">minDiskSpace</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">必须分配给此对象的最小磁盘空间（以字节为单位）。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将本地永久共享对象立即写入本地文件。如果不使用此方法，则 Flash Player 会在共享对象会话结束时（也就是说，在 SWF 文件关闭时，在由于不再有对共享对象的任何引用而将其作为垃圾回收时，或者在调用 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.clear()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.close()</codeph> 时），将共享对象写入文件。 
     
     <p class="- topic/p ">如果此方法返回 <codeph class="+ topic/ph pr-d/codeph ">SharedObjectFlushStatus.PENDING</codeph>，则 Flash Player 将显示一个对话框，要求用户增加磁盘空间量以供此域中的对象使用。要允许将来保存共享对象时其空间能够增长，从而避免返回值 <codeph class="+ topic/ph pr-d/codeph ">PENDING</codeph>，请为 <codeph class="+ topic/ph pr-d/codeph ">minDiskSpace</codeph> 传递一个值。当 Flash Player 尝试写入文件时，它将查找传递给 <codeph class="+ topic/ph pr-d/codeph ">minDiskSpace</codeph> 的字节数，而不是查找足够的空间以共享对象的当前大小来保存共享对象。 </p>
     
     <p class="- topic/p ">例如，如果预期共享对象增长到最大为 500 个字节，则即使它开始时要小得多，也为 <codeph class="+ topic/ph pr-d/codeph ">minDiskSpace</codeph> 传递 500。如果 Flash 要求用户为该共享对象分配磁盘空间，它将要求 500 个字节。在用户分配了请求的空间量之后，当以后尝试对齐该对象时（只要其大小不超过 500 个字节），Flash 将无需要求更多的空间。 </p>
     
     <p class="- topic/p ">在用户响应此对话框后，则会再次调用此方法。将调度 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件，<codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性值为 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.Flush.Success</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.Flush.Failed</codeph>。
     </p>
     
     </apiDesc><example conref="examples\SharedObject_flush.as" class="- topic/example "> 以下代码使用值为 <codeph class="+ topic/ph pr-d/codeph ">hostName</codeph> 的 ID 创建（并在后续执行过程中检索）一个 SharedObject 对象。将名为 <codeph class="+ topic/ph pr-d/codeph ">username</codeph> 的属性添加到 SharedObject 对象的数据属性中。然后调用 <codeph class="+ topic/ph pr-d/codeph ">flush()</codeph> 方法，并检查以确定返回的是字符串 <codeph class="+ topic/ph pr-d/codeph ">pending</codeph> 还是 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">false</codeph> 的布尔值。务必注意：打开的所有 SharedObject 实例都将在 Flash Player 的当前实例关闭时自动刷新。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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 class="- topic/related-links "><link href="flash.net.xml#SharedObject/clear()" class="- topic/link "><linktext class="- topic/linktext ">clear()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:SharedObject:getLocal" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">getLocal</apiName><shortdesc class="- topic/shortdesc ">
  返回对本地永久保留的共享对象的引用，该对象只能用于当前客户端。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">SharedObject, constructor, SharedObject.getLocal, getLocal, get
  
   
   </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">不论什么原因，Flash Player 均不能创建共享对象。如果禁止第三方 Flash 内容创建或存储永久共享对象，将出现此错误。用户可以在“设置管理器”的“全局存储设置”面板上禁止第三方永久共享对象，相关设置请参阅 <xref href="http://www.adobe.com/support/documentation/cn/flashplayer/help/settings_manager03.html" scope="external" class="- topic/xref ">http://www.adobe.com/support/documentation/cn/flashplayer/help/settings_manager03.html</xref>。
  
  </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个对共享对象的引用，该共享对象永久贮存在本地并且只可用于当前客户端。如果 Flash Player 无法创建或找到共享对象（例如，指定了 <codeph class="+ topic/ph pr-d/codeph ">localPath</codeph> 但不存在此目录时），此方法将引发异常。
  
  </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:SharedObject</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">name</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对象的名称。该名称可以包含正斜杠 (<codeph class="+ topic/ph pr-d/codeph ">/</codeph>)；例如，<codeph class="+ topic/ph pr-d/codeph ">work/addresses</codeph> 是合法名称。共享对象名称中不允许使用空格，也不允许使用以下字符：   
  <pre xml:space="preserve" class="- topic/pre ">
  ~ % &amp; \ ; : " ' , &lt; > ? # 
  </pre>
  
  </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">localPath</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">创建了共享对象的 SWF 文件的完整路径或部分路径，这将确定共享对象的本地存储位置。如果未指定此参数，则使用完整路径。 
   
  </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">secure</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">确定对此共享对象的访问是否只限于通过 HTTPS 连接传递的 SWF 文件。如果 SWF 文件通过 HTTPS 传递，则此参数值具有以下效果：
  <ul class="- topic/ul "><li class="- topic/li ">如果此参数设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则 Flash Player 将创建一个新的安全共享对象或获取一个对现有安全共享对象的引用。只可由通过 HTTPS 传递的 SWF 文件对此安全共享对象进行读取或写入，而该 HTTPS 调用 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.getLocal()</codeph> 并将 <codeph class="+ topic/ph pr-d/codeph ">secure</codeph> 参数设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。</li><li class="- topic/li ">如果此参数设置为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>，则 Flash Player 将创建一个新的共享对象或获取一个对现有共享对象的引用，可以通过非 HTTPS 连接传递的 SWF 文件对此共享对象或现有共享对象的引用进行读取或写入。</li></ul>
  <p class="- topic/p ">如果您的 SWF 文件是通过非 HTTPS 连接传递的，并且您尝试将此参数设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，将无法创建新的共享对象（或访问以前创建的安全共享对象），并且返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。无论此参数为何值，创建的共享对象的数量都接近域所允许的磁盘空间的总量。</p>
  
  <p class="- topic/p ">下面的图示说明了 <codeph class="+ topic/ph pr-d/codeph ">secure</codeph> 参数的用途：</p>
  <p class="- topic/p "><adobeimage alt="安全共享对象图" href="../../images/secureParam.jpg" placement="inline" class="+ topic/image adobe-d/adobeimage "/></p>
  
  </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  返回对本地永久保留的共享对象的引用，该对象只能用于当前客户端。如果尚不存在共享对象，则此方法将创建一个共享对象。如果传递给 <codeph class="+ topic/ph pr-d/codeph ">getLocal()</codeph> 的任何值均无效，或如果调用失败，Flash Player 将引发异常。
  
  <p class="- topic/p ">以下代码显示如何将返回的共享对象引用赋给变量：</p>
  <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">var so:SharedObject = SharedObject.getLocal("savedData");</codeph></p>
  
  <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果用户已选择了从不允许此域进行本地存储，则即使指定了 <codeph class="+ topic/ph pr-d/codeph ">localPath</codeph> 的值，对象也不会在本地保存。本地内容不遵循此规则。本地内容始终可以将第三方域（当前浏览器地址栏中域之外的域）中的共享对象写入磁盘，即使禁止将第三方共享对象写入磁盘。
  </p>
  
  <p class="- topic/p ">为了避免名称冲突，Flash 会考虑创建共享对象的 SWF 文件的位置。例如，如果位于 www.myCompany.com/apps/stockwatcher.swf 的 SWF 文件创建了一个名为 <codeph class="+ topic/ph pr-d/codeph ">portfolio</codeph> 的共享对象，则该共享对象不会与位于 www.yourCompany.com/photoshoot.swf 的 SWF 文件所创建的另一个名为 <codeph class="+ topic/ph pr-d/codeph ">portfolio</codeph> 的对象冲突，这是因为这两个 SWF 文件源于不同的目录。 </p>
  
  <p class="- topic/p ">虽然 <codeph class="+ topic/ph pr-d/codeph ">localPath</codeph> 参数是可选的，但是您应该考虑该参数的用途，特别是其它 SWF 文件需要访问共享对象时。如果共享对象中的数据特定于一个不会移动到其它位置的 SWF 文件，则使用默认值将会解决问题。如果其它 SWF 文件需要访问共享对象，或如果创建共享对象的 SWF 文件以后将发生移动，则此参数的值将影响共享对象的可访问性。例如，如果在 <codeph class="+ topic/ph pr-d/codeph ">localPath</codeph> 设置为等于 SWF 文件完整路径的默认值时创建一个共享对象，那么其它任何 SWF 文件都将无法访问该共享对象。如果您以后将原始的 SWF 文件移动到另一个位置，那么，即便是该 SWF 文件也将无法访问已经存储在共享对象中的数据。</p>
  
  <p class="- topic/p ">为避免意外限制对共享对象的访问，请使用 <codeph class="+ topic/ph pr-d/codeph ">localpath</codeph> 参数。允许级别最高的方法是将 <codeph class="+ topic/ph pr-d/codeph ">localPath</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">/</codeph>（斜杠），这样做可使域中的所有 SWF 文件都可访问该共享对象，但会增加与域中其它共享对象发生名称冲突的可能性。限制级别较高的方法是向 <codeph class="+ topic/ph pr-d/codeph ">localPath</codeph> 追加 SWF 文件完整路径中的文件夹名。例如，对于位于 www.myCompany.com/apps/stockwatcher.swf 的 SWF 文件创建的 <codeph class="+ topic/ph pr-d/codeph ">portfolio</codeph> 共享对象，可以将 <codeph class="+ topic/ph pr-d/codeph ">localPath</codeph> 参数设置为<codeph class="+ topic/ph pr-d/codeph ">/</codeph>、<codeph class="+ topic/ph pr-d/codeph ">/apps</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">/apps/stockwatcher.swf</codeph>。您必须确定哪种方法能为您的应用程序提供最佳的灵活性。</p>
  
  <p class="- topic/p ">在使用此方法时，请考虑以下安全模型：
  
  <ul class="- topic/ul "><li class="- topic/li ">无法跨沙箱边界访问共享对象。</li><li class="- topic/li ">用户可通过使用“Flash Player 设置”对话框或“设置管理器”来限制共享对象访问。默认情况下，应用程序可在每个域创建高达 100 KB 数据的共享对象。管理员和用户还可限制写入文件系统的能力。</li></ul></p>
  
  <p class="- topic/p ">假定您将要回放的 SWF 文件内容发布为本地文件（本地安装的 SWF 文件或 EXE 文件）而且，您需要从多个本地 SWF 文件访问某个特定的共享对象。在这种情况下，请注意：对于本地文件而言，可能会使用两个不同位置来存储共享对象。所用的域取决于为创建该共享对象的本地文件授予的安全权限。本地文件可以具有三种不同级别的权限：
  
  <ol class="- topic/ol "><li class="- topic/li ">仅能访问本地文件系统。</li><li class="- topic/li ">仅能访问网络。</li><li class="- topic/li ">既能访问网络，也能访问本地文件系统。</li></ol></p>
  
  <p class="- topic/p ">可以访问本地文件系统（1 级或 3 级）的本地文件将其共享对象存储在一个位置。无法访问本地文件系统（2 级）的本地文件将其共享对象存储在另一位置。</p>
  
  <p class="- topic/p ">可以在包含 SWF 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数，防止 SWF 文件使用此方法。</p>
  
  <p class="- topic/p ">有关详细信息，请参阅 Flash Player 开发人员中心主题：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全性</xref>。</p>
  
  </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:SharedObject:getRemote" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">getRemote</apiName><shortdesc class="- topic/shortdesc ">
     返回对 Flash Media Server 上可由多个客户端访问的共享对象的引用。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>server-specific: This info is relevant for Flash Media Server, but not Flex Data Services.
     </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Flash Player 无法创建或找到共享对象。如果为 <codeph class="+ topic/ph pr-d/codeph ">remotePath</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">persistence</codeph> 参数指定不存在的路径，则将出现这种情况。
     
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">Error</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Error</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对可在多个客户端间共享的对象的引用。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:SharedObject</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">name</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">远程共享对象的名称。该名称可以包含正斜杠 (/)；例如，work/addresses 是合法名称。共享对象名称中不允许使用空格，也不允许使用以下字符：
     <pre xml:space="preserve" class="- topic/pre ">    ~ % &amp; \ ; :  " ' , > ? ? #</pre>
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">remotePath</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">将存储共享对象的服务器的 URI。此 URI 必须与传递给 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法的 NetConnection 对象的 URI 相同。 
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">persistence</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Object</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定共享对象的数据属性的特性是本地永久储存还是远程永久储存，或者是同时进行本地永久储存和远程永久储存。此参数还可指定共享对象的本地存储位置。可接受的值包括：
     <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">false</codeph>，指定客户端或服务器上的共享对象不是永久性的。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">true</codeph>，指定只有服务器上的共享对象是永久性的。</li><li class="- topic/li ">共享对象的完整路径或部分路径，指定客户端和服务器上的共享对象都是永久性的。客户端的共享对象存储在指定路径中，而服务器中的共享对象则存储在应用程序目录中的子目录内。</li></ul>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果用户已选择了从不允许此域的本地存储，则即使将本地路径指定为永久性，对象也不会在本地保存。有关详细信息，请参阅类的描述。</p>
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">secure</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">确定对此共享对象的访问是否只限于通过 HTTPS 连接传递的 SWF 文件。有关详细信息，请参阅对 <codeph class="+ topic/ph pr-d/codeph ">secure</codeph> 参数的描述（<codeph class="+ topic/ph pr-d/codeph ">getLocal</codeph> 方法条目中）。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回对 Flash Media Server 上可由多个客户端访问的共享对象的引用。如果远程共享对象尚不存在，此方法将创建一个共享对象。 
     
     <p class="- topic/p ">
     要创建远程共享对象，请调用 <codeph class="+ topic/ph pr-d/codeph ">getRemote()</codeph>，然后调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 以将远程共享对象连接到服务器，如下所示：</p>
     
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     var nc:NetConnection = new NetConnection();
     nc.connect("rtmp://somedomain.com/applicationName");
     var myRemoteSO:SharedObject = SharedObject.getRemote("mo", nc.uri, false);
     myRemoteSO.connect(nc);
     </codeblock>
     
     
     
     <p class="- topic/p ">
     要确认共享对象的本地副本和远程副本是否已同步，请侦听并处理 <codeph class="+ topic/ph pr-d/codeph ">sync</codeph> 事件。希望共享此对象的所有客户端必须为 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">remotePath</codeph> 参数传递相同的值。 
     </p> 
     
     <p class="- topic/p ">要创建只能用于当前客户端的共享对象，请使用 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.getLocal()</codeph>。
     </p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/connect()" class="- topic/link "><linktext class="- topic/linktext ">connect()</linktext></link><link href="flash.net.xml#SharedObject/getLocal()" class="- topic/link "><linktext class="- topic/linktext ">getLocal()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:SharedObject:send" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">send</apiName><shortdesc class="- topic/shortdesc ">
     向连接到远程共享对象的所有客户端广播一条消息（包括发送该消息的客户端）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Needs better documentation, examples.
     </internal></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">arguments</apiItemName><apiType value="restParam" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个或多个参数：标识消息的字符串、附加到共享对象的一个或多个处理函数的名称以及任意类型可选参数。处理函数的名称只能为单级形式（即不能是父/子级形式）并相对于共享对象。这些参数已进行序列化处理并通过连接进行发送，而接收处理函数按相同的顺序接收它们。如果某个参数为循环对象（如循环的链接列表），则序列化函数可以正确处理引用。
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：函数名称切勿使用保留术语。例如，<codeph class="+ topic/ph pr-d/codeph ">myRemoteSO.send("close")</codeph> 将失败。</p>
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     向连接到远程共享对象的所有客户端广播一条消息（包括发送该消息的客户端）。要处理并响应该消息，请创建一个附加到共享对象的回调函数。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:SharedObject:setDirty" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">setDirty</apiName><shortdesc class="- topic/shortdesc ">
     通知服务器共享对象中的属性值已更改。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">propertyName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">已更改的属性名称。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     通知服务器共享对象中的属性值已更改。此方法将属性标记为 <i class="+ topic/ph hi-d/i ">dirty</i>，这表明属性已更改。
     
     <p class="- topic/p ">
     可以调用 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.setProperty()</codeph> 为共享对象创建属性。 
     </p>
      
     <p class="- topic/p ">
     <codeph class="+ topic/ph pr-d/codeph ">SharedObject.setProperty()</codeph> 方法实现了 <codeph class="+ topic/ph pr-d/codeph ">setDirty()</codeph>。大多数情况下，例如，当属性的值为 String 或 Number 等原始类型时，您可以调用 <codeph class="+ topic/ph pr-d/codeph ">setProperty()</codeph> 而不是调用 <codeph class="+ topic/ph pr-d/codeph ">setDirty()</codeph>。然而，如果属性值是一个包含其自己的属性的对象，则调用 <codeph class="+ topic/ph pr-d/codeph ">setDirty()</codeph> 以表示该对象中的值的更改时间。
     </p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/data" class="- topic/link "><linktext class="- topic/linktext ">SharedObject.data (client-side property)</linktext></link><link href="flash.net.xml#SharedObject/setProperty()" class="- topic/link "><linktext class="- topic/linktext ">setProperty()</linktext></link></related-links></apiOperation><apiOperation id="flash.net:SharedObject:setProperty" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">setProperty</apiName><shortdesc class="- topic/shortdesc ">
     更新共享对象中某个属性的值，并通知服务器该属性的值已更改。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">propertyName</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">共享对象中属性的名称。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">value</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Object</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">属性值（一个 ActionScript 对象），如果为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 则删除属性。 
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     更新共享对象中某个属性的值，并通知服务器该属性的值已更改。<codeph class="+ topic/ph pr-d/codeph ">setProperty()</codeph> 方法显式地将属性标签为已更改或 dirty。
     
     <p class="- topic/p ">有关远程共享对象的详细信息，请参阅 <xref href="http://www.adobe.com/go/learn_fms_docs_en" class="- topic/xref ">Flash Media Server 文档</xref>。</p>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b><codeph class="+ topic/ph pr-d/codeph ">SharedObject.setProperty()</codeph> 方法实现了 <codeph class="+ topic/ph pr-d/codeph ">setDirty()</codeph> 方法。大多数情况下，例如当属性的值为 String 或 Number 等原始类型时，应使用 <codeph class="+ topic/ph pr-d/codeph ">setProperty()</codeph>，而不使用 <codeph class="+ topic/ph pr-d/codeph ">setDirty</codeph>。然而，当某个属性的值是一个包含其自身属性的对象时，则使用 <codeph class="+ topic/ph pr-d/codeph ">setDirty()</codeph> 来表示该对象中的值的更改时间。通常，最好调用 <codeph class="+ topic/ph pr-d/codeph ">setProperty()</codeph> 而不要调用 <codeph class="+ topic/ph pr-d/codeph ">setDirty()</codeph>，因为 <codeph class="+ topic/ph pr-d/codeph ">setProperty()</codeph> 只在值被更改的时候更新属性值，而 <codeph class="+ topic/ph pr-d/codeph ">setDirty()</codeph> 则强制所有订阅客户端进行同步。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/data" class="- topic/link "><linktext class="- topic/linktext ">SharedObject.data (client-side property)</linktext></link></related-links></apiOperation><apiValue id="flash.net:SharedObject:client:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">client</apiName><shortdesc class="- topic/shortdesc ">
     表示对其调用回调方法的对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Property documented; needs review.
      
      </internal></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">必须将 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性设置为非空对象。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">TypeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">TypeError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示对其调用回调方法的对象。默认对象为 <codeph class="+ topic/ph pr-d/codeph ">this</codeph>。您可以将此客户端属性设置为其它对象，并对此对象调用回调方法。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:SharedObject:data:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">data</apiName><shortdesc class="- topic/shortdesc ">
     赋给对象的 data 属性 (property) 的属性 (attribute) 集合；可以共享和存储这些属性 (attribute)。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">SharedObject, SharedObject.data, data
     
     </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     赋给对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性 (property) 的属性 (attribute) 集合；可以共享和存储这些属性 (attribute)。每个特性都可以是任何 ActionScript 或 JavaScript 类型的对象（数组、数字、布尔值、字节数组、XML，等等）。例如，下面几行将值赋给共享对象的不同方面：
     
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     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>
     
     
     
     <p class="- topic/p ">如果对象是永久的，将保存共享对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性 (property) 的所有属性 (attribute)，共享对象包含以下信息：</p>
     
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     userName: Ramona
     adminPrivileges: true
     itemNumbers: 101,346,483
     </codeblock>
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>切勿将值直接赋给共享对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性，如同在 <codeph class="+ topic/ph pr-d/codeph ">so.data = someValue</codeph> 中一样；Flash Player 将忽略这些赋值。</p>
     
     <p class="- topic/p ">要删除本地共享对象的属性，请使用诸如 <codeph class="+ topic/ph pr-d/codeph ">delete so.data.attributeName</codeph> 这样的代码；将本地共享对象的属性设置为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">undefined</codeph> 不会删除该属性。</p>
     
     <p class="- topic/p ">要为共享对象创建<i class="+ topic/ph hi-d/i ">私有</i> 值（该对象正在使用时只有客户端实例才可以使用该值，并且该值在对象关闭时不与该对象存储在一起），请创建名称不是 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 的属性来存储它们，如下例所示：</p>
     
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     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>
     
     
     
     <p class="- topic/p ">共享对象包含以下数据：</p>
     <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
     favoriteSong: My World is Blue
     favoriteNightClub: The Bluenote Tavern
     favoriteColor: blue
     data: [object Object]
     </codeblock>
     
     <p class="- topic/p ">
     对于用于服务器的远程共享对象，<codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性 (property) 的所有属性 (attribute) 可供连接到共享对象的所有客户端使用；如果永久保留这些对象，则会保存所有属性 (attribute)。如果一个客户端更改了属性的值，所有客户端可以立即看到新的值。
     </p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/getLocal()" class="- topic/link "><linktext class="- topic/linktext ">getLocal()</linktext></link></related-links></apiValue><apiValue id="flash.net:SharedObject:defaultObjectEncoding:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">defaultObjectEncoding</apiName><shortdesc class="- topic/shortdesc ">
     在 SWF 文件中创建的所有本地共享对象的默认对象编码（AMF 版本）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在 SWF 文件中创建的所有本地共享对象的默认对象编码（AMF 版本）。在将本地共享对象写入磁盘时，<codeph class="+ topic/ph pr-d/codeph ">SharedObject.defaultObjectEncoding</codeph> 属性将表示应使用的 Action Message Format 的版本：ActionScript 3.0 格式 (AMF3)、ActionScript 1.0 还是 2.0 格式 (AMF0)。
     
     <p class="- topic/p ">关于对象编码的详细信息（包括本地和远程共享对象编码的差异），请参阅 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性的描述。</p>
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">SharedObject.defaultObjectEncoding</codeph> 的默认值设置为使用 ActionScript 3.0 格式 (AMF3)。如果要创建 ActionScript 2.0 或 1.0 SWF 文件可以读取的本地共享对象，则应在创建任何本地共享对象之前，在脚本起始处将 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.defaultObjectEncoding</codeph> 设置为使用 ActionScript 1.0 或 ActionScript 2.0 格式 (<codeph class="+ topic/ph pr-d/codeph ">flash.net.ObjectEncoding.AMF0</codeph>)。随后创建的所有本地共享对象都将使用 AMF0 编码，并可与旧内容交互。本地共享对象创建后，将无法更改现有本地共享对象的 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 值，通过设置 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.defaultObjectEncoding</codeph>。</p>
     
     <p class="- topic/p ">为了以每个对象为基础设置对象编码，而不是为 SWF 文件创建的所有共享对象设置对象编码，则应设置本地共享对象的 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/objectEncoding" class="- topic/link "><linktext class="- topic/linktext ">objectEncoding 属性</linktext></link><link href="flash.net.xml#ObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">ObjectEncoding 类</linktext></link></related-links></apiValue><apiValue id="flash.net:SharedObject:objectEncoding:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">objectEncoding</apiName><shortdesc class="- topic/shortdesc ">
     此共享对象的对象编码（AMF 版本）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">您尝试为某个远程共享对象设置 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性值。对于远程共享对象而言，此属性为只读，因为其值由关联的 NetConnection 实例决定。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ReferenceError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ReferenceError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此共享对象的对象编码（AMF 版本）。在将本地共享对象写入磁盘时，<codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性将表示应使用的 Action Message Format 的版本：ActionScript 3.0 格式 (AMF3)、ActionScript 1.0 还是 2.0 格式 (AMF0)。 
     
     <p class="- topic/p ">根据共享对象是本地还是远程来执行不同的对象编码操作。</p>
     <ul class="- topic/ul "><li class="- topic/li "><b class="+ topic/ph hi-d/b ">本地共享对象</b>。您可以为本地共享对象获取或设置 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性值。<codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 的值影响在<i class="+ topic/ph hi-d/i ">写入</i> 此本地共享对象时使用的格式设置。如果此本地共享对象必须能被 ActionScript 2.0 或 1.0 SWF 文件读取，则应将 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF0</codeph>。即便对象编码设置为写入 AMF3，Flash Player 仍然能够读取 AMF0 本地共享对象。也就是说，如果使用此属性的默认值，即 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF3</codeph>，则您的 SWF 文件仍然能够读取由 ActionScript 2.0 或 1.0 SWF 文件创建的共享对象。
     </li><li class="- topic/li "><b class="+ topic/ph hi-d/b ">远程共享对象</b>。连接到服务器时，远程共享对象从关联的 NetConnection 实例（此实例用于连接到远程共享对象）继承其 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 设置。未连接到服务器时，远程共享对象从关联的 NetConnection 实例继承 <codeph class="+ topic/ph pr-d/codeph ">defaultObjectEncoding</codeph> 设置。因为远程共享对象的 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性值由 NetConnection 实例决定，所以此属性对远程共享对象为只读。
     </li></ul>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#SharedObject/defaultObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">defaultObjectEncoding</linktext></link><link href="flash.net.xml#ObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">flash.net.ObjectEncoding</linktext></link></related-links></apiValue><apiValue id="flash.net:SharedObject:size:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">size</apiName><shortdesc class="- topic/shortdesc ">
     共享对象的当前大小（以字节为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">SharedObject, SharedObject.getSize, getSize
      
      </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     共享对象的当前大小（以字节为单位）。
     
     <p class="- topic/p ">Flash 通过逐一计算共享对象的每个数据属性计算该对象的大小；对象具有的数据属性越多，评估其大小所花的时间就越长。评估对象大小可能要耗费相当长的处理时间，因此，除非您对它具有特定的需要，否则您可能希望避免使用此方法。</p>
     
     </apiDesc><example conref="examples\SharedObject.size.1.as" class="- topic/example "> 以下代码使用 ID <codeph class="+ topic/ph pr-d/codeph ">"thehobbit"</codeph> 创建 SharedObject 对象。将名为 <codeph class="+ topic/ph pr-d/codeph ">username</codeph> 的属性添加到 SharedObject 对象的数据属性中。然后跟踪 <codeph class="+ topic/ph pr-d/codeph ">size</codeph> 属性，这将返回表示的值。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">fps</apiName><shortdesc class="- topic/shortdesc ">
     指定每秒钟客户端对共享对象所做的更改被发送到服务器的次数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>server-specific: The info is relevant for Flash Media Server, but not Flex.
     </internal></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="write" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定每秒钟客户端对共享对象所做的更改被发送到服务器的次数。 
     
     <p class="- topic/p ">如果希望控制客户端与服务器之间的通信量，可以使用此方法。例如，如果客户端与服务器之间的连接相对较慢，可以将 <codeph class="+ topic/ph pr-d/codeph ">fps</codeph> 设置为一个相对较小的值。相反，如果客户端连接到一个对时间具有高要求的多用户应用程序，可能需要将 <codeph class="+ topic/ph pr-d/codeph ">fps</codeph> 设置为一个相对较大的值。</p>
     
     <p class="- topic/p ">设置 <codeph class="+ topic/ph pr-d/codeph ">fps</codeph> 将触发 <codeph class="+ topic/ph pr-d/codeph ">sync</codeph> 事件并更新对服务器的所有更改。如果只想手动更新服务器，可将 <codeph class="+ topic/ph pr-d/codeph ">fps</codeph> 为 0。</p>
     
     <p class="- topic/p ">在调度 <codeph class="+ topic/ph pr-d/codeph ">sync</codeph> 事件之前，不会将更改发送给服务器。也就是说，如果服务器的响应时间较慢，向服务器发送更新的频率则可能小于此属性中的指定值。 </p>
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetGroupInfo" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetGroupInfo</apiName><shortdesc class="- topic/shortdesc ">
NetGroupInfo 类指定与 NetGroup 对象的基础 RTMFP 同级对同级数据传输相关的各种服务质量 (QOS) 统计数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
NetGroupInfo 类指定与 NetGroup 对象的基础 RTMFP 同级对同级数据传输相关的各种服务质量 (QOS) 统计数据。<codeph class="+ topic/ph pr-d/codeph ">NetGroup.info</codeph> 属性返回一个 NetGroupInfo 对象，该对象是当前 QOS 状态的快照。

</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/info" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.info</linktext></link><link href="flash.net.xml#NetGroup/post()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.post()</linktext></link><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNearest()</linktext></link><link href="flash.net.xml#NetGroup/sendToNeighbor()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNeighbor()</linktext></link><link href="flash.net.xml#NetGroup/sendToAllNeighbors()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToAllNeighbors()</linktext></link><link href="flash.net.xml#NetGroup/addWantObjects()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.addWantObjects()</linktext></link><link href="flash.net.xml#NetGroup/writeRequestedObject()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.writeRequestedObject()</linktext></link></related-links><apiOperation id="flash.net:NetGroupInfo:toString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">toString</apiName><shortdesc class="- topic/shortdesc ">
     返回包含 NetGroupInfo 对象属性值的字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个包含 NetGroupInfo 对象的属性值的字符串
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiReturn><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">返回列出此 NetGroupInfo 对象属性的文本值。
     </apiTipText></apiTipTexts></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回包含 NetGroupInfo 对象属性值的字符串。
     
     </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.net:NetGroupInfo:objectReplicationReceiveBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">objectReplicationReceiveBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定本地节点通过对象复制系统从同级接收对象所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定本地节点通过对象复制系统从同级接收对象所使用的速率，以每秒字节数为单位。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/writeRequestedObject()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.writeRequestedObject()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroupInfo:objectReplicationSendBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">objectReplicationSendBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定对象通过对象复制系统从本地节点复制到同级所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定对象通过对象复制系统从本地节点复制到同级所使用的速率，以每秒字节数为单位。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/writeRequestedObject()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.writeRequestedObject()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroupInfo:postingReceiveControlBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">postingReceiveControlBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定本地节点从同级接收发送的控件开销消息所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定本地节点从同级接收发送的控件开销消息所使用的速率，以每秒字节数为单位。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/post()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.post()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroupInfo:postingReceiveDataBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">postingReceiveDataBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定本地节点从同级接收发送的数据所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定本地节点从同级接收发送的数据所使用的速率，以每秒字节数为单位。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/post()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.post()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroupInfo:postingSendControlBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">postingSendControlBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定本地节点将发送的控件开销消息发送到同级所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定本地节点将发送的控件开销消息发送到同级所使用的速率，以每秒字节数为单位。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/post()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.post()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroupInfo:postingSendDataBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">postingSendDataBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定本地节点将发送的数据发送到同级所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定本地节点将发送的数据发送到同级所使用的速率，以每秒字节数为单位。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/post()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.post()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroupInfo:routingReceiveBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">routingReceiveBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定本地节点从同级接收定向路由消息所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定本地节点从同级接收定向路由消息所使用的速率，以每秒字节数为单位。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNearest()</linktext></link><link href="flash.net.xml#NetGroup/sendToNeighbor()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNeighbor()</linktext></link><link href="flash.net.xml#NetGroup/sendToAllNeighbors()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToAllNeighbors()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetGroupInfo:routingSendBytesPerSecond:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">routingSendBytesPerSecond</apiName><shortdesc class="- topic/shortdesc ">
     指定本地节点向同级发送定向路由消息所使用的速率，以每秒字节数为单位。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定本地节点向同级发送定向路由消息所使用的速率，以每秒字节数为单位。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetGroup/sendToNearest()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNearest()</linktext></link><link href="flash.net.xml#NetGroup/sendToNeighbor()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToNeighbor()</linktext></link><link href="flash.net.xml#NetGroup/sendToAllNeighbors()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetGroup.sendToAllNeighbors()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:URLLoaderDataFormat" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">URLLoaderDataFormat</apiName><shortdesc class="- topic/shortdesc ">
 URLLoaderDataFormat 类提供了一些用于指定如何接收已下载数据的值。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 URLLoaderDataFormat 类提供了一些用于指定如何接收已下载数据的值。
 
 </apiDesc><example conref="examples\URLLoaderDataFormatExample.as" class="- topic/example "> 下例使用 URLLoaderDataFormatExample 类显示在运行时加载的文件的数据格式和状态信息。这是使用以下步骤完成的：
 <ol class="- topic/ol "><li class="- topic/li ">类构造函数创建一个名为 <codeph class="+ topic/ph pr-d/codeph ">loader</codeph> 的 URLLoader 和一个名为 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> 的 URLRequest 实例，后者为要加载的文件的位置和名称。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">loader</codeph> 对象被传递给 <codeph class="+ topic/ph pr-d/codeph ">configureListeners()</codeph> 方法，该方法可为每个受支持的 URLLoader 事件添加侦听器：
  <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">completeHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件，在成功加载 TextFile.txt 后调度该事件。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">openHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">open</codeph> 事件，开始下载 TextFile.txt（至播放器）时调度该事件。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">progressHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 事件，在下载操作过程中收到数据时调度该事件。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">securityErrorHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">securityError</codeph> 事件，如果访问文本文件时使用了错误的本地回放安全设置，则调度该事件。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">httpStatusHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">httpStatusHandler</codeph> 事件，在此示例不调度该事件，因为 TextFile.txt 是本地文件。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">ioErrorHandler()</codeph>：侦听 <codeph class="+ topic/ph pr-d/codeph ">ioError</codeph> 事件，仅当文件出现严重问题（如文件丢失）时才发生该事件。</li></ul></li><li class="- topic/li ">随后 <codeph class="+ topic/ph pr-d/codeph ">request</codeph> 对象被传递给 <codeph class="+ topic/ph pr-d/codeph ">loader.load()</codeph> 方法，该方法会使用 <codeph class="+ topic/ph pr-d/codeph ">DisplayObject</codeph> 对象将文本文件加载到内存中。</li></ol>
 <p class="- topic/p "> <b class="+ topic/ph hi-d/b ">注意：</b>
 <ul class="- topic/ul "><li class="- topic/li ">您需要编译 SWF 文件，将“本地播放安全性”设置为“只访问本地文件”。
  </li><li class="- topic/li ">该示例要求名为 TextFile.txt 的文件与 SWF 文件放在同一目录中。如果希望该示例识别二进制或 URL 编码数据文件，则需要用适当的数据格式来提供该文件，并将 TextFile.txt 更改为新文件的名称和位置。</li></ul>
 </p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/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" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">BINARY</apiName><shortdesc class="- topic/shortdesc ">
	 指定以原始二进制数据形式接收下载的数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">binary</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定以原始二进制数据形式接收下载的数据。
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLLoaderDataFormat:TEXT" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">TEXT</apiName><shortdesc class="- topic/shortdesc ">
	 指定以文本形式接收已下载的数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">text</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定以文本形式接收已下载的数据。
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:URLLoaderDataFormat:VARIABLES" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">VARIABLES</apiName><shortdesc class="- topic/shortdesc ">
	 指定以 URL 编码变量形式接收下载的数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">variables</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定以 URL 编码变量形式接收下载的数据。
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetStreamPlayTransitions" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetStreamPlayTransitions</apiName><shortdesc class="- topic/shortdesc ">
 
 NetStreamPlayTransitions 类指定可与 NetStreamPlayOptions.transition 属性一起使用的有效字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 
 NetStreamPlayTransitions 类指定可与 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayOptions.transition</codeph> 属性一起使用的有效字符串。这些字符串可控制用于过渡到新流或播放流的行为，具体取决于使用的过渡模式。
 
 </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamPlayOptions" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link></related-links><apiValue id="flash.net:NetStreamPlayTransitions:APPEND_AND_WAIT" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">APPEND_AND_WAIT</apiName><shortdesc class="- topic/shortdesc ">
     
    构建播放列表，无需从第一个流开始播放。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">appendAndWait</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
    构建播放列表，无需从第一个流开始播放。 
    
    <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">APPEND_AND_WAIT</codeph> 过渡模式同 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 方法配合使用，以创建无需从第一个流立即开始播放的播放列表。使用此模式加载播放列表中的每个项目，但最后一个项目除外。加载播放列表中的最后一个流时，请将过渡模式设置为 <codeph class="+ topic/ph pr-d/codeph ">RESUME</codeph>。此时，Flash Player 开始流传输并播放该列表。</p>
    
    <p class="- topic/p ">您可以使用此模式重新构建列表，或者在丢失的连接恢复后重新构建播放列表。对于新的播放列表，当使用 <codeph class="+ topic/ph pr-d/codeph ">RESUME</codeph> 调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 时，Flash Player 从第一个流或从指定的开始位置开始流传输并播放。要恢复丢失的连接，当您使用 <codeph class="+ topic/ph pr-d/codeph ">RESUME</codeph> 调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play2()</codeph> 方法时，Flash Player 将确定流中断的位置并表示服务器从该位置开始流传输。而服务器也能够确定播放列表中与该位置对应的流，并从该位置开始流传输。</p>
    
    <p class="- topic/p ">与这种过渡模式相反的模式是 <codeph class="+ topic/ph pr-d/codeph ">APPEND</codeph> 模式，在该模式下，从第一个流立即开始播放。</p>
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamPlayTransitions/APPEND" class="- topic/link "><linktext class="- topic/linktext ">APPEND</linktext></link><link href="flash.net.xml#NetStreamPlayTransitions/RESUME" class="- topic/link "><linktext class="- topic/linktext ">RESUME</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayTransitions:APPEND" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">APPEND</apiName><shortdesc class="- topic/shortdesc ">
     
    向播放列表添加流并从第一个流开始播放。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">append</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
    向播放列表添加流并从第一个流开始播放。此模式与 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法（将 <codeph class="+ topic/ph pr-d/codeph ">reset</codeph> 标志设置为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>）具有相同的功能。
    
    <p class="- topic/p ">在此模式下，Flash Media Server 将对 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayOptions.streamName</codeph> 中指定的流在播放列表的末尾进行排队，并忽略 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayOptions.oldStreamName</codeph> 参数。</p> 
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamPlayTransitions/APPEND_AND_WAIT" class="- topic/link "><linktext class="- topic/linktext ">APPEND_AND_WAIT</linktext></link><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/oldStreamName" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions.oldStreamName</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/streamName" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions.streamName</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayTransitions:RESET" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">RESET</apiName><shortdesc class="- topic/shortdesc ">
    
    清除任何以前的播放调用，并立即播放指定的流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">reset</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    
    清除任何以前的播放调用，并立即播放指定的流。此模式与将 <codeph class="+ topic/ph pr-d/codeph ">reset</codeph> 标志设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>（<codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 的默认行为）的 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法具有相同的功能。
    
    <p class="- topic/p ">在此模式下，将刷新当前播放的流，并开始播放 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayOptions.streamName</codeph> 中指定的流。<codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayOptions.oldStreamName</codeph> 参数将被忽略。</p> 
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/oldStreamName" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions.oldStreamName</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/streamName" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions.streamName</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayTransitions:RESUME" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">RESUME</apiName><shortdesc class="- topic/shortdesc ">
     
    从上一个连接结束的点开始从新连接请求数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">resume</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
    从上一个连接结束的点开始从新连接请求数据。<codeph class="+ topic/ph pr-d/codeph ">RESUME</codeph> 模式对齐两个连接之间的流，因此在视频回放时没有发现任何不自然感或跳转。使用此模式重新连接由于服务器问题或其他连接问题已删除的流。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamPlayTransitions/APPEND_AND_WAIT" class="- topic/link "><linktext class="- topic/linktext ">APPEND_AND_WAIT</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayTransitions:STOP" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">STOP</apiName><shortdesc class="- topic/shortdesc ">
     
    停止播放播放列表中的流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">stop</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
    停止播放播放列表中的流。此模式与调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play(false)</codeph> 具有相同的功能。它将停止并重置播放列表。
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/play()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play()</linktext></link><link href="flash.net.xml#NetStream/play2()" class="- topic/link "><linktext class="- topic/linktext ">NetStream.play2()</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayTransitions:SWAP" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">SWAP</apiName><shortdesc class="- topic/shortdesc ">
    将一个内容流替换为其它内容流，并保留播放列表的其余部分。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">swap</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    将一个内容流替换为其它内容流，并保留播放列表的其余部分。
    
    <p class="- topic/p ">此模式将替换在 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayOptions.oldStreamName</codeph> 中指定的流和在 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayOptions.streamName</codeph> 中指定的流。播放列表的其余部分将被保留。在此模式下，Flash Media Server 将不对流的内容做出假设，而是将它们视为不同的内容。 </p>
    
    <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">oldStreamName</codeph> 尚未发送，则服务器将在流边界执行切换，并从头开始发送 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 的位。如果服务器已开始发送 <codeph class="+ topic/ph pr-d/codeph ">oldStreamName</codeph> 的字节，但没有切换到 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph>，则将发送 <codeph class="+ topic/ph pr-d/codeph ">NetStream.Play.Failed</codeph> 事件。</p>
    
    <p class="- topic/p ">如果要切换的各个流互不相关，并且这些流具有不同的内容和长度，请使用此模式。例如，当您希望基于用户跟踪和过去的从商业角度统计的数据互换商业信息，请使用此模式。</p>
    
    <p class="- topic/p ">要从一个流切换到另一个包含相同内容的流，请使用 <codeph class="+ topic/ph pr-d/codeph ">SWITCH</codeph> 模式替代。</p>
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamPlayTransitions/SWITCH" class="- topic/link "><linktext class="- topic/linktext ">SWITCH</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/oldStreamName" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions.oldStreamName</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/streamName" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions.streamName</linktext></link></related-links></apiValue><apiValue id="flash.net:NetStreamPlayTransitions:SWITCH" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">SWITCH</apiName><shortdesc class="- topic/shortdesc ">
    从播放一个流切换为播放另一个流（通常使用具有相同内容的流）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">switch</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
    从播放一个流切换为播放另一个流（通常使用具有相同内容的流）。在 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayOptions.oldStreamName</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">NetStreamPlayOptions.streamName</codeph> 中指定要切换的流。 
    
    <p class="- topic/p ">要切换到具有相同内容但以不同比特率或分辨率进行编码的流，请使用此模式。例如，当应用程序在播放列表中对流进行排队或以特定比特率播放单个流，然后通过计算可用带宽或 CPU 处理能力是低于或高于流要求时，请使用此模式。然后，应用程序可以使用更高或更低的比特率更新这些流。</p>
    
    <p class="- topic/p ">在此模式下，Flash Media Server 对 <codeph class="+ topic/ph pr-d/codeph ">oldStreamName</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph> 流之间的关系进行一些假设。服务器假设这些流具有相同的内容和相同的关键帧间隔，但其分辨率或比特率不同。</p>
    
    <p class="- topic/p ">当播放列表已进行排队并且 <codeph class="+ topic/ph pr-d/codeph ">oldStreamName</codeph> 是播放列表中的一个流或者当前正在播放时，<codeph class="+ topic/ph pr-d/codeph ">oldStreamName</codeph> 将被替换为 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph>。</p>
    
    <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">oldStreamName</codeph> 为 null 或未定义，或者未在播放列表中，则服务器会在下一个逻辑点切换到 <codeph class="+ topic/ph pr-d/codeph ">streamName</codeph>，以确保进行平滑切换。</p>
    
    <p class="- topic/p ">要从一个流切换到另一个包含不同内容的流，请使用 <codeph class="+ topic/ph pr-d/codeph ">SWAP</codeph> 模式替代。</p>
    
    
    </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStreamPlayTransitions/SWAP" class="- topic/link "><linktext class="- topic/linktext ">SWAP</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/oldStreamName" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions.oldStreamName</linktext></link><link href="flash.net.xml#NetStreamPlayOptions/streamName" class="- topic/link "><linktext class="- topic/linktext ">NetStreamPlayOptions.streamName</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.net:NetConnection" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">NetConnection</apiName><shortdesc class="- topic/shortdesc ">
 NetConnection 类在客户端和服务器之间创建双向连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetConnection, Video
 </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 NetConnection 类在客户端和服务器之间创建双向连接。客户端可以是 <ph class="- topic/ph ">Flash Player 或 AIR</ph> 应用程序。服务器可以是 Web 服务器、Flash Media Server、运行 Flash Remoting 的应用程序服务器或 <xref href="http://labs.adobe.com/technologies/stratus/" scope="external" class="- topic/xref ">Adobe 状态</xref>服务。调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph> 以建立连接。使用 NetStream 通过该连接发送媒体流和数据。
 
 <p class="- topic/p ">有关向 Flash Player 和 AIR 中加载内容和数据的安全性信息，请参阅以下内容：</p>
 
 <ul class="- topic/ul "><li class="- topic/li ">要从 Web 服务器或本地位置向 Flash Player 中加载内容和数据，请参阅 <xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">Flash Player 开发人员中心：安全</xref>。</li><li class="- topic/li ">要从 Flash Media Server 向 Flash Player 和 AIR 中加载内容和数据，请参阅 <xref href="http://www.adobe.com/support/flashmediaserver" scope="external" class="- topic/xref ">Flash Media Server 文档</xref>。</li><li class="- topic/li ">要向 AIR 中加载内容和数据，请参阅 <xref href="http://www.adobe.com/cn/devnet/air/" scope="external" class="- topic/xref ">Adobe AIR 开发人员中心</xref>。</li></ul>
 
 <p class="- topic/p ">
 要为该类编写回调方法，可以扩展该类，然后在子类中定义回调方法，或将 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性分配给某个对象，然后对该对象定义回调方法。</p>
 
 </apiDesc><example conref="examples\NetConnectionExample.as" class="- topic/example "> 以下示例将 Video 对象与 NetConnection 和 NetStream 类一同使用，以加载和播放 FLV 文件。 
 <p class="- topic/p ">在本例中，创建 Video 和 NetStream 对象并调用 <codeph class="+ topic/ph pr-d/codeph ">Video.attachNetStream()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 方法的代码放在处理函数中。仅当连接到 NetConnection 对象的尝试取得成功时才调用处理函数，即，当 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件返回 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 对象（带有一个表示成功的 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性）时，才调用该处理函数。建议您在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 之前，等待连接成功。 </p>
 <codeblock xml:space="preserve" class="+ topic/pre pr-d/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 = "http://www.helpexamples.com/flash/video/cuepoints.flv";
        private var connection:NetConnection;
        private var stream:NetStream;
        private var video:Video = new Video();        

        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();
            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 class="- topic/related-links "><link href="flash.net.xml#NetConnection/client" class="- topic/link "><linktext class="- topic/linktext ">client</linktext></link><link href="flash.net.xml#NetStream" class="- topic/link "><linktext class="- topic/linktext ">NetStream</linktext></link><link href="flash.net.xml#NetConnection/connect()" class="- topic/link "><linktext class="- topic/linktext ">connect()</linktext></link><link href="flash.net.xml#Responder" class="- topic/link "><linktext class="- topic/linktext ">flash.net.Responder</linktext></link></related-links><adobeApiEvent id="flash.net:NetConnection_flash.events.NetStatusEvent.NET_STATUS_netStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">netStatus</apiName><shortdesc class="- topic/shortdesc ">
 在 NetConnection 对象报告其状态或错误条件时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.NetStatusEvent.NET_STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.NetStatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在 NetConnection 对象报告其状态或错误条件时调度。<codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件包含一个 <codeph class="+ topic/ph pr-d/codeph ">info</codeph> 属性，该属性是一个包含事件特定信息（例如，连接尝试成功还是失败）的信息对象。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.events.xml#NetStatusEvent/info" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetConnection_flash.events.SecurityErrorEvent.SECURITY_ERROR_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><shortdesc class="- topic/shortdesc ">
 若对 NetConnection.call() 的调用尝试连接到调用方安全沙箱外部的服务器，则进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.SecurityErrorEvent.SECURITY_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 若对 NetConnection.call() 的调用尝试连接到调用方安全沙箱外部的服务器，则进行调度。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection/call()" class="- topic/link "><linktext class="- topic/linktext ">NetConnection.call()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.net:NetConnection_flash.events.IOErrorEvent.IO_ERROR_ioError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">ioError</apiName><shortdesc class="- topic/shortdesc ">
 在出现输入或输出错误并导致网络操作失败时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.IOErrorEvent.IO_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.IOErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在出现输入或输出错误并导致网络操作失败时调度。
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.net:NetConnection_flash.events.AsyncErrorEvent.ASYNC_ERROR_asyncError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">asyncError</apiName><shortdesc class="- topic/shortdesc ">
 在异步引发异常（即来自本机异步代码）时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.AsyncErrorEvent.ASYNC_ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.AsyncErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 在异步引发异常（即来自本机异步代码）时调度。
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.net:NetConnection:NetConnection" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">NetConnection</apiName><shortdesc class="- topic/shortdesc ">
     创建一个 NetConnection 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><oldexample>See the example for <code>connect()</code>.
     
     </oldexample></asCustoms></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建一个 NetConnection 对象。调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法以建立连接。
     
     <p class="- topic/p ">如果应用程序需要与在 Flash Player 9 之前发布的服务器进行通信，请设置 NetConnection 对象的 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性。</p>
     
     <p class="- topic/p ">以下代码可创建一个 NetConnection 对象。</p>
     
     <pre xml:space="preserve" class="- topic/pre ">
     var nc:NetConnection = new NetConnection();
     </pre>
     
     
     </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection/connect()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetConnection.connect()</linktext></link><link href="flash.net.xml#NetConnection/objectEncoding" class="- topic/link "><linktext class="- topic/linktext ">objectEncoding</linktext></link></related-links></apiConstructor><apiOperation id="flash.net:NetConnection:addHeader" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">addHeader</apiName><shortdesc class="- topic/shortdesc ">
     将上下文标头添加到 Action Message Format (AMF) 数据包结构中。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">operation</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">标识标头和与之相关的 ActionScript 对象数据。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">mustUnderstand</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">值为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 表示服务器必须先了解和处理此标头再处理任一后续标头或消息。
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">param</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Object</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">任一 ActionScript 对象。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     将上下文标头添加到 Action Message Format (AMF) 数据包结构中。此标头将随以后的每个 AMF 数据包一起发送。如果使用相同的名称调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.addHeader()</codeph>，则新标头将代替现有标头，并在 NetConnection 对象的持续时间内始终使用新标头。通过使用标头名称调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.addHeader()</codeph> 以删除未定义的对象，可以删除标头。
     
     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.net:NetConnection:call" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">call</apiName><shortdesc class="- topic/shortdesc ">
     在 Flash Media Server 或运行 Flash Remoting 的应用程序服务器上调用一个命令或方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">command</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">以 <codeph class="+ topic/ph pr-d/codeph ">[objectPath/]method</codeph> 的形式指定的方法。例如，<codeph class="+ topic/ph pr-d/codeph ">someObject/doSomething</codeph> 命令将通知远程服务器调用 <codeph class="+ topic/ph pr-d/codeph ">clientObject.someObject.doSomething()</codeph> 方法，并带有所有可选的 <codeph class="+ topic/ph pr-d/codeph ">... arguments</codeph> 参数。如果缺少对象路径，则将在远程服务器上调用 <codeph class="+ topic/ph pr-d/codeph ">clientObject.doSomething()</codeph>。
     <p class="- topic/p ">
     如果使用 Flash Media Server，<codeph class="+ topic/ph pr-d/codeph ">command</codeph> 是在应用程序的服务器端脚本中定义的函数的名称。如果将服务器端脚本放在应用程序目录的根级别，则不需要在 <codeph class="+ topic/ph pr-d/codeph ">command</codeph> 前面使用对象路径。
     </p>
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">responder</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:Responder</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可选对象，用于处理服务器的返回值。Responder 对象可以用两个定义的方法来处理返回的结果：<codeph class="+ topic/ph pr-d/codeph ">result</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">status</codeph>。如果返回的结果为错误，则将调用 <codeph class="+ topic/ph pr-d/codeph ">status</codeph>；否则，将调用 <codeph class="+ topic/ph pr-d/codeph ">result</codeph>。Responder 对象可以处理与特定操作有关的错误，而 NetConnection 对象则响应与连接状态有关的错误。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">arguments</apiItemName><apiType value="restParam" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">可选参数，可以为任一 ActionScript 类型，并包括对另一个 ActionScript 对象的引用。当在远程应用程序服务器上执行 <codeph class="+ topic/ph pr-d/codeph ">command</codeph> 参数中指定的方法时，这些参数将被传递给该方法。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在 Flash Media Server 或运行 Flash Remoting 的应用程序服务器上调用一个命令或方法。在调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.call()</codeph> 之前，必须先调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph> 以连接到服务器。必须创建要传递给此方法的服务器端函数。
     
     <p class="- topic/p ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#Responder" class="- topic/link "><linktext class="- topic/linktext ">flash.net.Responder</linktext></link></related-links><adobeApiEvent id="flash.net:NetConnection:call_securityError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">securityError</apiName><prolog class="- topic/prolog "/><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events:SecurityErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">尝试与位于调用方安全沙箱外部的服务器进行通信的调用。可通过在服务器上使用策略文件来避免出现此问题。
     </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">尝试与位于调用方安全沙箱外部的服务器进行通信的调用。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.net:NetConnection:close" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">close</apiName><shortdesc class="- topic/shortdesc ">
     关闭本地打开的连接或到服务器的连接，并调度 code 属性值为 NetConnection.Connect.Closed 的 netStatus 事件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     关闭本地打开的连接或到服务器的连接，并调度 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件，<codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性值为 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.Connect.Closed</codeph>。
     
     <p class="- topic/p ">
     此方法断开在此连接上运行的所有 NetStream 对象。队列中尚未发送的所有数据将被丢弃。（要终止本地或服务器流而不关闭连接，请使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.close()</codeph>。） 如果关闭连接，然后要创建一个新连接，则必须创建新的 NetConnection 对象并再次调用 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 方法。
     </p>
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 方法还会断开在此连接上运行的所有远程共享对象。不过，不必重新创建要重新连接的共享对象，您只需调用 <codeph class="+ topic/ph pr-d/codeph ">SharedObject.connect()</codeph> 以重新建立到共享对象的连接。此外，在发出 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.close()</codeph> 时排在队列中的共享对象中的任何数据都将在重建与共享对象的连接之后发送。</p>
     
     <p class="- topic/p ">
     如果使用 Flash Media Server，最佳开发做法是在客户端不再需要到服务器的连接时调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph>。调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 是清除未使用的连接的最快捷方法。作为一种替代方法，您可以将服务器配置为自动关闭空闲连接。有关详细信息，请参阅 <i class="+ topic/ph hi-d/i "><xref href="http://www.adobe.com/support/documentation" scope="external" class="- topic/xref ">Flash Media Server Configuration and Administration Guide</xref></i>（《Flash Media Server 配置和管理指南》）。
     </p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream" class="- topic/link "><linktext class="- topic/linktext ">NetStream</linktext></link><link href="flash.events.xml#NetStatusEvent/info" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info</linktext></link></related-links></apiOperation><apiOperation id="flash.net:NetConnection:connect" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">connect</apiName><shortdesc class="- topic/shortdesc ">
     创建到 Flash Media Server 上某个应用程序或到 Flash Remoting 的双向连接，或为 RTMFP 对等组通信创建双向网络端点。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">NetConnection.connect, connect
     
     </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">传递给 <codeph class="+ topic/ph pr-d/codeph ">command</codeph> 参数的 URI 格式不正确。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">连接失败。这可能是由于从 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件处理函数中调用了 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph>，而这是不允许的。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">IOError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.errors:IOError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">与本地文件系统内容交互的 SWF 文件无法与 Internet 进行通信。可通过将此 SWF 文件重新分类为只能与远程内容交互或受信任来避免出现这种问题。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">SecurityError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">SecurityError</apiOperationClassifier></apiException><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">command</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对 <codeph class="+ topic/ph pr-d/codeph ">command</codeph> 参数使用下列值之一：
     <ul class="- topic/ul "><li class="- topic/li ">要从本地文件系统或从 Web 服务器播放视频和 mp3 文件，可传递 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</li><li class="- topic/li ">要连接到运行 Flash Remoting 的应用程序服务器，可传递使用 <codeph class="+ topic/ph pr-d/codeph ">http</codeph> 协议的 URL。</li><li class="- topic/li ">（Flash Player 10.1 或 AIR 2 或更高版本）要为 RTMFP IP 多播通信创建无服务器的网络端点，可传递字符串 <codeph class="+ topic/ph pr-d/codeph ">"rtmfp:"</codeph>。使用此连接类型可从发布者接收 IP 多播流，无需使用服务器。您也可以使用此连接类型通过 IP 多播来发现同一局域网 (LAN) 上的对等应用程序。</li><p class="- topic/p ">此连接类型具有以下限制：</p><p class="- topic/p ">仅同一 LAN 上的对等应用程序可以发现彼此。</p><p class="- topic/p ">Flash Player 使用 IP 多播可以接收流，但不能发送流。</p><p class="- topic/p ">Flash Player 和 AIR 可以在对等组中发送和接收流，但这些对等应用程序必须是使用 IP 多播在同一 LAN 上发现的。</p><p class="- topic/p ">此技术不适用于一对一通信。</p><p class="- topic/p "/><li class="- topic/li ">要连接到 Flash Media Server，可传递服务器上应用程序的 URI。应使用以下语法（方括号中的项是可选的）：
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">protocol:[//host][:port]/appname[/instanceName]</codeph></p>
     
     <p class="- topic/p ">使用下列协议之一：<codeph class="+ topic/ph pr-d/codeph ">rtmp</codeph>、<codeph class="+ topic/ph pr-d/codeph ">rtmpe</codeph>、<codeph class="+ topic/ph pr-d/codeph ">rtmps</codeph>、<codeph class="+ topic/ph pr-d/codeph ">rtmpt</codeph>、<codeph class="+ topic/ph pr-d/codeph ">rtmpte</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">rtmfp</codeph>。如果连接成功，则会返回 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件，<codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性值为 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.Connect.Success</codeph>。请参阅 <codeph class="+ topic/ph pr-d/codeph ">NetStatusEvent.info</codeph> 属性，获得有关为响应 <codeph class="+ topic/ph pr-d/codeph ">connect()</codeph> 调用而返回的所有事件代码的列表。 </p>
     
     <p class="- topic/p ">如果文件是从安装服务器的同一台主机中提供的，则可以省略 <codeph class="+ topic/ph pr-d/codeph ">//host</codeph> 参数。如果省略 <codeph class="+ topic/ph pr-d/codeph ">/instanceName</codeph> 参数，<ph class="- topic/ph ">Flash Player 或</ph> AIR 将连接到应用程序的默认实例。</p>
     
     <p class="- topic/p ">（Flash Player 10.1 或 AIR 2 或更高版本）要创建对等应用程序，可使用 <codeph class="+ topic/ph pr-d/codeph ">rtmfp</codeph> 协议。</p>
     
     </li></ul>
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">arguments</apiItemName><apiType value="restParam" name="type" class="- topic/state reference/state apiRef/apiType "/><apiDesc class="- topic/section reference/section apiRef/apiDesc ">传递给 <codeph class="+ topic/ph pr-d/codeph ">command</codeph> 中指定的应用程序的任意类型可选参数。如果使用 Flash Media Server，会将额外的参数传递给应用程序服务器端代码中的 <codeph class="+ topic/ph pr-d/codeph ">application.onConnect()</codeph> 事件处理函数。您必须在 <codeph class="+ topic/ph pr-d/codeph ">onConnect()</codeph> 中定义并处理这些参数。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建到 Flash Media Server 上某个应用程序或到 Flash Remoting 的双向连接，或为 RTMFP 对等组通信创建双向网络端点。为了报告其状态或错误情况，对 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph> 的调用将调度 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件。
     
     <p class="- topic/p ">调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph> 会执行下列操作：</p>
     
     <ul class="- topic/ul "><li class="- topic/li ">传递“null”会从本地文件系统或 Web 服务器播放视频和 MP3 文件。</li><li class="- topic/li ">传递“http”URL 可连接到运行 Flash Remoting 的应用程序服务器。可使用 NetServices 类通过 NetConnection 对象调用应用程序服务器函数，并返回结果。有关详细信息，请参阅 <xref href="http://www.adobe.com/support/documentation" scope="external" class="- topic/xref ">Flash Remoting 文档</xref>。 </li><li class="- topic/li ">传递“rtmp/e/s”URL 可连接到 Flash Media Server 应用程序。</li><li class="- topic/li ">传递“rtmfp”URL 会为 RTMFP 客户端服务器、对等和 IP 多播通信创建双向网络端点。</li><li class="- topic/li ">传递字符串“rtmfp:”可为 RTMFP IP 多播通信创建无服务器的双向网络端点。</li></ul>
     
     <p class="- topic/p ">请考虑以下安全模型：</p>
     
     <ul class="- topic/ul "><li class="- topic/li ">默认情况下，<ph class="- topic/ph ">Flash Player 或</ph> AIR 拒绝沙箱之间的访问。网站可通过使用 URL 策略文件来实现对资源的访问。 </li><li class="- topic/li ">应用程序可以拒绝对服务器上的资源的访问。在 Flash Media Server 应用程序中，使用服务器端 ActionScript 代码以拒绝访问。请参阅 <xref href="http://www.adobe.com/go/learn_fms_docs_cn" scope="external" class="- topic/xref ">Flash Media Server 文档</xref>。</li><li class="- topic/li ">如果进行调用的文件位于只能与本地文件系统内容交互的沙箱中，则无法调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph>。</li><li class="- topic/li "> 无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。</li><li class="- topic/li ">要防止 SWF 文件调用此方法，可在包含 SWF 内容的 HTML 页中设置 <codeph class="+ topic/ph pr-d/codeph ">object</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">embed</codeph> 标签的 <codeph class="+ topic/ph pr-d/codeph ">allowNetworking</codeph> 参数。</li></ul>
     
     <p class="- topic/p ">但在 Adobe AIR 中，<codeph class="+ topic/ph pr-d/codeph ">application</codeph> 安全沙箱中的内容（使用 AIR 应用程序安装的内容）不受这些安全限制的约束。</p>
     
     <p class="- topic/p ">有关安全性的详细信息，请访问 Adobe Flash Player 开发人员中心：<xref href="http://www.adobe.com/go/devnet_security_cn" scope="external" class="- topic/xref ">安全</xref>。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream</linktext></link><link href="flash.events.xml#NetStatusEvent/info" class="- topic/link "><linktext class="- topic/linktext ">flash.events.NetStatusEvent.info</linktext></link></related-links></apiOperation><apiValue id="flash.net:NetConnection:client:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">client</apiName><shortdesc class="- topic/shortdesc ">
     表示对其调用回调方法的对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Property documented; needs review.
     
      </internal></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Object</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">必须将 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性设置为非空对象。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">TypeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">TypeError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示对其调用回调方法的对象。默认值为此 NetConnection 实例。如果将 <codeph class="+ topic/ph pr-d/codeph ">client</codeph> 属性设置为另一个对象，则将对该对象调用回调方法。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:connectedProxyType:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">connectedProxyType</apiName><shortdesc class="- topic/shortdesc ">
     用于成功连接到 Flash Media Server 的代理类型。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>This property is used in Breeze 5.5.
     
      </internal></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">已尝试在未连接 NetConnection 实例时访问此属性。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     用于成功连接到 Flash Media Server 的代理类型。可能值是：<codeph class="+ topic/ph pr-d/codeph ">“none”</codeph>、<codeph class="+ topic/ph pr-d/codeph ">“HTTP”</codeph>、<codeph class="+ topic/ph pr-d/codeph ">“HTTPS”</codeph>或<codeph class="+ topic/ph pr-d/codeph ">“CONNECT”</codeph>。
     
     <p class="- topic/p ">如果未使用隧道建立连接或连接是 SSL 连接，则此值为<codeph class="+ topic/ph pr-d/codeph ">“none”</codeph>。</p>
     
     <p class="- topic/p ">如果使用隧道通过 HTTP 建立连接，则此值为<codeph class="+ topic/ph pr-d/codeph ">“HTTP”</codeph>。</p>
     
     <p class="- topic/p ">如果使用隧道通过 HTTPS 建立连接，则此值为<codeph class="+ topic/ph pr-d/codeph ">“HTTPS”</codeph>。</p>
     
     <p class="- topic/p ">如果使用隧道借助 CONNECT 方法通过代理服务器建立连接，则此值为<codeph class="+ topic/ph pr-d/codeph ">“CONNECT”</codeph>。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:connected:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">connected</apiName><shortdesc class="- topic/shortdesc ">
     表示应用程序是否通过永久性的 RTMP 连接连接到服务器，如果是，则为 true，否则为 false。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示应用程序是否通过永久性的 RTMP 连接连接到服务器，如果是，则为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，否则为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。通过 HTTP 进行连接时，此属性为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>；除非是连接到应用程序服务器上的 Flash Remoting 服务，此时该属性为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:defaultObjectEncoding:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">defaultObjectEncoding</apiName><shortdesc class="- topic/shortdesc ">
     用于 NetConnection 对象的默认对象编码。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     用于 NetConnection 对象的默认对象编码。将对象写入到二进制数据中或从二进制数据中读取对象时，<codeph class="+ topic/ph pr-d/codeph ">defaultObjectEncoding</codeph> 属性将表示对数据进行序列化处理时使用的 Action Message Format (AMF) 版本：ActionScript 3.0 格式 (<codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF3</codeph>) 或 ActionScript 1.0 和 ActionScript 2.0 格式 (<codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF0</codeph>)。
     
     <p class="- topic/p ">默认值是 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF3</codeph>。更改 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.defaultObjectEncoding</codeph> 不会影响现有 NetConnection 实例，只会影响随后创建的实例。</p>
     
     <p class="- topic/p ">要单独设置某个对象的编码（而非设置整个应用程序的对象编码），请改为设置 NetConnection 对象的 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性。</p>
     
     <p class="- topic/p ">有关详细信息，请参阅关于 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性的描述。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection/objectEncoding" class="- topic/link "><linktext class="- topic/linktext ">NetConnection.objectEncoding</linktext></link><link href="flash.net.xml#ObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">flash.net.ObjectEncoding</linktext></link></related-links></apiValue><apiValue id="flash.net:NetConnection:farID:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">farID</apiName><shortdesc class="- topic/shortdesc ">
     与此 Flash Player 或 Adobe AIR 实例连接的 Flash Media Server 实例的标识符。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     与此 Flash Player 或 Adobe AIR 实例连接的 Flash Media Server 实例的标识符。此属性仅对于 RTMFP 连接才有意义。此属性的值仅在建立 RTMFP 连接之后可用。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection/nearID" class="- topic/link "><linktext class="- topic/linktext ">nearID</linktext></link></related-links></apiValue><apiValue id="flash.net:NetConnection:farNonce:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">farNonce</apiName><shortdesc class="- topic/shortdesc ">
     由 Flash Media Server 实际选择的一个值，该值对此连接是唯一的。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     由 Flash Media Server 实际选择的一个值，该值对此连接是唯一的。此值对服务器显示为其 <codeph class="+ topic/ph pr-d/codeph ">client.nearNonce</codeph> 值。仅为 RTMFP、RTMPE 和 RTMPTE 连接定义此值。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:httpIdleTimeout:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">httpIdleTimeout</apiName><shortdesc class="- topic/shortdesc "> 
        等待 HTTP 响应的时间（以毫秒计算）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2.6" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">等待 HTTP 响应的时间（以毫秒计算）。
        </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
        等待 HTTP 响应的时间（以毫秒计算）。默认值为零。
	
	<ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">httpIdleTimeout</codeph> 值为 <codeph class="+ topic/ph pr-d/codeph ">Number</codeph>。</li><li class="- topic/li ">使用 HTTP 连接时，正值表示非活动连接应该保持启用的毫秒数。</li><li class="- topic/li ">零值表示应该使用平台的默认网络空闲超时值。</li><li class="- topic/li ">负值将导致 <codeph class="+ topic/ph pr-d/codeph ">RangeError</codeph>。</li><li class="- topic/li ">如果超出 <codeph class="+ topic/ph pr-d/codeph ">httpIdleTimeout</codeph> 值，则调度 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件。</li><li class="- topic/li ">此属性只影响通过 HTTP 连接创建的 <codeph class="+ topic/ph pr-d/codeph ">NetConnection</codeph> 对象。通过 RTMP、RTMFP 或其他 HTTP 通道创建的 <codeph class="+ topic/ph pr-d/codeph ">NetConnection</codeph> 对象不受此属性的影响。</li></ul>
	<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
	//Set the timeout to 5 seconds
	connection = new NetConnection();
	connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
	connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
	connection.httpIdleTimeout = 5000;
	</codeblock>
	
	在基于 Linux 的系统中，<codeph class="+ topic/ph pr-d/codeph ">NetConnection</codeph> 会需要比使用 <codeph class="+ topic/ph pr-d/codeph ">httpIdleTimeout</codeph> 值指定的时间更长的秒数才能超时。
	
        </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:maxPeerConnections:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">maxPeerConnections</apiName><shortdesc class="- topic/shortdesc ">
     Flash Player 或 Adobe AIR 的此实例允许的传入和传出同级连接的总数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     Flash Player 或 Adobe AIR 的此实例允许的传入和传出同级连接的总数。默认值为 8。
     <p class="- topic/p ">此值不区分发行者连接和订户连接。如果在出现同级连接时此值减小，则新值只会影响新的传入连接。不会删除现有连接。</p>
     
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:nearID:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">nearID</apiName><shortdesc class="- topic/shortdesc ">
     用于此 NetConnection 实例的 Flash Player 或 Adobe AIR 实例的标识符。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     用于此 NetConnection 实例的 Flash Player 或 Adobe AIR 实例的标识符。此属性仅对于 RTMFP 连接才有意义。
     
     <p class="- topic/p ">每个 NetConnection 实例均具有一个唯一的 <codeph class="+ topic/ph pr-d/codeph ">nearID</codeph> 属性。Flash Player 或 Adobe AIR 实例或 NetConnection 实例所具有的标识符各不相同。</p>
     
     <p class="- topic/p ">其它 Flash Player 或 Adobe AIR 实例将此标识符用作与此客户端的新 NetStream 连接的 <codeph class="+ topic/ph pr-d/codeph ">peerID</codeph>。随后，此标识符是连接到此实例的任何同级 NetStream 中的 <codeph class="+ topic/ph pr-d/codeph ">farID</codeph>。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection/farID" class="- topic/link "><linktext class="- topic/linktext ">farID</linktext></link></related-links></apiValue><apiValue id="flash.net:NetConnection:nearNonce:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">nearNonce</apiName><shortdesc class="- topic/shortdesc ">
     由此 Flash Player 或 Adobe AIR 实例实际选择的一个值，该值对此连接是唯一的。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     由此 Flash Player 或 Adobe AIR 实例实际选择的一个值，该值对此连接是唯一的。此值对服务器显示为其 <codeph class="+ topic/ph pr-d/codeph ">client.farNonce</codeph> 值。仅为 RTMFP、RTMPE 和 RTMPTE 连接定义此值。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:objectEncoding:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">objectEncoding</apiName><shortdesc class="- topic/shortdesc ">
     此 NetConnection 实例的对象编码。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">连接 NetConnection 实例时，会尝试设置 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性值。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ReferenceError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ReferenceError</apiOperationClassifier></apiException><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">此属性被设置为 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF0</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF3</codeph> 以外的值。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     此 NetConnection 实例的对象编码。
     
     <p class="- topic/p ">
     将对象写入到二进制数据中或从二进制数据中读取对象时，<codeph class="+ topic/ph pr-d/codeph ">defaultObjectEncoding</codeph> 属性将表示对数据进行序列化处理时使用的 Action Message Format (AMF) 版本：ActionScript 3.0 格式 (<codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF3</codeph>) 或 ActionScript 1.0 和 ActionScript 2.0 格式 (<codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF0</codeph>)。可以设置 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性，以便为 NetConnection 实例设置 AMF 版本。
     </p>
     
     <p class="- topic/p ">如果应用程序需要与在 Flash Player 9 之前发布的服务器进行通信，则了解此属性非常重要。可能存在以下三种情况：
     </p>
     
     <ul class="- topic/ul "><li class="- topic/li ">连接到支持 AMF3 的服务器（如 Flex Data Services 2 或 Flash Media Server 3）。<codeph class="+ topic/ph pr-d/codeph ">defaultObjectEncoding</codeph> 的默认值是 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF3</codeph>。在此文件中创建的所有 NetConnection 实例均使用 AMF3 序列化，因此无需设置 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性。</li><li class="- topic/li ">连接到不支持 AMF3 的服务器（如 Flash Media Server 2）。在这种情况下，应将静态 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.defaultObjectEncoding</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF0</codeph>。在此 SWF 文件中创建的所有 NetConnection 实例均使用 AMF0 序列化。因此不必设置 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性。 </li><li class="- topic/li ">连接到使用不同编码版本的多个服务器。不使用 <codeph class="+ topic/ph pr-d/codeph ">defaultObjectEncoding</codeph>，而是使用每个连接的 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性设置每个连接的对象编码。要连接到使用 AMF0 编码的服务器（如 Flash Media Server 2），请将其设置为 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF0</codeph>；要连接到使用 AMF3 编码的服务器（如 Flex Data Services 2），请将其设置为 <codeph class="+ topic/ph pr-d/codeph ">ObjectEncoding.AMF3</codeph>。</li></ul>
     
     <p class="- topic/p ">在连接 NetConnection 实例后，其 <codeph class="+ topic/ph pr-d/codeph ">objectEncoding</codeph> 属性是只读的。</p>
     
     <p class="- topic/p ">如果连接服务器时使用了错误的编码，则 NetConnection 对象将调度 <codeph class="+ topic/ph pr-d/codeph ">netStatus</codeph> 事件。<codeph class="+ topic/ph pr-d/codeph ">NetStatusEvent.info</codeph> 属性包含一个信息对象，此信息对象具有 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性，值为 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.Connect.Failed</codeph>，并包含说明对象编码不正确的描述。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetConnection/defaultObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">defaultObjectEncoding</linktext></link><link href="flash.net.xml#ObjectEncoding" class="- topic/link "><linktext class="- topic/linktext ">flash.net.ObjectEncoding</linktext></link></related-links></apiValue><apiValue id="flash.net:NetConnection:protocol:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">protocol</apiName><shortdesc class="- topic/shortdesc ">
     用于建立连接的协议。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">已尝试在未连接 NetConnection 实例时访问此属性。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     用于建立连接的协议。在使用 Flash Media Server 时，此属性是相关的。可能值如下：
     <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"rtmp"</codeph>：实时消息传递协议 (RTMP)</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"rtmpe"</codeph>：加密的 RTMP</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"rtmpt"</codeph>：HTTP 隧道 RTMP</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"rtmpte"</codeph>：HTTP 隧道加密的 RTMP</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"rtmps"</codeph>：基于 HTTPS 的 RTMP</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">"rtmfp"</codeph>：实时媒体流协议 (RTMFP)</li></ul>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:proxyType:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">proxyType</apiName><shortdesc class="- topic/shortdesc ">
     确定到 Flash Media Server 的初始连接尝试失败后应使用的后备方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     确定到 Flash Media Server 的初始连接尝试失败后应使用的后备方法。在调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph> 方法之前设置 <codeph class="+ topic/ph pr-d/codeph ">proxyType</codeph> 属性。
     
     <p class="- topic/p ">可接受值为<codeph class="+ topic/ph pr-d/codeph ">“none”</codeph>、<codeph class="+ topic/ph pr-d/codeph ">“HTTP”</codeph>、<codeph class="+ topic/ph pr-d/codeph ">“CONNECT”</codeph>和<codeph class="+ topic/ph pr-d/codeph ">“best”</codeph>。默认值是<codeph class="+ topic/ph pr-d/codeph ">“none”</codeph>。</p>
     
     <p class="- topic/p ">要使用本机 SSL，请将此属性设置为<codeph class="+ topic/ph pr-d/codeph ">“best”</codeph>。如果播放器无法直接连接到服务器（通过默认端口 443 或您指定的其他端口）并且代理服务器可用，则播放器尝试使用 CONNECT 方法。如果尝试失败，播放器通过 HTTPS 用隧道播放。
     </p>
     
     <p class="- topic/p ">如果将此属性设置为<codeph class="+ topic/ph pr-d/codeph ">“HTTP”</codeph>并且直接连接失败，则会使用 HTTP 隧道。如果将此属性设为<codeph class="+ topic/ph pr-d/codeph ">“CONNECT”</codeph>并且直接连接失败，则将使用隧道的 <codeph class="+ topic/ph pr-d/codeph ">CONNECT</codeph> 方法。如果后者也失败，连接不会使用备用的 HTTP 隧道方法。</p>
     
     <p class="- topic/p ">仅当使用 RTMP、RTMPS 或 RTMPT 时，此属性才可用。<codeph class="+ topic/ph pr-d/codeph ">CONNECT</codeph> 方法仅适用于通过代理服务器连接到网络上的用户。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:unconnectedPeerStreams:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">unconnectedPeerStreams</apiName><shortdesc class="- topic/shortdesc ">
     
     一个对象，其中包含与发布方 NetStream 对象不相关的所有同级订户 NetStream 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Array</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     
     一个对象，其中包含与发布方 NetStream 对象不相关的所有同级订户 NetStream 对象。与发行方的 NetStream 对象关联的订户的 NetStream 对象位于 <codeph class="+ topic/ph pr-d/codeph ">NetStream.peerStreams</codeph> 数组中。
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.net.xml#NetStream/peerStreams" class="- topic/link "><linktext class="- topic/linktext ">NetStream.peerStreams</linktext></link></related-links></apiValue><apiValue id="flash.net:NetConnection:uri:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">uri</apiName><shortdesc class="- topic/shortdesc ">
     传递给 NetConnection.connect() 方法的 URI。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/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 class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     传递给 NetConnection.connect() 方法的 URI。如果尚未调用 <codeph class="+ topic/ph pr-d/codeph ">NetConnection.connect()</codeph> 或者未传递任何 URI，则此属性为 <codeph class="+ topic/ph pr-d/codeph ">undefined</codeph>。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.net:NetConnection:usingTLS:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d)                              (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">usingTLS</apiName><shortdesc class="- topic/shortdesc ">
     表示是否已使用本机传输层安全 (TLS) 而不是 HTTPS 建立了一个安全连接。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="read" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">已尝试在未连接 NetConnection 实例时访问此属性。
     
     </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示是否已使用本机传输层安全 (TLS) 而不是 HTTPS 建立了一个安全连接。此属性仅在连接了 NetConnection 对象时有效。
     
     </apiDesc></apiValueDetail></apiValue></apiClassifier></apiPackage>