<?xml version="1.0" encoding="UTF-8"?>
<apiPackage xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" id="flash.media" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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.media</apiName><apiDetail class="- topic/body reference/refbody apiRef/apiDetail "/><apiClassifier languages="" id="flash.media:ID3Info" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">ID3Info</apiName><shortdesc class="- topic/shortdesc ">
	 ID3Info 类包含反映 ID3 元数据的属性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" 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 "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><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 ">
	 ID3Info 类包含反映 ID3 元数据的属性。可以通过访问 Sound 类的 <codeph class="+ topic/ph pr-d/codeph ">id3</codeph> 属性来获取 MP3 文件的其他元数据；例如，<codeph class="+ topic/ph pr-d/codeph ">mySound.id3.TIME</codeph>。有关详细信息，请在 <xref href="http://www.id3.org" class="- topic/xref ">http://www.id3.org</xref> 上参阅 <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> 条目和 ID3 标签定义。
	 </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound/id3" class="- topic/link "><linktext class="- topic/linktext ">Sound.id3</linktext></link></related-links><apiValue id="flash.media:ID3Info:album" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">album</apiName><shortdesc class="- topic/shortdesc ">
		 专辑的名称；对应于 ID3 2.0 标签 TALB。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" 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 ">
		 专辑的名称；对应于 ID3 2.0 标签 TALB。
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:artist" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">artist</apiName><shortdesc class="- topic/shortdesc ">
		 歌手的姓名；对应于 ID3 2.0 标签 TPE1。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" 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 ">
		 歌手的姓名；对应于 ID3 2.0 标签 TPE1。
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:comment" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">comment</apiName><shortdesc class="- topic/shortdesc ">
		 录制的相关注解；对应于 ID3 2.0 标签 COMM。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" 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 ">
		 录制的相关注解；对应于 ID3 2.0 标签 COMM。
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:genre" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">genre</apiName><shortdesc class="- topic/shortdesc ">
		 歌曲的流派；对应于 ID3 2.0 标签 TCON。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" 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 ">
		 歌曲的流派；对应于 ID3 2.0 标签 TCON。
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:songName" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">songName</apiName><shortdesc class="- topic/shortdesc ">
		 歌曲的名称；对应于 ID3 2.0 标签 TIT2。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" 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 ">
		 歌曲的名称；对应于 ID3 2.0 标签 TIT2。
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:track" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">track</apiName><shortdesc class="- topic/shortdesc ">
		 曲目编号；对应于 ID3 2.0 标签 TRCK。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" 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 ">
		 曲目编号；对应于 ID3 2.0 标签 TRCK。
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:year" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">year</apiName><shortdesc class="- topic/shortdesc ">
		 录制的年份；对应于 ID3 2.0 标签 TYER。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" 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 ">
		 录制的年份；对应于 ID3 2.0 标签 TYER。
		 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:MediaType" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">MediaType</apiName><shortdesc class="- topic/shortdesc ">
 MediaType 类枚举可以由摄像头返回的媒体的常规类型。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">
 MediaType 类枚举可以由摄像头返回的媒体的常规类型。
 
 <p class="- topic/p ">使用在此类中定义的常量作为 CameraUI 类的 <codeph class="+ topic/ph pr-d/codeph ">launch()</codeph> 方法的输入。MediaType 值也用于 MediaPromise 类的 <codeph class="+ topic/ph pr-d/codeph ">mediaType</codeph> 属性。</p>
 
 </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#CameraUI/launch()" class="- topic/link "><linktext class="- topic/linktext ">CameraUI.launch()</linktext></link><link href="" invalidHref="flash.media.MediaPromise.mediaType.xml" class="- topic/link "><linktext class="- topic/linktext ">MediaPromise.mediaType</linktext></link></related-links><apiValue id="flash.media:MediaType:IMAGE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">IMAGE</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.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 "><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 ">image</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.media:MediaType:VIDEO" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">VIDEO</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.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 "><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 ">video</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><apiOperation id="globalOperation:flash.media:scanHardware" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">scanHardware</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="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 "/><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><apiClassifier languages="" id="flash.media:Camera" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">Camera</apiName><shortdesc class="- topic/shortdesc ">
 使用 Camera 类从客户端系统的摄像头捕获视频。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Camera, 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 "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 使用 Camera 类从客户端系统的摄像头捕获视频。使用 Video 类可在本地监视视频。使用 NetConnection 和 NetStream 类可将视频传输到 Flash Media Server。Flash Media Server 可以将视频流发送到其他服务器，并向运行 Flash Player 的其他客户端广播此视频流。
 
 <p class="- topic/p ">Camera 实例以横向长宽比捕获视频。在可以更改屏幕方向的设备（例如移动电话）上，与摄像头关联的 Video 对象仅以横向长宽比显示垂直视频。因此，移动应用程序在显示视频时应使用横向并且不应自动旋转。</p>
 
 <p class="- topic/p ">从 AIR 2.6 开始，在具有自动聚焦摄像头的移动设备上自动启动自动聚焦。如果摄像头不支持持续自动聚焦，许多移动设备摄像头都不支持，则当 Camera 对象附加到视频流且只要调用 <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> 方法时，摄像头就会聚焦。 在台式机上，自动对焦行为取决于摄像头驱动程序和设置。</p>
 
 <p class="- topic/p ">在 Android 和 iOS 上的 AIR 应用程序中，当 AIR 应用程序（前台应用程序）不活动时，摄像头不捕获视频。此外，当应用程序处于后台时，会丢失流连接。在 iOS 上，当应用程序使用 GPU 呈现模式时，无法显示摄像头视频。摄像头视频仍然可以流向服务器。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">移动浏览器支持：</b>移动浏览器不支持此类。</p>
 
 <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>桌面操作系统支持此功能，但所有移动设备均不支持此功能。用于电视的 AIR 设备不支持此功能。有关在多个配置文件之间支持 API 的详细信息，请参阅 <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">AIR 配置文件支持</xref>。</p>
 
 <p class="- topic/p ">您可以使用 <codeph class="+ topic/ph pr-d/codeph ">Camera.isSupported</codeph> 属性在运行时测试是否受支持。请注意，对于用于电视的 AIR 设备，<codeph class="+ topic/ph pr-d/codeph ">Camera.isSupported</codeph> 为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，但是 <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> 始终返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
 
 <p class="- topic/p ">
 有关捕获音频的信息，请参阅 Microphone 类。
 </p>
 
 <p class="- topic/p ">
 <b class="+ topic/ph hi-d/b ">重要说明：</b>Flash Player 将显示“隐私”对话框，用户可从中选择是允许还是拒绝访问摄像头。确保应用程序窗口大小至少为 215 x 138 个像素；这是显示该对话框所需的最小大小。
 </p>
 
 <p class="- topic/p ">要创建或引用 Camera 对象，请使用 <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> 方法。</p>
 
 </apiDesc><example conref="examples\CameraExample.as" class="- topic/example "> 以下示例显示了在确认安全警告之后来自摄像头的图像。舞台被设置为无法进行缩放，并与播放器窗口左上角对齐。<codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件在会话开始和结束（如果有）时被调度，并由 <codeph class="+ topic/ph pr-d/codeph ">activityHandler()</codeph> 方法捕获，该方法会输出有关这一事件的信息。
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>必须将摄像头与计算机连接，此示例才能正常运行。</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.*;
    import flash.media.Camera;
    import flash.media.Video;

    public class CameraExample extends Sprite {
        private var video:Video;
        
        public function CameraExample() {
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;
            
            var camera:Camera = Camera.getCamera();
            
            if (camera != null) {
                camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
                video = new Video(camera.width * 2, camera.height * 2);
                video.attachCamera(camera);
                addChild(video);
            } else {
                trace("You need a camera.");
            }
        }
        
        private function activityHandler(event:ActivityEvent):void {
            trace("activityHandler: " + event);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone</linktext></link><link href="http://coenraets.org/blog/2010/07/video-chat-for-android-in-30-lines-of-code/" class="- topic/link "><linktext class="- topic/linktext ">Cristophe Coenraets：用 30 行代码实现 Android 的视频聊天</linktext></link><link href="http://www.riagora.com/2010/07/android-air-and-the-camera/" class="- topic/link "><linktext class="- topic/linktext ">Michael Chaize：Android、AIR 和摄像头</linktext></link></related-links><adobeApiEvent id="flash.media:Camera_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 ">
 在摄像头报告其状态时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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.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 ">
 在摄像头报告其状态时调度。在访问摄像头之前，Flash Player 将显示一个“隐私”对话框，用户可以在该对话框中允许或拒绝对其摄像头的访问。若 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">"Camera.Muted"</codeph>，则表示用户已拒绝 SWF 文件访问其摄像头。如果 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性的值为“<codeph class="+ topic/ph pr-d/codeph ">Camera.Unmuted</codeph>”，则表示用户允许 SWF 文件访问其摄像头。  
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/getCamera()" class="- topic/link "><linktext class="- topic/linktext ">Camera.getCamera()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.media:Camera_flash.events.ActivityEvent.ACTIVITY_activity" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">activity</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><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.ActivityEvent.ACTIVITY</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ActivityEvent</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 ">Camera.setMotionLevel()</codeph> 以指定触发 <codeph class="+ topic/ph pr-d/codeph ">activating</codeph> 值为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 的 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件所需的运动量，或者指定在没有活动的情况下经过多长时间才会触发 <codeph class="+ topic/ph pr-d/codeph ">activating</codeph> 值为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph> 的 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件。
 
 
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.media:Camera:getCamera" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">getCamera</apiName><shortdesc class="- topic/shortdesc ">
	 返回对用于捕获视频的 Camera 对象的引用。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Camera, video, constructor, Camera.getCamera, getCamera
	 </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 "/><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 ">name</codeph> 参数，则此方法返回对默认摄像头的引用；或者，如果默认摄像头正由另一个应用程序使用，则此方法返回对第一个可用摄像头的引用。（如果安装了多个摄像头，则用户可以在 Flash Player 的“摄像头设置”面板中指定默认的摄像头。）如果没有可用摄像头或没有安装摄像头，则该方法返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。 
 	  
 	 </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:Camera</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><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 ">names</codeph> 属性返回的数组确定。对于大多数应用程序，可省略此参数来获取默认摄像头。要为此参数指定值，请使用 Camera.names 数组内从零开始的索引位置的字符串表示形式。例如，要在数组中指定第三个摄像头，请使用 <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera("2")</codeph>。 
 	 
 	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 返回对用于捕获视频的 Camera 对象的引用。要开始捕获视频，必须将 Camera 对象附加到 Video 对象（请参阅 <codeph class="+ topic/ph pr-d/codeph ">Video.attachCamera() </codeph>）。要将视频传输到 Flash Media Server，请调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachCamera()</codeph> 以将 Camera 对象附加到 NetStream 对象。
	 
	 <p class="- topic/p ">对 <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> 方法的多次调用会引用相同的摄像头驱动程序。因此，如果代码包含诸如 <codeph class="+ topic/ph pr-d/codeph ">firstCam:Camera = getCamera()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">secondCam:Camera = getCamera()</codeph> 之类的代码，则 <codeph class="+ topic/ph pr-d/codeph ">firstCam</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">secondCam</codeph> 会引用同一个摄像头，该摄像头为用户的默认摄像头。</p>
	 
	 <p class="- topic/p ">在同时具有前面摄像头和后面摄像头的 iOS 设备上，您在同一时刻只能从一个摄像头捕获视频。在 Android 设备上，您只能访问后面摄像头。</p>
	 
	 <p class="- topic/p ">通常不应为 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 参数传递值，而只是使用 <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> 来返回对默认摄像头的引用。通过“摄像头设置面板”（此章节的稍后部分将进行讨论），用户可以指定要使用的默认摄像头。 </p>
	 
  	 <p class="- topic/p ">您不能使用 ActionScript 来设置用户用于访问摄像头的 Allow 或 Deny 权限设置，但可以显示“Adobe Flash Player 设置”摄像头设置对话框，用户可以在其中设置摄像头权限。当使用 <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> 方法的 SWF 文件尝试将 <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> 方法返回的摄像头附加到 Video 或 NetStream 对象时，Flash Player 将显示一个对话框，用户可从中选择是允许还是拒绝访问摄像头。（确保应用程序窗口大小至少为 215 x 138 个像素；这是 Flash Player 显示该对话框所需的最小大小。）当用户对摄像头设置对话框做出响应时，Flash Player 将在表示用户响应的 <codeph class="+ topic/ph pr-d/codeph ">status</codeph> 事件中返回信息对象：<codeph class="+ topic/ph pr-d/codeph ">Camera.muted</codeph> 表示用户拒绝访问摄像头；<codeph class="+ topic/ph pr-d/codeph ">Camera.Unmuted</codeph> 表示用户允许访问摄像头。要在不处理 <codeph class="+ topic/ph pr-d/codeph ">status</codeph> 事件的情况下确定用户是拒绝还是允许访问摄像头，请使用 <codeph class="+ topic/ph pr-d/codeph ">muted</codeph> 属性。</p>
  	 
 	 <p class="- topic/p ">在 Flash Player 中，用户可以为特定域指定永久隐私设置，方法是在播放 SWF 文件时右键单击（Windows 和 Linux 系统）或按住 Control 并单击 (Macintosh)，选择“设置”，打开“隐私”对话框，然后选择“记住”。如果用户选择“记住”，Flash Player 将不再询问用户是允许还是拒绝此域的 SWF 文件访问摄像头。</p>
  	 
  	 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>如果用户已通过选择“Flash Player 设置”对话框中的“记住”来拒绝访问摄像头，则 <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> 方法将不会调用该对话框来允许或拒绝对摄像头的访问。在这种情况下，您可以通过使用 <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings(SecurityPanel.PRIVACY)</codeph> 为用户显示“Flash Player 隐私”面板，提示用户更改 Allow 或 Deny 设置。</p>
 	 
 	 <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> 返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则表明摄像头正由另一个应用程序使用，或者系统上没有安装摄像头。要确定是否安装了任何摄像头，请使用 <codeph class="+ topic/ph pr-d/codeph ">names.length</codeph> 属性。要显示 Flash Player 的“摄像头设置”面板（让用户选择将由 <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> 引用的摄像头），请使用 <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings(SecurityPanel.CAMERA)</codeph>。 </p>
 	 
	 <p class="- topic/p ">扫描硬件以找到摄像头需要花一些时间。当运行时找到至少一个摄像头后，在播放器实例的生存期内将不再扫描硬件。但是，如果运行时没有找到任何摄像头，则每次调用 <codeph class="+ topic/ph pr-d/codeph ">getCamera</codeph> 时它都将进行扫描。这对虽然有摄像头但摄像头被禁用的情况非常适用；如果 SWF 文件提供了调用 <codeph class="+ topic/ph pr-d/codeph ">getCamera</codeph> 的“重试”按钮，则用户不必重新启动 SWF 文件，Flash Player 就可以找到摄像头。</p>
 	 
	 </apiDesc><example conref="examples\Camera_getCameraExample.as" class="- topic/example "> 在下面的示例中，在用户允许访问摄像头后，使用连接的摄像头捕获视频图像。还会显示有关视频流的信息，如当前每秒帧数。
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> 方法将返回对 camera 对象的引用，如果没有可用的摄像头或未安装摄像头，则返回 null。if 语句检查是否找到摄像头，以及用户是否允许访问该摄像头。如果用户拒绝访问，则 <codeph class="+ topic/ph pr-d/codeph ">muted</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。</p> 
 
 <p class="- topic/p ">通常，在调用 <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> 方法时，将出现一个对话框，提示用户允许或拒绝 Flash Player 访问该摄像头。但是，如果用户拒绝访问并选择了<codeph class="+ topic/ph pr-d/codeph ">“记住”</codeph>选项，则不会出现该对话框并且不会显示任何信息。为确保向用户提供允许访问摄像头的选项，<codeph class="+ topic/ph pr-d/codeph ">myTextField</codeph> 文本字段将指示用户单击该文本字段以调用“Flash Player 设置”对话框。</p>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> 方法调用 <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings()</codeph> 方法，后者会显示“设置”对话框的<codeph class="+ topic/ph pr-d/codeph ">“隐私”</codeph>面板。如果用户允许访问，则调度 <codeph class="+ topic/ph pr-d/codeph ">StatusEvent.STATUS</codeph> 事件，并将该事件的 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性值设置为 <codeph class="+ topic/ph pr-d/codeph ">Camera.Unmuted</codeph>。（摄像头对象的 <codeph class="+ topic/ph pr-d/codeph ">mute</codeph> 属性值也设置为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。）</p>
 
 <p class="- topic/p ">如果用户允许访问，则为侦听用户设置状态更改而添加的 <codeph class="+ topic/ph pr-d/codeph ">statusHandler()</codeph> 方法将调用 <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> 方法。<codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> 方法使用捕获的流的宽度和高度实例化视频对象。要显示摄像头捕获的视频，请将对视频流的引用附加到该视频对象，并将该视频对象添加到显示列表中。</p>
 
 <p class="- topic/p ">还将启动一个 Timer 对象。每秒都会调度 Timer 对象的 timer 事件并调用 <codeph class="+ topic/ph pr-d/codeph ">timerHandler()</codeph> 方法。将显示 <codeph class="+ topic/ph pr-d/codeph ">timerHandler()</codeph> 方法并更新 Camera 对象的许多属性。 </p> 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>对于本示例，唯一发生更改的属性是 <codeph class="+ topic/ph pr-d/codeph ">currentFPS</codeph> 属性。</p>    
    
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.media.Camera;
    import flash.media.Video;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import flash.events.StatusEvent;
    import flash.events.MouseEvent;
    import flash.system.SecurityPanel;
    import flash.system.Security;

    public class Camera_getCameraExample extends Sprite {
        private var myTextField:TextField;
        private var cam:Camera;
        private var t:Timer = new Timer(1000);
        
        public function Camera_getCameraExample() {
            myTextField = new TextField();
            myTextField.x = 10;
            myTextField.y = 10;
            myTextField.background = true;
            myTextField.selectable = false;
            myTextField.autoSize = TextFieldAutoSize.LEFT;    
        
            if (Camera.isSupported)
            {
                cam = Camera.getCamera();
                
                 if (!cam) {
                    myTextField.text = "No camera is installed.";
                    
                } else if (cam.muted) {
                    myTextField.text = "To enable the use of the camera,\n"
                                     + "please click on this text field.\n" 
                                     + "When the Flash Player Settings dialog appears,\n"
                                     + "make sure to select the Allow radio button\n" 
                                     + "to grant access to your camera.";
    
                    myTextField.addEventListener(MouseEvent.CLICK, clickHandler);
    
                }else {
                    myTextField.text = "Connecting";
                    connectCamera(); 
                }
       
                addChild(myTextField);
    
                t.addEventListener(TimerEvent.TIMER, timerHandler);
            }else {
                myTextField.text = "The Camera class is not supported on this device.";
            }
        }

        private function clickHandler(e:MouseEvent):void {
            Security.showSettings(SecurityPanel.PRIVACY);

            cam.addEventListener(StatusEvent.STATUS, statusHandler);

            myTextField.removeEventListener(MouseEvent.CLICK, clickHandler);
        }

        private function statusHandler(event:StatusEvent):void {

            if (event.code == "Camera.Unmuted") {
                connectCamera(); 
                cam.removeEventListener(StatusEvent.STATUS, statusHandler);
            }
        }

        private function connectCamera():void {
                var vid:Video = new Video(cam.width, cam.height);
                vid.x = 10;
                vid.y = 10;
                vid.attachCamera(cam);
                addChild(vid);    

                t.start();
        }

        private function timerHandler(event:TimerEvent):void {
            myTextField.y = cam.height + 20;
            myTextField.text = "";
            myTextField.appendText("bandwidth: " + cam.bandwidth + "\n");
            myTextField.appendText("currentFPS: " + Math.round(cam.currentFPS) + "\n");
            myTextField.appendText("fps: " + cam.fps + "\n");
            myTextField.appendText("keyFrameInterval: " + cam.keyFrameInterval + "\n");
        }
    }
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/index" class="- topic/link "><linktext class="- topic/linktext ">index</linktext></link><link href="flash.media.xml#Camera/muted" class="- topic/link "><linktext class="- topic/linktext ">muted</linktext></link><link href="flash.media.xml#Camera/names" class="- topic/link "><linktext class="- topic/linktext ">names</linktext></link><link href="flash.media.xml#Camera/setMode()" class="- topic/link "><linktext class="- topic/linktext ">setMode()</linktext></link><link href="flash.media.xml#Camera/event:status" class="- topic/link "><linktext class="- topic/linktext ">status</linktext></link><link href="flash.media.xml#Video/attachCamera()" class="- topic/link "><linktext class="- topic/linktext ">Video.attachCamera()</linktext></link></related-links><adobeApiEvent id="flash.media:Camera:getCamera_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 ">在摄像头报告其状态时调度。在访问摄像头之前，Flash Player 将显示一个“隐私”对话框，用户可以在该对话框中允许或拒绝对其摄像头的访问。若 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">"Camera.muted"</codeph>，则表示用户拒绝 SWF 文件访问他的摄像头。如果 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性的值为“<codeph class="+ topic/ph pr-d/codeph ">Camera.Unmuted</codeph>”，则表示用户允许 SWF 文件访问其摄像头。
 	 </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在摄像头报告其状态时调度。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.media:Camera:setKeyFrameInterval" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">setKeyFrameInterval</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 ">keyFrameInterval</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个值，用于指定将哪些视频帧（作为关键帧）进行完整传输而不由视频压缩算法进行插补处理。值 1 表示每一帧都是关键帧，值 3 表示每隔两个帧后的那一帧为关键帧，依此类推。可接受值为 1 至 48。
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定进行完整传输而不由视频压缩算法进行插值处理的视频帧（称为<i class="+ topic/ph hi-d/i ">关键帧</i>）。此方法仅在使用 Flash Media Server 传输视频时适用。
	 
	 <p class="- topic/p ">Flash 视频压缩算法通过只传输自视频的上一帧以来的更改内容来压缩视频；这些部分被视为插补帧。可以根据前一帧的内容插补视频帧。但是，关键帧是完整的视频帧；它并不是根据前面的帧插补的。</p> 
	 
	 <p class="- topic/p ">要确定如何设置 <codeph class="+ topic/ph pr-d/codeph ">keyFrameInterval</codeph> 参数的值，请考虑带宽使用率和视频播放辅助功能。例如，为 <codeph class="+ topic/ph pr-d/codeph ">keyFrameInterval</codeph> 指定较高的值（以较低的频率发送关键帧）可降低带宽使用率。但是，这可能会增加在视频某一特定点上定位播放头所需的时间量；可能需要插补更多以前的视频帧才能继续播放视频。</p> 
	 
	 <p class="- topic/p ">反之，为 <codeph class="+ topic/ph pr-d/codeph ">keyFrameInterval</codeph> 指定较低的值（以较高的频率发送关键帧）会提高带宽使用率（因为会更频繁地传输所有的视频帧），但可能会减少在已录制视频内搜索特定视频帧所需的时间量。</p>
	 
	 </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/keyFrameInterval" class="- topic/link "><linktext class="- topic/linktext ">keyFrameInterval</linktext></link></related-links></apiOperation><apiOperation id="flash.media:Camera:setLoopback" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">setLoopback</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 ">compress</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>) 还是使用未压缩的流 (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>)。
	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定在本地查看摄像头时是否使用压缩视频流。此方法仅在使用 Flash Media Server 传输视频时适用；如果将 <codeph class="+ topic/ph pr-d/codeph ">compress</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则可以更精确地看到在用户实时查看视频时向用户呈现视频的方式。
	 
	 <p class="- topic/p ">虽然压缩流在用于测试（如预览视频品质设置）时很有用，但对它进行处理要花很大的代价，因为对本地视图并不只是进行压缩处理；就像通过实时连接进行传输那样，需要对视频进行压缩和编辑以进行传输，然后要对其进行解压缩处理以供本地查看。</p>
	 
	 <p class="- topic/p ">要在 <codeph class="+ topic/ph pr-d/codeph ">compress</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 的情况下设置使用的压缩量，请使用 <codeph class="+ topic/ph pr-d/codeph ">Camera.setQuality()</codeph>。</p>
	 
	 </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/setQuality()" class="- topic/link "><linktext class="- topic/linktext ">setQuality()</linktext></link></related-links></apiOperation><apiOperation id="flash.media:Camera:setMode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">setMode</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 ">Camera, video, Camera.setMode, setMode
	 </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 ">width</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">请求的捕获宽度，以像素为单位。默认值为 160。	 
	 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">height</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">请求的捕获高度，以像素为单位。默认值为 120。	 
	 </apiDesc></apiParam><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 ">摄像头捕获数据应使用的请求速率，以每秒帧数为单位。默认值为 15。	 
	 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">favorArea</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">true</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定在摄像头不具有满足指定要求的本机模式的情况下是否控制宽度、高度和帧速率。默认值为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，这意味着支持保持捕获大小；使用此参数选择与 <codeph class="+ topic/ph pr-d/codeph ">width</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">height</codeph> 值最匹配的模式，即使这样做会由于降低帧速率而对性能造成不利影响。要最大限度地提高帧速率，而不考虑摄像头的高度和宽度，请将 <codeph class="+ topic/ph pr-d/codeph ">false</codeph> 传递给 <codeph class="+ topic/ph pr-d/codeph ">favorArea</codeph> 参数。
	 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 将摄像头的捕获模式设置为最符合指定要求的本机模式。如果摄像头没有与您传递的所有参数相匹配的本机模式，Flash Player 将选择与所请求的模式最接近的合成捕获模式。此操作可能涉及裁切图像和删除帧。 
	 
	 <p class="- topic/p ">默认情况下，Flash Player 根据需要删除一些帧以保持图像大小。要将删除的帧数降至最低（即使这意味着减小图像大小），请为 <codeph class="+ topic/ph pr-d/codeph ">favorArea</codeph> 参数传递 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。</p>
	 
	 <p class="- topic/p ">在选择本机模式时，Flash Player 将设法尽量保持所请求的高宽比。例如，如果发出 <codeph class="+ topic/ph pr-d/codeph ">myCam.setMode(400, 400, 30)</codeph> 命令，并且摄像头上可用的最大宽度和高度值分别为 320 和 288，则 Flash Player 将宽度和高度都设置为 288；通过将这些属性设置为相同的值，Flash Player 可以保持所请求的 1:1 高宽比。</p>
	 
	 <p class="- topic/p ">要确定在 Flash Player 选择与所请求的值最匹配的模式后分配给这些属性的值，请使用 <codeph class="+ topic/ph pr-d/codeph ">width</codeph>、<codeph class="+ topic/ph pr-d/codeph ">height</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">fps</codeph> 属性。</p>
	 
	 <p class="- topic/p ">
	 如果使用 Flash Media Server，您也可以捕获单个帧或创建延时拍摄。有关详细信息，请参阅 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachCamera()</codeph>。
	 </p>
	 
	 </apiDesc><example conref="examples\Camera_setModeExample.as" class="- topic/example "> 在下面的示例中，当用户单击舞台时，将调整视频大小并将每秒帧数捕获率设置为新值。  
 
 <p class="- topic/p ">舞台的设置使其不会缩放。<codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> 方法将返回对 camera 对象的引用，如果没有可用的摄像头或未安装摄像头，则返回 null。如果存在摄像头，则调用 <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> 方法。<codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> 方法实例化一个视频对象。要显示摄像头捕获的视频，请将对视频流的引用附加到该视频对象，并将该视频对象添加到显示列表中。还为 <codeph class="+ topic/ph pr-d/codeph ">MouseEvent.CLICK</codeph> 事件设置了一个事件侦听器。当用户单击舞台之后，将调用 <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> 方法。该方法检查捕获视频的宽度并设置摄像头捕获模式的宽度、高度和每秒帧数请求速率。为了使这些设置生效，必须删除并重新创建该视频对象。还必须将该视频的宽度和高度设置为 camera 对象的宽度和高度。</p>      
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.media.Camera;
    import flash.media.Video;
    import flash.events.MouseEvent;
    import flash.display.StageScaleMode;

    public class Camera_setModeExample extends Sprite {
        private var cam:Camera;
        private var vid:Video;

        public function Camera_setModeExample() {
            stage.scaleMode = StageScaleMode.NO_SCALE;

            cam = Camera.getCamera();
            
            if (!cam) {
                trace("No camera is installed.");
            }else {
                connectCamera();
            }
        }

        private function connectCamera():void {
            vid = new Video();
            vid.width = cam.width;
            vid.height = cam.height; 
            vid.attachCamera(cam);
            addChild(vid);    

            stage.addEventListener(MouseEvent.CLICK, clickHandler);
        }
    
        private function clickHandler(e:MouseEvent):void {

            switch (cam.width) {
                case 160:
                cam.setMode(320, 240, 10); 
                break;
                case 320:
                cam.setMode(640, 480, 5); 
                break;
                default:
                cam.setMode(160, 120, 15); 
                break;
            } 

            removeChild(vid);           
            connectCamera();
        }
    }
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/fps" class="- topic/link "><linktext class="- topic/linktext ">fps</linktext></link><link href="flash.media.xml#Camera/height" class="- topic/link "><linktext class="- topic/linktext ">height</linktext></link><link href="flash.media.xml#Camera/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.net.xml#NetStream/attachCamera()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.attachCamera()</linktext></link></related-links></apiOperation><apiOperation id="flash.media:Camera:setMotionLevel" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">setMotionLevel</apiName><shortdesc class="- topic/shortdesc ">
	 指定调度 activity 事件所需的运动量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Camera, video, Camera.setMotionLevel, setMotionLevel
	 </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 ">motionLevel</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 ">activity</codeph> 事件所需的运动量。可接受值的范围为 0 到 100。默认值为 50。
	 
	 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">timeout</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">2000</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定在没有活动的情况下经过多长时间（以毫秒为单位）后，Flash Player 才会认为活动已停止并调度 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件。默认值为 2000 毫秒（2 秒）。
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定调度 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件所需的运动量。可以选择设置在没有活动的情况下经过多长时间（以毫秒为单位）后，Flash Player 才会认为动作已停止并调度该事件。 
	 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>不管 <codeph class="+ topic/ph pr-d/codeph ">motionLevel</codeph> 参数值是什么，都可以显示视频。此参数只确定在何时以及哪些情况下调度事件，并不确定实际上是在捕获视频还是显示视频。</p>
	 <p class="- topic/p ">
	 要完全阻止摄像头检测动作，请将值 100 传递到 <codeph class="+ topic/ph pr-d/codeph ">motionLevel</codeph> 参数；从不调度 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件。（您可能只将此值用于测试目的 -- 例如，暂时禁用在调度事件时通常会触发的任何处理函数。）
	 </p>
	 <p class="- topic/p ">
	 要确定摄像头当前检测到的运动量，请使用 <codeph class="+ topic/ph pr-d/codeph ">activityLevel</codeph> 属性。运动敏感度值直接对应于活动值。完全不运动对应于活动值 0。持续运动对应于活动值 100。您不移动时，活动值小于运动敏感度值；当您移动时，活动值通常会超过运动敏感度值。
	 </p>
	 <p class="- topic/p ">
	 此方法和 <codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> 方法在目的上类似；这两种方法都用于指定应该在何时调度 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件。不过，这两种方法在对发布流的影响上具有显著的差异：
	 </p>
	 
	 <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> 设计用于优化带宽。在认为音频流被静音时，不发送任何音频数据。而改为发送一条表示静音已启动的消息。 </li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">Camera.setMotionLevel()</codeph> 设计用于检测运动，并且不影响带宽用量。即使视频流未检测到运动，仍将发送视频。</li></ul>
	   
	 
	 
	 </apiDesc><example conref="examples\Camera_setMotionLevelExample.as" class="- topic/example "> 在下面的示例中，将用户的摄像头用作监视器或监视摄像头。摄像头检测运动，文本字段显示活动级别。（可以扩展此示例，以使其发出警报声音或将通过 Web 服务向其他应用程序发送消息。）
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> 方法将返回对 camera 对象的引用，如果没有可用的摄像头或未安装摄像头，则返回 null。if 语句检查摄像头是否可用，并在摄像头可用时调用 <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> 方法。<codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> 方法使用捕获的流的宽度和高度实例化视频对象。要显示摄像头捕获的视频，请将对视频流的引用附加到该视频对象，并将该视频对象添加到显示列表中。（通常，在调用 <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> 方法时，将出现一个对话框，提示用户允许或拒绝 Flash Player 访问该摄像头。但是，如果用户拒绝访问并选择了<codeph class="+ topic/ph pr-d/codeph ">“记住”</codeph>选项，则不会出现该对话框并且不会显示任何信息。要确保用户可以使用允许访问摄像头的选项，请使用 <codeph class="+ topic/ph pr-d/codeph ">system.Security.showSettings()</codeph> 方法来调用“Flash Player 设置”对话框。）</p>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">setMotionLevel()</codeph> 方法在调用 activity 事件前将最小动作的活动级别（运动量）设置为 5。摄像头停止检测运动时与调用 activity 事件时之间的时间设置为 1 秒（1000 毫秒）。在经过 1 秒没有活动的时间或活动级别达到 5 后，将调度 <codeph class="+ topic/ph pr-d/codeph ">ActivityEvent.ACTIVITY</codeph> 事件并调用 <codeph class="+ topic/ph pr-d/codeph ">activityHandler()</codeph> 方法。如果该事件由活动级别触发，则将 <codeph class="+ topic/ph pr-d/codeph ">activating</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 并且启动 Timer 对象。每秒都会调度 Timer 对象的 timer 事件并调用 <codeph class="+ topic/ph pr-d/codeph ">timerHandler()</codeph> 方法，该方法会显示当前的活动级别。（尽管 5 级或更大的级别会触发计时器，但显示的当前活动级别可能是一个较小的数字。）</p>
  
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.media.Camera;
    import flash.media.Video;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import flash.events.ActivityEvent;

    public class Camera_setMotionLevelExample extends Sprite {
        private var myTextField:TextField;
        private var cam:Camera;
        private var t:Timer = new Timer(1000);

        public function Camera_setMotionLevelExample() {
            myTextField = new TextField();
            myTextField.background = true;
            myTextField.selectable = false;
            myTextField.autoSize = TextFieldAutoSize.LEFT;    
        
            cam = Camera.getCamera();
            
            if (!cam) {
                myTextField.text = "No camera is installed.";

            }else {
                myTextField.text = "Waiting to connect.";
                connectCamera(); 
            }

            addChild(myTextField);

            t.addEventListener(TimerEvent.TIMER, timerHandler);
        }

        private function connectCamera():void {
                var vid:Video = new Video(cam.width, cam.height);
                vid.x = 10;
                vid.y = 10;
                vid.attachCamera(cam);
                addChild(vid);    

                cam.setMotionLevel(5, 1000);
                cam.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
        }

        private function activityHandler(e:ActivityEvent):void {
            if (e.activating == true) {
                t.start();    
            } else {
                myTextField.text = "Everything is quiet.";
                t.stop();
            }    
        }

        private function timerHandler(event:TimerEvent):void {
             myTextField.x = 10;
             myTextField.y = cam.height + 20;
             myTextField.text = "There is some activity. Level: " + cam.activityLevel;
        }
    }
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/motionLevel" class="- topic/link "><linktext class="- topic/linktext ">motionLevel</linktext></link><link href="flash.media.xml#Camera/motionTimeout" class="- topic/link "><linktext class="- topic/linktext ">motionTimeout</linktext></link><link href="flash.media.xml#Microphone/setSilenceLevel()" class="- topic/link "><linktext class="- topic/linktext ">Microphone.setSilenceLevel()</linktext></link></related-links></apiOperation><apiOperation id="flash.media:Camera:setQuality" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">setQuality</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 ">Camera.setQuality, setQuality
	 </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 ">bandwidth</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定当前输出视频输入信号可以使用的最大带宽，以每秒字节数为单位。要指定 Flash Player 视频可以使用所需数量的带宽来保持 <codeph class="+ topic/ph pr-d/codeph ">quality</codeph> 的值，请为 <codeph class="+ topic/ph pr-d/codeph ">bandwidth</codeph> 传递 0。默认值为 16384。	 
	 
	 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">quality</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个整数，指定所需的画面质量级别，该级别由应用于每一视频帧的压缩量确定。可接受的值的范围为 1（最低品质，最大压缩）到 100（最高品质，无压缩）。要指定画面质量可以根据需要进行变化以避免超出带宽，请将 0 传递给 <codeph class="+ topic/ph pr-d/codeph ">quality</codeph>。 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 设置每秒的最大带宽或当前输出视频输入信号所需的画面质量。此方法通常只在使用 Flash Media Server 传输视频时适用。
	 
	 <p class="- topic/p ">使用此方法可以指定输出视频输入信号的哪一方面对于您的应用程序更重要：是带宽使用率还是图片品质。</p>
	 
	 <ul class="- topic/ul "><li class="- topic/li ">要表示带宽使用率更为重要，请将一个值传递给 <codeph class="+ topic/ph pr-d/codeph ">bandwidth</codeph> 并将 0 传递给 <codeph class="+ topic/ph pr-d/codeph ">quality</codeph>。Flash Player 将在指定的带宽内以可能的最高品质传输视频。如有必要，Flash Player 将降低图片品质以避免超出指定的带宽。通常，随着运动的增加，质量将降低。</li><li class="- topic/li ">要表示品质更为重要，请将 0 传递给 <codeph class="+ topic/ph pr-d/codeph ">bandwidth</codeph> 并将一个数值传递给 <codeph class="+ topic/ph pr-d/codeph ">quality</codeph>。Flash Player 使用所需数量的带宽来保持指定的品质。如有必要，Flash Player 将降低帧速率以保持图片品质。通常，随着运动的增加，带宽的使用率也将增加。</li><li class="- topic/li ">要指定带宽和品质同等重要，请为这两个参数都传递数值。Flash Player 将传输达到指定品质并且不超过指定带宽的视频。如有必要，Flash Player 将降低帧速率以保持图片品质，而不会超出指定的带宽。</li></ul>
	 
	 </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/getCamera()" class="- topic/link "><linktext class="- topic/linktext ">getCamera()</linktext></link><link href="flash.media.xml#Camera/quality" class="- topic/link "><linktext class="- topic/linktext ">quality</linktext></link></related-links></apiOperation><apiValue id="flash.media:Camera:activityLevel: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 ">activityLevel</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 ">Camera, video
	 </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 ">
	 摄像头正在检测的运动量。该数值的范围为 0（检测到没有运动）到 100（检测到大运动量）。该属性的值可帮助确定是否需要将设置传递到 <codeph class="+ topic/ph pr-d/codeph ">setMotionLevel()</codeph> 方法。
	 <p class="- topic/p ">如果摄像头可用，但由于未调用 <codeph class="+ topic/ph pr-d/codeph ">Video.attachCamera()</codeph> 方法而尚未被使用，则将此属性设置为 -1。</p>
	 <p class="- topic/p ">如果只对未压缩的本地视频进行流式处理，则只有在为事件处理函数分配函数后才能设置此属性。否则，它为未定义。</p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/motionLevel" class="- topic/link "><linktext class="- topic/linktext ">motionLevel</linktext></link><link href="flash.media.xml#Camera/setMotionLevel()" class="- topic/link "><linktext class="- topic/linktext ">setMotionLevel()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:bandwidth: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 ">bandwidth</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 ">Camera, video, Camera.bandwidth, bandwidth
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 当前输出视频输入信号可以使用的最大带宽，以字节为单位。值为 0 表示输入信号可以使用所需数量的带宽来保持所需的帧品质。
	 <p class="- topic/p ">要设置此属性，请使用 <codeph class="+ topic/ph pr-d/codeph ">setQuality()</codeph> 方法。</p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/setQuality()" class="- topic/link "><linktext class="- topic/linktext ">setQuality()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera: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 "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Camera, video, Camera.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 ">	
	 摄像头捕获数据的速率，以每秒帧数为单位。无法设置此属性；不过，可以使用 <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> 方法来设置相关属性 <codeph class="+ topic/ph pr-d/codeph ">fps</codeph>，该属性指定摄像头捕获数据时希望使用的最大帧速率。 
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/setMode()" class="- topic/link "><linktext class="- topic/linktext ">setMode()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:fps: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 ">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 "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Camera, video, Camera.fps, fps
	 </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 ">
	 摄像头捕获数据的最大速率，以每秒帧数为单位。可能的最大速率取决于摄像头性能；有可能会达不到此帧速率。
	 <ul class="- topic/ul "><li class="- topic/li ">要为该属性设置所需值，请使用 <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> 方法。</li><li class="- topic/li ">要确定摄像头当前捕获数据的速率，请使用 <codeph class="+ topic/ph pr-d/codeph ">currentFPS</codeph> 属性。</li></ul>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/currentFPS" class="- topic/link "><linktext class="- topic/linktext ">currentFPS</linktext></link><link href="flash.media.xml#Camera/setMode()" class="- topic/link "><linktext class="- topic/linktext ">setMode()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:height: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 ">height</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 ">Camera, video, Camera.height, height
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 当前捕获高度，以像素为单位。要设置此属性的值，请使用 <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> 方法。 
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/width" class="- topic/link "><linktext class="- topic/linktext ">width</linktext></link><link href="flash.media.xml#Camera/setMode()" class="- topic/link "><linktext class="- topic/linktext ">setMode()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:index: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 ">index</apiName><shortdesc class="- topic/shortdesc ">
	 从零开始的整数，指定由 names 属性返回的数组中所反映的摄像头的索引。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Camera, video, Camera.index, index
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 从零开始的整数，指定由 <codeph class="+ topic/ph pr-d/codeph ">names</codeph> 属性返回的数组中所反映的摄像头的索引。
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/names" class="- topic/link "><linktext class="- topic/linktext ">names</linktext></link><link href="flash.media.xml#Camera/getCamera()" class="- topic/link "><linktext class="- topic/linktext ">getCamera()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera: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 ">
    如果当前平台支持 Camera 类，则 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 ">
    如果当前平台支持 Camera 类，则 <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.media:Camera:keyFrameInterval: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 ">keyFrameInterval</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="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 ">
	 完整传输而没有使用视频压缩算法进行插值处理的视频帧（称为<i class="+ topic/ph hi-d/i ">关键帧</i>）数。默认值为 15，指每隔 14 个帧后的那一帧为关键帧。值为 1 表示每个帧都是关键帧。允许的值为 1 至 48。
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/setKeyFrameInterval()" class="- topic/link "><linktext class="- topic/linktext ">setKeyFrameInterval()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:loopback: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 ">loopback</apiName><shortdesc class="- topic/shortdesc ">
	 表示在本地查看摄像头所捕获的图像时是进行压缩和解压缩 (true)，就像使用 Flash Media Server 进行实时传输一样，还是不进行压缩 (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 "/></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 ">
	 表示在本地查看摄像头所捕获的图像时是进行压缩和解压缩 (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>)，就像使用 Flash Media Server 进行实时传输一样，还是不进行压缩 (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>)。默认值为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。 
	 
	 <p class="- topic/p ">
	 虽然压缩流在进行测试方面（如预览视频品质设置）非常有用，但会产生大量的处理开销。就像通过实时连接进行传输一样，将对本地查看的内容进行压缩和编辑以进行传输，然后再对其进行解压缩处理以便在本地进行查看。
	 </p>
	 
	 <p class="- topic/p ">要设置此值，请使用 <codeph class="+ topic/ph pr-d/codeph ">Camera.setLoopback()</codeph>。要设置此属性为 True 时使用的压缩量，请使用 <codeph class="+ topic/ph pr-d/codeph ">Camera.setQuality()</codeph>。</p>
	  
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/setLoopback()" class="- topic/link "><linktext class="- topic/linktext ">setLoopback()</linktext></link><link href="flash.media.xml#Camera/setQuality()" class="- topic/link "><linktext class="- topic/linktext ">setQuality()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:motionLevel: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 ">motionLevel</apiName><shortdesc class="- topic/shortdesc ">
	 调用 activity 事件所需的运动量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Camera, video, Camera.motionLevel, motionLevel
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 调用 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件所需的运动量。可接受值的范围为 0 到 100。默认值为 50。
	 <p class="- topic/p ">不论 <codeph class="+ topic/ph pr-d/codeph ">motionLevel</codeph> 属性为何值都能显示视频。有关详细信息，请参阅 <codeph class="+ topic/ph pr-d/codeph "> setMotionLevel()</codeph>。</p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/setMotionLevel()" class="- topic/link "><linktext class="- topic/linktext ">setMotionLevel()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:motionTimeout: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 ">motionTimeout</apiName><shortdesc class="- topic/shortdesc ">
	 摄像头停止检测运动的时间与调用 activity 事件的时间之间相差的毫秒数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Camera, video, Camera.motionTimeout, motionTimeout
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 摄像头停止检测运动的时刻和调用 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件的时刻之间相差的毫秒数。默认值为 2000（2 秒）。 
	 <p class="- topic/p ">要设置此值，请使用 <codeph class="+ topic/ph pr-d/codeph ">setMotionLevel()</codeph>。 </p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/setMotionLevel()" class="- topic/link "><linktext class="- topic/linktext ">setMotionLevel()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:muted: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 ">muted</apiName><shortdesc class="- topic/shortdesc ">
	 布尔值，表示用户在 Flash Player 的“隐私”对话框中是拒绝访问摄像头 (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 "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Camera, video, Camera.muted, muted
	 </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 ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 布尔值，表示用户在 Flash Player 的“隐私”对话框中是拒绝访问摄像头 (<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 ">status</codeph> 事件。
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/getCamera()" class="- topic/link "><linktext class="- topic/linktext ">getCamera()</linktext></link><link href="flash.media.xml#Camera/event:status" class="- topic/link "><linktext class="- topic/linktext ">status</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera: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 "><keyword class="- topic/keyword ">Camera, video, Camera.name, name
	 </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 ">
	 由摄像头硬件返回的当前摄像头的名称。
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/names" class="- topic/link "><linktext class="- topic/linktext ">names</linktext></link><link href="flash.media.xml#Camera/getCamera()" class="- topic/link "><linktext class="- topic/linktext ">getCamera()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:names: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 ">names</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 "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Camera, video, Camera.names, names
	 </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 "/><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 ">Array</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 字符串数组，表示所有可用的摄像头名称，而不显示 Flash Player 的“隐私”对话框。此数组的行为方式与其他任何 ActionScript 数组的行为方式相同，隐式提供每一摄像头从零开始的索引以及系统上摄像头的数目（通过 <codeph class="+ topic/ph pr-d/codeph ">names.length</codeph>）。有关详细信息，请参阅 <codeph class="+ topic/ph pr-d/codeph ">names</codeph> Array 类条目。
	 
	 <p class="- topic/p ">调用 <codeph class="+ topic/ph pr-d/codeph ">names</codeph> 属性要求全面检查硬件。在大多数情况下，您只能使用默认的摄像头。</p>
	 
	 <p class="- topic/p ">在 Android 上，仅支持一个摄像头，即使设备有多个摄像头设备也是如此。摄像头的名称始终是“默认”。</p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/getCamera()" class="- topic/link "><linktext class="- topic/linktext ">getCamera()</linktext></link><link href="flash.media.xml#Camera/index" class="- topic/link "><linktext class="- topic/linktext ">index</linktext></link><link href="flash.media.xml#Camera/name" class="- topic/link "><linktext class="- topic/linktext ">name</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:quality: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 ">quality</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 ">Camera, video, Camera.quality, quality
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 所需的图片品质级别，该级别是由应用于每个视频帧的压缩量决定的。可接受的品质值范围为 1（最低品质，最大压缩）到 100（最高品质，无压缩）。默认值为 0，这意味着画面质量可以根据需要进行变化，以避免超出可用带宽。
	 
	 <p class="- topic/p ">要设置此属性，请使用 <codeph class="+ topic/ph pr-d/codeph ">setQuality()</codeph> 方法。</p>
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/setQuality()" class="- topic/link "><linktext class="- topic/linktext ">setQuality()</linktext></link></related-links></apiValue><apiValue id="flash.media:Camera:width: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 ">width</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 ">Camera, video, Camera.width, width
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 当前捕获宽度，以像素为单位。要为该属性设置所需值，请使用 <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> 方法。
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/setMode()" class="- topic/link "><linktext class="- topic/linktext ">setMode()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:SoundTransform" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">SoundTransform</apiName><shortdesc class="- topic/shortdesc ">
 SoundTransform 类包含音量和平移的属性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><refpath>
  
  </refpath></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 ">
 SoundTransform 类包含音量和平移的属性。 
 
 </apiDesc><example conref="examples\SoundTransformExample.as" class="- topic/example "> 以下示例将加载并播放 MP3 文件。当 MP3 文件播放时，移动鼠标或其他用户输入设备；当您在舞台上方移动用户输入设备时，音量和全景模式将更改。要运行此示例，请将一个名为 MySound.mp3 的文件放在 SWF 文件所在的同一目录中。
<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.*;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.media.SoundTransform;
    import flash.net.URLRequest;
    import flash.utils.Timer;

    public class SoundTransformExample extends Sprite {
        private var url:String = "MySound.mp3";
        private var soundFactory:Sound;
        private var channel:SoundChannel;
        private var positionTimer:Timer;

        public function SoundTransformExample() {
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;

            var request:URLRequest = new URLRequest(url);
            soundFactory = new Sound();
            soundFactory.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            soundFactory.load(request);
            channel = soundFactory.play();
            stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
        }

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

        private function setPan(pan:Number):void {
            trace("setPan: " + pan.toFixed(2));
            var transform:SoundTransform = channel.soundTransform;
            transform.pan = pan;
            channel.soundTransform = transform;
        }

        private function setVolume(volume:Number):void {
            trace("setVolume: " + volume.toFixed(2));
            var transform:SoundTransform = channel.soundTransform;
            transform.volume = volume;
            channel.soundTransform = transform;
        }

        private function mouseMoveHandler(event:MouseEvent):void {
            var halfStage:uint = Math.floor(stage.stageWidth / 2);
            var xPos:uint = event.stageX;
            var yPos:uint = event.stageY;
            var value:Number;
            var pan:Number;

            if (xPos > halfStage) {
                value = xPos / halfStage;
                pan = value - 1;
            } else if (xPos &lt; halfStage) {
                value = (xPos - halfStage) / halfStage;
                pan = value;
            } else {
                pan = 0;
            }

            var volume:Number = 1 - (yPos / stage.stageHeight);

            setVolume(volume);
            setPan(pan);
            
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.display.xml#SimpleButton/soundTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.display.SimpleButton.soundTransform</linktext></link><link href="flash.display.xml#Sprite/soundTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Sprite.soundTransform</linktext></link><link href="flash.media.xml#Microphone/soundTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.soundTransform</linktext></link><link href="flash.media.xml#SoundChannel/soundTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.media.SoundChannel.soundTransform</linktext></link><link href="flash.media.xml#SoundMixer/soundTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.media.SoundMixer.soundTransform</linktext></link><link href="flash.net.xml#NetStream/soundTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.soundTransform</linktext></link></related-links><apiConstructor id="flash.media:SoundTransform:SoundTransform" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">SoundTransform</apiName><shortdesc class="- topic/shortdesc ">
	 创建 SoundTransform 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><refpath>
	 
	 </refpath></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 "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">vol</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">1</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">音量范围从 0（静音）至 1（最大音量）。
	 
	 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">panning</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">声音从左到右的平移，范围从 -1（左侧最大平移）至 1（右侧最大平移）。值 0 表示没有平移（居中）。 
	 
	 
	 </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 创建 SoundTransform 对象。 
	 
	 </apiDesc><example conref="examples\SoundTransform_constructorExample.as" class="- topic/example "> 在下面的示例中，仅从右声道中播放声音，并将音量设置为 50%。
 
 <p class="- topic/p ">在构造函数中，加载了声音并将其分配给一个声道 (<codeph class="+ topic/ph pr-d/codeph ">channel</codeph>)。还会创建一个 SoundTranform 对象 (<codeph class="+ topic/ph pr-d/codeph ">transform</codeph>)。它的第一个参数将音量设置为 50%（范围从 0.0 到 1.0）。它的第二个参数设置平移。在本示例中，将平移设置为 1.0，这表示仅从右扬声器中播放声音。为了使这些设置生效，将 <codeph class="+ topic/ph pr-d/codeph ">transform</codeph> SoundTranform 对象分配给了声道的 <codeph class="+ topic/ph pr-d/codeph ">souundTransform</codeph> 属性。</p> 
<p class="- topic/p "> <b class="+ topic/ph hi-d/b ">注意：</b>仅为本示例编写了有限的错误处理代码。</p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.media.SoundTransform;
    import flash.events.IOErrorEvent;

    public class SoundTransform_constructorExample extends Sprite
    {
        public function SoundTransform_constructorExample() {
            var mySound:Sound = new Sound();
            var url:URLRequest = new URLRequest("mySound.mp3");
            var channel:SoundChannel;
            var transform:SoundTransform = new SoundTransform(0.5, 1.0);

            mySound.load(url);    
            channel = mySound.play();
            channel.soundTransform = transform;

            mySound.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
        }

        private function errorHandler(errorEvent:IOErrorEvent):void {
            trace("The sound could not be loaded: " + errorEvent.text);
        }
    }
}
</codeblock></example></apiConstructorDetail></apiConstructor><apiValue id="flash.media:SoundTransform:leftToLeft: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 ">leftToLeft</apiName><shortdesc class="- topic/shortdesc ">
	 从 0（无）至 1（全部）的值，指定了左输入在左扬声器里播放的量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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="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（无）至 1（全部）的值，指定了左输入在左扬声器里播放的量。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:SoundTransform:leftToRight: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 ">leftToRight</apiName><shortdesc class="- topic/shortdesc ">
	 从 0（无）至 1（全部）的值，指定了左输入在右扬声器里播放的量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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="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（无）至 1（全部）的值，指定了左输入在右扬声器里播放的量。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:SoundTransform:pan: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 ">pan</apiName><shortdesc class="- topic/shortdesc ">
	 声音从左到右的平移，范围从 -1（左侧最大平移）至 1（右侧最大平移）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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="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 ">
	 声音从左到右的平移，范围从 -1（左侧最大平移）至 1（右侧最大平移）。值 0 表示没有平移（在左侧和右侧之间平衡居中）。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:SoundTransform:rightToLeft: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 ">rightToLeft</apiName><shortdesc class="- topic/shortdesc ">
	 从 0（无）至 1（全部）的值，指定了右输入在左扬声器里播放的量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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="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（无）至 1（全部）的值，指定了右输入在左扬声器里播放的量。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:SoundTransform:rightToRight: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 ">rightToRight</apiName><shortdesc class="- topic/shortdesc ">
	 从 0（无）至 1（全部）的值，指定了右输入在右扬声器里播放的量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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="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（无）至 1（全部）的值，指定了右输入在右扬声器里播放的量。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:SoundTransform:volume: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 ">volume</apiName><shortdesc class="- topic/shortdesc ">
	 音量范围从 0（静音）至 1（最大音量）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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="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（静音）至 1（最大音量）。
	 
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:StageVideoAvailability" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">StageVideoAvailability</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.2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="(unsupported)" 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 ">表示舞台视频当前是否可用的枚举。
   	</apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	此类定义表示舞台视频当前是否可用的枚举。
	</apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.events.xml#StageVideoAvailabilityEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.StageVideoAvailabilityEvent</linktext></link></related-links><apiValue id="flash.media:StageVideoAvailability:AVAILABLE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">AVAILABLE</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.2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="(unsupported)" 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 ">available</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 ">舞台视频当前可用。
		 </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 舞台视频当前可用。
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageVideoAvailability:UNAVAILABLE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">UNAVAILABLE</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.2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="(unsupported)" 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 ">unavailable</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 ">舞台视频当前不可用。
		 </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 舞台视频当前不可用。
		 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:StageWebView" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">StageWebView</apiName><shortdesc class="- topic/shortdesc ">
     StageWebView 类在舞台视口中显示 HTML 内容。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     StageWebView 类在舞台视口中显示 HTML 内容。 
     
     <p class="- topic/p ">在不支持 HTMLLoader 类的设备上，StageWebView 类通过一种简单方式来显示 HTML 内容。该类不提供 ActionScript 和 HTML 内容之间的交互，除非通过 StageWebView 类自身的方法和属性。例如，无法在 ActionScript 和 JavaScript 之间传递值或调用函数。</p>
     
     <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>所有桌面操作系统和移动设备均支持此功能，但用于电视的 AIR 设备不支持此功能。您可以使用 <codeph class="+ topic/ph pr-d/codeph ">StageWebView.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 ">在设备上的移动和扩展的移动配置文件中，StageWebView 类使用设备操作系统提供的系统 Web 控件。因此，可用的属性和呈现外观可能因设备而异。在桌面计算机上（在桌面和扩展的桌面配置文件中），StageWebView 类使用内部 AIR WebKit 引擎。可用的功能和呈现外观与 HTMLLoader 类相同（没有由 HTMLLoader 实例提供的 ActionScript 和 JavaScript 之间的紧密集成和脚本桥接）。测试 StageWebView 类的 <codeph class="+ topic/ph pr-d/codeph ">isSupported</codeph> 属性以确定当前设备是否支持该类。</p>
     
     <p class="- topic/p ">StageWebView 类不是显示对象，无法添加到 Flash 显示列表。相反，您应通过使用 <codeph class="+ topic/ph pr-d/codeph ">stage</codeph> 属性将 StageWebView 对象直接附加到舞台来显示该对象。附加到舞台的 StageWebView 实例显示在任何 Flash 显示对象的前面。您使用 <codeph class="+ topic/ph pr-d/codeph ">viewPort</codeph> 属性控制呈现区域的大小和位置。无法控制不同 StageWebView 对象的深度顺序。不建议重叠两个实例。</p>
     
     <p class="- topic/p ">当 StageWebView 对象内的内容处于焦点时，StageWebView 对象首先有机会处理键盘输入。StageWebView 对象所附加到的舞台调度任何未处理的键盘输入。由于 StageWebView 实例不是显示列表的一部分，普通的事件捕获/冒泡循环在此处不适用。</p>
     
     <p class="- topic/p ">在 Android 3.0+ 中，应用程序必须在 AIR 应用程序描述符的 Android manifestAdditions 元素中启用硬件加速，才能显示 StageWebView 对象中的插件内容。</p>
     
     </apiDesc><example conref="examples\StageWebViewExample.1.as" class="- topic/example "> 以下示例设置 StageWebView 对象以填充舞台。该示例使用 <codeph class="+ topic/ph pr-d/codeph ">loadURL()</codeph> 方法加载一个 Web 站点，并使用设备的“后退”和“搜索”软键进行历史记录导航。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package  {
    import flash.display.MovieClip;
    import flash.media.StageWebView;
    import flash.geom.Rectangle;
    import flash.events.KeyboardEvent;
    import flash.ui.Keyboard;
    import flash.desktop.NativeApplication;
                
    public class StageWebViewExample extends MovieClip{

        private var webView:StageWebView = new StageWebView();
                                
        public function StageWebViewExample() 
        {
            webView.stage = this.stage;
            webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight );
            webView.loadURL( "http://www.example.com" );
                                                
            stage.addEventListener( KeyboardEvent.KEY_DOWN, onKey );
        }
                                
        private function onKey( event:KeyboardEvent ):void
        {
            if( event.keyCode == Keyboard.BACK &amp;&amp; webView.isHistoryBackEnabled )
            {
                trace("Back.");
                webView.historyBack();
                event.preventDefault();
            }

            if( event.keyCode == Keyboard.SEARCH &amp;&amp; webView.isHistoryForwardEnabled )
            {
                trace("Forward.");
                webView.historyForward();
            }
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="../../flash/html/HTMLLoader.html" class="- topic/link "><linktext class="- topic/linktext ">HTMLLoader 类</linktext></link><link href="http://www.flashmobileblog.com/2010/06/18/air-on-android-tweetrapp-video-walk-through/" class="- topic/link "><linktext class="- topic/linktext ">Mark Doherty：Android 上的 AIR：TweetrApp</linktext></link><link href="http://www.flashmobileblog.com/2010/07/17/air2-5-stagewebview-demo-oauth-support/" class="- topic/link "><linktext class="- topic/linktext ">Mark Doherty：OAuth 支持</linktext></link><link href="http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ffe.html#WS365a66ad37c9f5102ec8a8ba12f2d91095a-8000" class="- topic/link "><linktext class="- topic/linktext ">在 StageWebView 对象中启用 Flash Player 和其他插件</linktext></link></related-links><adobeApiEvent id="flash.media:StageWebView_flash.events.FocusEvent_focusOut" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">focusOut</apiName><shortdesc class="- topic/shortdesc ">
     当 StageWebView 放弃焦点时进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.FocusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     当 StageWebView 放弃焦点时进行调度。
     
     </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:StageWebView_flash.events.FocusEvent_focusIn" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">focusIn</apiName><shortdesc class="- topic/shortdesc ">
     当此 StageWebView 对象接收焦点时进行调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.FocusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     当此 StageWebView 对象接收焦点时进行调度。
     
     </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:StageWebView_flash.events.ErrorEvent_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 adobeApiEvent/adobeApiEvent "><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="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 "><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ErrorEvent</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.media:StageWebView_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 ">
	 表示 loadString() 或 loadURL() 方法上次请求的加载操作已完成。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.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 "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">表示 loadString() 或 load() 方法上次请求的加载操作已完成。
	 
	 </apiTipText></apiTipTexts></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 表示 <codeph class="+ topic/ph pr-d/codeph ">loadString()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">loadURL()</codeph> 方法上次请求的加载操作已完成。
	 
	 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:StageWebView_flash.events.LocationChangeEvent.LOCATION_CHANGING_locationChanging" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">locationChanging</apiName><shortdesc class="- topic/shortdesc ">
	 表示 StageWebView 对象的 location 属性将更改。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.LocationChangeEvent.LOCATION_CHANGING</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.LocationChangeEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">表示 StageWebView 对象的 location 属性将更改。
	 
     </apiTipText></apiTipTexts></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 表示 StageWebView 对象的 <codeph class="+ topic/ph pr-d/codeph ">location</codeph> 属性将更改。
	 
	 <p class="- topic/p ">仅当通过 StageWebView 对象内部运行的 HTML 内容或代码启动位置更改时（例如用户单击链接时），才调度 locationChanging 事件。默认情况下，新位置在此 StageWebView 对象中显示。您可以调用事件对象的 <codeph class="+ topic/ph pr-d/codeph ">preventDefault()</codeph> 方法取消默认行为。例如，您可以使用 <codeph class="+ topic/ph pr-d/codeph ">flash.net.navigateToURL()</codeph> 函数在基于事件对象的 <codeph class="+ topic/ph pr-d/codeph ">location</codeph> 属性的系统浏览器中打开页面</p>
	 
	 <p class="- topic/p ">当使用下列方法更改位置时，不会调度 locationChanging 事件。</p>
	 <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">historyBack()</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">historyForward()</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">historyGo()</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">loadString()</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">loadURL()</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">reload()</codeph></li></ul>
	 
	 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:StageWebView_flash.events.LocationChangeEvent.LOCATION_CHANGE_locationChange" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">locationChange</apiName><shortdesc class="- topic/shortdesc ">
	 表示更改了 StageWebView 对象的 location 属性。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.LocationChangeEvent.LOCATION_CHANGE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.LocationChangeEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">表示更改了 StageWebView 对象的 location 属性。
 	 
     </apiTipText></apiTipTexts></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 表示更改了 StageWebView 对象的 <codeph class="+ topic/ph pr-d/codeph ">location</codeph> 属性。
	 
	 <p class="- topic/p ">此事件无法取消。</p>
	 
	 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.media:StageWebView:StageWebView" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">StageWebView</apiName><shortdesc class="- topic/shortdesc ">
	     创建一个 StageWebView 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">
	     创建一个 StageWebView 对象。
	     
	     <p class="- topic/p ">在将该对象附加到舞台并设置 <codeph class="+ topic/ph pr-d/codeph ">viewPort</codeph> 之前，该对象不可见。</p>
	     
	     </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.media:StageWebView:assignFocus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">assignFocus</apiName><shortdesc class="- topic/shortdesc ">
	     将焦点赋予此 StageWebView 对象内的内容。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">direction</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">none</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">指定是显示的内容中的第一个还是最后一个可放置焦点的对象应该接收焦点。
	     
	     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	     将焦点赋予此 StageWebView 对象内的内容。
	     
	     <p class="- topic/p ">方向值在 FocusDirection 类中定义并包括：“bottom”、“none”和“top”。</p>
	     
	     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.display.xml#FocusDirection" class="- topic/link "><linktext class="- topic/linktext ">FocusDirection</linktext></link></related-links></apiOperation><apiOperation id="flash.media:StageWebView:dispose" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">dispose</apiName><shortdesc class="- topic/shortdesc ">
	     此 StageWebView 对象的处理。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">
	     此 StageWebView 对象的处理。
	     
	     <p class="- topic/p ">调用 <codeph class="+ topic/ph pr-d/codeph ">dispose()</codeph> 是可选的。如果您不维护对此 StageWebView 实例的引用，它将符合垃圾回收条件。调用 <codeph class="+ topic/ph pr-d/codeph ">dispose()</codeph> 会使垃圾回收更快发生，或者在更方便的时间发生。</p>
	     
	     </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.media:StageWebView:drawViewPortToBitmapData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">drawViewPortToBitmapData</apiName><shortdesc class="- topic/shortdesc ">
		 将 StageWebView 的视口绘制到位图。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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><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 ">bitmap</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.display:BitmapData</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对其绘制 StageWebView 视口的可见部分的 BitmapData 对象。 		  
             </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 将 StageWebView 的视口绘制到位图。
	     	 <p class="- topic/p ">捕获位图并将舞台设置为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，以便在 StageWebView 对象上显示内容。 </p>
		 
		 </apiDesc><example conref="examples\StageWebView.bitmapcapture.as" class="- topic/example "> 下面的示例显示两个标签：google 和 facebook。单击标签可捕获相应的网页，并将其显示为舞台上的快照。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">

package
{
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.Sprite;
    import flash.events.*;
    import flash.geom.Rectangle;
    import flash.media.StageWebView;
    import flash.net.*;
    import flash.text.TextField;
    
    public class stagewebview1 extends Sprite
    {    
        public var webView:StageWebView = new StageWebView();
        public var textGoogle:TextField=new TextField();
        public var textFacebook:TextField=new TextField();
    
        public function stagewebview()
        
        {
            textGoogle.htmlText="&lt;b>Google&lt;/b>";
            textGoogle.x=300;
            textGoogle.y=-80;        
            addChild(textGoogle);
            textFacebook.htmlText="&lt;b>Facebook&lt;/b>";
            textFacebook.x=0;
            textFacebook.y=-80;        
            addChild(textFacebook);
            textGoogle.addEventListener(MouseEvent.CLICK,goGoogle);
            textFacebook.addEventListener(MouseEvent.CLICK,goFaceBook);
            webView.stage = this.stage;
            webView.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);

        }    
    
        public function goGoogle(e:Event):void
        
        {
            webView.loadURL("http://www.google.com");
            webView.stage = null;
            webView.addEventListener(Event.COMPLETE,handleLoad);
        }
    
        public function goFaceBook(e:Event):void
        {
            webView.loadURL("http://www.facebook.com");
            webView.stage = null;
            webView.addEventListener(Event.COMPLETE,handleLoad);
        }
    
        public function handleLoad(e:Event):void
        {
            var bitmapData:BitmapData = new BitmapData(webView.viewPort.width, webView.viewPort.height);
            webView.drawViewPortToBitmapData(bitmapData);
            var webViewBitmap:Bitmap=new Bitmap(bitmapData);
            addChild(webViewBitmap);
        }
    }
}
</codeblock></example></apiOperationDetail></apiOperation><apiOperation id="flash.media:StageWebView:historyBack" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">historyBack</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.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 "/><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.media:StageWebView:historyForward" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">historyForward</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.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 "/><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.media:StageWebView:loadString" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">loadString</apiName><shortdesc class="- topic/shortdesc ">
	     加载并显示指定的 HTML 字符串。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">text</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要显示的 HTML 或 XHTML 内容的字符串。
	     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">mimeType</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">text/html</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">内容的 MIME 类型，“文本/html”或“应用程序/xhtml+xml”。
	     
	     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	     加载并显示指定的 HTML 字符串。
	     
	     <p class="- topic/p ">当使用 <codeph class="+ topic/ph pr-d/codeph ">loadString()</codeph> 方法时，<codeph class="+ topic/ph pr-d/codeph ">location</codeph> 将报告为“about:blank”。在 HTML 字符串内的 URL 中只能使用标准 URI 方案。不允许使用 AIR URI 方案“app:”和“app-storage:”。</p>
	     
	     <p class="- topic/p ">HTML 内容无法加载本地资源，例如图像文件。不允许使用 XMLHttpRequests。</p>
	     
	     <p class="- topic/p ">仅支持“文本/html”和“应用程序/xhtml+xml”MIME 类型。</p>
	     
	     </apiDesc><example conref="examples\StageWebView.loadString.1.as" class="- topic/example "> 以下示例设置 StageWebView 对象以填充舞台。该示例使用 <codeph class="+ topic/ph pr-d/codeph ">loadString()</codeph> 方法加载 HTML 页。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">

var webView:StageWebView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight );

var htmlString:String = "&lt;!DOCTYPE HTML>" +
                        "&lt;html>" +
                            "&lt;body>" +
                                "&lt;h1>Example&lt;/h1>" +
                                "&lt;p>King Phillip cut open five green snakes.&lt;/p>" +
                            "&lt;/body>" +
                        "&lt;/html>";

webView.loadString( htmlString, "text/html" );
</codeblock></example></apiOperationDetail></apiOperation><apiOperation id="flash.media:StageWebView:loadURL" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">loadURL</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="AIR" version="2.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 "/><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 ">url</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	     在指定的 URL 加载页面。
	     
	     <p class="- topic/p ">URL 可以使用下列 URI 方案：http:、https:、file:、data: 和 JavaScript:。使用 file: 方案加载的内容可以加载其他本地资源。</p>
	     
	     </apiDesc><example conref="examples\StageWebView.loadURL.1.as" class="- topic/example "> 以下示例设置 StageWebView 对象以填充舞台。该示例使用 <codeph class="+ topic/ph pr-d/codeph ">loadURL()</codeph> 方法加载一个网站。 
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在 Android 上，必须在 AIR 应用程序描述符中指定 INTERNET 权限才能加载远程 URL。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">

var webView:StageWebView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight );

webView.loadURL( "http://www.example.com" );
                                                
</codeblock></example></apiOperationDetail></apiOperation><apiOperation id="flash.media:StageWebView:reload" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">reload</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.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 "/><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.media:StageWebView: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 apiOperation/apiOperation "><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="AIR" version="2.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 "/><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><apiValue id="flash.media:StageWebView:isHistoryBackEnabled: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 ">isHistoryBackEnabled</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.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 ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	     报告在浏览历史记录中是否有上一个页面。
	     
	     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageWebView:isHistoryForwardEnabled: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 ">isHistoryForwardEnabled</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.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 ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	     报告在浏览历史记录中是否有下一个页面。
	     
	     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageWebView: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 ">
	     报告当前设备是否支持 StageWebView 类。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">
	     报告当前设备是否支持 StageWebView 类。
	     
	     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageWebView:location: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 ">location</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="AIR" version="2.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 ">
	     当前位置的 URL。
	     
	     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageWebView:stage: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 ">stage</apiName><shortdesc class="- topic/shortdesc ">
	     显示此 StageWebView 对象的舞台。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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.display:Stage</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	     显示此 StageWebView 对象的舞台。
	     
	     <p class="- topic/p ">将 <codeph class="+ topic/ph pr-d/codeph ">stage</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 将隐藏此 StageWebView 对象。</p>
	     
	     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageWebView:title: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 ">title</apiName><shortdesc class="- topic/shortdesc ">
	     HTML 标题值。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">
	     HTML 标题值。
	     
	     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageWebView:viewPort: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 ">viewPort</apiName><shortdesc class="- topic/shortdesc ">
	     舞台上显示 StageWebView 对象的区域。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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.geom:Rectangle</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 ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	     舞台上显示 StageWebView 对象的区域。
	     
	     </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:VideoStatus" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">VideoStatus</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.2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="(unsupported)" 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 ">描述视频解码的可能级别的枚举。
	</apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	此类定义描述视频解码的可能级别的枚举。
	</apiDesc></apiClassifierDetail><apiValue id="flash.media:VideoStatus:ACCELERATED" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">ACCELERATED</apiName><shortdesc class="- topic/shortdesc ">
		 表示硬件加速 (GPU) 视频解码。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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.2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="(unsupported)" 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 ">accelerated</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 ">表示硬件加速 (GPU) 视频解码。
		 </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 表示硬件加速 (GPU) 视频解码。
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:VideoStatus:SOFTWARE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">SOFTWARE</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.2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="(unsupported)" 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 ">software</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 ">表示软件视频解码。
		 </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 表示软件视频解码。
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:VideoStatus:UNAVAILABLE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">UNAVAILABLE</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.2" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="(unsupported)" 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 ">unavailable</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 ">不支持视频。
		 </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 不支持视频解码。
		 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:MediaPromise" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">MediaPromise</apiName><shortdesc class="- topic/shortdesc ">
	 MediaPromise 类表示承诺提供媒体对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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.desktop:IFilePromise</apiBaseInterface><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 MediaPromise 类表示承诺提供媒体对象。 
	 
	 <p class="- topic/p ">MediaEvent 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性是 MediaPromise 实例。您可以使用 MediaPromise 方法访问承诺的媒体对象。支持的媒体格式包括静态图像和视频。</p>
	 
	 <p class="- topic/p ">您无法创建 MediaPromise 对象。调用 <codeph class="+ topic/ph pr-d/codeph ">new MediaPromise()</codeph> 会生成运行时错误。</p>
	 
	 </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.events.xml#MediaEvent" class="- topic/link "><linktext class="- topic/linktext ">MediaEvent</linktext></link><link href="flash.desktop.xml#IFilePromise" class="- topic/link "><linktext class="- topic/linktext ">IFilePromise</linktext></link><link href="flash.display.xml#Loader/loadFilePromise()" class="- topic/link "><linktext class="- topic/linktext ">Loader.LoadFilePromise()</linktext></link><link href="flash.utils.xml#IDataInput" class="- topic/link "><linktext class="- topic/linktext ">IDataInput</linktext></link><link href="flash.media.xml#CameraRoll/browseForImage()" class="- topic/link "><linktext class="- topic/linktext ">CameraRoll.browseForImage()</linktext></link><link href="flash.media.xml#CameraUI" class="- topic/link "><linktext class="- topic/linktext ">CameraUI</linktext></link></related-links><adobeApiEvent id="flash.media:MediaPromise_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 ">
 	 读取所有数据后，MediaPromise 对象调度一个 complete 事件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.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 ">
 	 读取所有数据后，MediaPromise 对象调度一个 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件。该事件表示在基础流中不再有更多可用数据。
	 
	 <p class="- topic/p ">同步数据源不调度 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件。</p>
	 
 	 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:MediaPromise_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 ">
 	 当数据变为可用时，MediaPromise 对象调度 progress 事件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.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 ">
 	 当数据变为可用时，MediaPromise 对象调度 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 事件。
 	 
 	 <p class="- topic/p ">所有 progress 事件（最后一个除外）的 <codeph class="+ topic/ph pr-d/codeph ">bytesTotal</codeph> 属性的值都为 0。如果所有数据立即可用，可能不调度 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 事件。同步数据源不调度 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 事件。</p>
	 
 	 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:MediaPromise_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 ">
 	如果读取基础数据流时遇到错误，MediaPromise 对象会调度 ioError 事件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 	如果读取基础数据流时遇到错误，MediaPromise 对象会调度 <codeph class="+ topic/ph pr-d/codeph ">ioError</codeph> 事件。调度此事件后，不再有可读取的数据。
	
 	</apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:MediaPromise_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 ">
 	当基础数据流关闭后，MediaPromise 对象调度 close 事件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.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 ">
 	当基础数据流关闭后，MediaPromise 对象调度 <codeph class="+ topic/ph pr-d/codeph ">close</codeph> 事件。
	
 	</apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.media:MediaPromise: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.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 "/><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.media:MediaPromise: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 apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">open</apiName><shortdesc class="- topic/shortdesc ">
		 打开基础数据源并返回允许您读取它的 IDataInput 实例。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><returns>the underlying data source.
		 
		 </returns></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 "><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.utils:IDataInput</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 打开基础数据源并返回允许您读取它的 IDataInput 实例。
		 
		 <p class="- topic/p ">如果基础数据源是异步的，则 MediaPromise 对象调度 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件以表示数据是否可读取。如果数据源是同步的，则所有数据立即可用，不调度这些事件。</p>
		 
		 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>您可以使用 Loader 类的 <codeph class="+ topic/ph pr-d/codeph ">loadFilePromise()</codeph> 方法加载 MediaPromise 对象，而不是手动读取数据。</p>
		 
		 </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.display.xml#Loader/loadFilePromise()" class="- topic/link "><linktext class="- topic/linktext ">Loader.loadFilePromise()</linktext></link></related-links></apiOperation><apiOperation id="flash.media:MediaPromise:reportError" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">reportError</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.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 "/><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 ">e</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.events:ErrorEvent</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要调度的 error 事件。
		 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
		 由运行时用来报告错误。
		 
		 <p class="- topic/p ">应用程序代码不应该调用此方法。</p>
		 
		 </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.media:MediaPromise:file: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 ">file</apiName><shortdesc class="- topic/shortdesc ">
		 表示媒体对象（如果存在）的 File 实例。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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.filesystem:File</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 表示媒体对象（如果存在）的 File 实例。
		 
		 <p class="- topic/p ">如果基础数据源是基于文件的并且该文件可由应用程序访问，则此属性引用 File 对象。否则，属性为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
		 
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:MediaPromise:isAsync: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 ">isAsync</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.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 ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 报告基础数据源是异步的还是同步的。
		 
		 <p class="- topic/p "/>
		 
		 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:MediaPromise:mediaType: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 ">mediaType</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.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 ">
		 媒体的常规类型，图像或视频。
		 
		 <p class="- topic/p ">MediaType 类中的常量定义此属性可能的值：</p>
		 <ul class="- topic/ul "><li class="- topic/li ">MediaType.IMAGE</li><li class="- topic/li ">MediaType.VIDEO</li></ul>
		 
		 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#MediaType" class="- topic/link "><linktext class="- topic/linktext ">MediaType</linktext></link></related-links></apiValue><apiValue id="flash.media:MediaPromise:relativePath: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 ">relativePath</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.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 ">
		 媒体对象（如果存在）的文件名。
		 
		 <p class="- topic/p ">如果基础数据源是基于文件的并且该文件可由应用程序访问，则文件名是可用的。否则，属性为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
		
		</apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:SoundLoaderContext" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">SoundLoaderContext</apiName><shortdesc class="- topic/shortdesc ">
 SoundLoaderContext 类为加载声音的 文件提供安全检查。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">
 SoundLoaderContext 类为加载声音的 文件提供安全检查。SoundLoaderContext 对象以参数的形式传递到构造函数和 Sound 类的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法。
 
 <p class="- topic/p ">在使用此类时，请考虑以下安全模型： </p>
 
 <ul class="- topic/ul "><li class="- topic/li ">如果执行调用的 文件在网络沙箱中，并且要加载的声音文件是本地文件，则不允许加载和播放声音。</li><li class="- topic/li ">默认情况下，若执行调用的 是本地的，并且试图加载和播放远程声音，则不允许加载和播放声音。用户必须授予明确许可以允许该操作。</li><li class="- topic/li ">某些处理声音的操作受到限制。除非您实现一个 URL 策略文件，否则位于其他域中的文件无法访问已加载声音中的数据。受此限制约束的、与声音相关的 API 为 <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> 属性以及 <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.computeSpectrum()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">SoundMixer.bufferTime</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">SoundTransform()</codeph> 方法。</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></apiClassifierDetail><apiConstructor id="flash.media:SoundLoaderContext:SoundLoaderContext" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">SoundLoaderContext</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><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 ">bufferTime</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">1000</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 ">checkPolicyFile</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 ">指定在加载对象时是否应检查 URL 策略文件是否存在，如果是，则为 (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>)。
     
     </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建新的声音加载器上下文对象。  
     
     </apiDesc><example conref="examples\SoundLoaderContextExample.as" class="- topic/example "> 在下面的示例中，将要加载的声音的缓冲时间设置为 3 秒。
 
 <p class="- topic/p ">可以使用 SoundLoaderContext 对象的第一个参数 (<codeph class="+ topic/ph pr-d/codeph ">context</codeph>) 将默认缓冲时间值从 1 秒增加到 3 秒。（该值以毫秒为单位。）如果将 SoundLoaderContext 对象的第二个参数设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，Flash Player 将在加载对象后检查跨域策略文件。这里将其设置为默认值 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>，所以将不会检查策略文件。声音对象的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法将使用 context 设置，以确保在开始传输声音流之前，花 3 秒钟的时间将流声音预加载到缓冲区中。<codeph class="+ topic/ph pr-d/codeph ">URLRequest</codeph> 对象确定文件（来自 Adobe 的播客）的位置。如果在加载声音文件的过程中发生 <codeph class="+ topic/ph pr-d/codeph ">IOErrorEvent.IO_ERROR</codeph> 错误，则会调用 <codeph class="+ topic/ph pr-d/codeph ">errorHandler()</codeph> 方法。</p> 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import flash.media.Sound;
    import flash.media.SoundLoaderContext;
    import flash.events.IOErrorEvent;
    
    public class SoundLoaderContextExample extends Sprite {

        public function SoundLoaderContextExample() {
            var snd:Sound = new Sound();
            var req:URLRequest = new URLRequest("http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3");
            var context:SoundLoaderContext = new SoundLoaderContext(3000, false);

            snd.load(req, context);
            snd.play();      
 
            snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
        }

        private function errorHandler(errorEvent:IOErrorEvent):void {
            trace("The sound could not be loaded: " + errorEvent.text);
        }

    }
}
</codeblock></example></apiConstructorDetail></apiConstructor><apiValue id="flash.media:SoundLoaderContext:bufferTime" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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></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 ">1000</apiData><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 ">SoundMixer.bufferTime</codeph> 属性来覆盖 <codeph class="+ topic/ph pr-d/codeph ">SoundLoaderContext.bufferTime</codeph> 的值。<ph class="- topic/ph "><codeph class="+ topic/ph pr-d/codeph ">SoundMixer.bufferTime</codeph> 属性影响 SWF 文件中嵌入声音流的缓冲时间，该属性与动态创建的 Sound 对象（即在 ActionScript 中创建的 Sound 对象）无关。</ph></p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:SoundLoaderContext:checkPolicyFile" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">
     指定应用程序是否应在开始加载声音之前尝试从所加载声音的服务器下载 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>: please review at same time: checkPolicyFile property in LoaderContext, NetStream
     </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 "/><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定应用程序是否应在开始加载声音之前尝试从所加载声音的服务器下载 URL 策略文件。此属性应用于使用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 方法从执行调用的文件自己的域外加载的声音。
     
     
     
     <p class="- topic/p ">如果从执行调用的文件自己的域外加载声音，并且执行调用的文件中的代码需要对声音数据进行低级访问，请将此属性设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。对声音数据进行低级访问的示例包括引用 <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> 属性以获取 ID3Info 对象，或调用 <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.computeSpectrum()</codeph> 方法以便从加载的声音中获取声音样本。如果在加载时没有将 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 的情况下尝试访问声音数据，则可能会出现 SecurityError 异常，因为尚未下载所需的策略文件。</p>
     
     <p class="- topic/p ">如果不需要对正在加载的声音数据进行低级访问，请避免将 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>。检查策略文件会占用网络带宽并且可能会延迟下载的开始时间，因此只应在必要时才执行此操作。</p>
     
     <p class="- topic/p ">如果在将 <codeph class="+ topic/ph pr-d/codeph ">SoundLoaderContext.checkPolicyFile</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 的情况下调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph>，则 Flash Player 或 AIR 必须在开始下载指定的声音之前成功下载相关的 URL 策略文件，或确定不存在这样的策略文件。<ph class="- topic/ph ">Flash Player 或 </ph>AIR 将按此顺序执行下列操作，以验证策略文件是否存在：</p>
     
     <ul class="- topic/ul "><li class="- topic/li ">Flash Player 或 AIR 考虑已经下载的策略文件。</li><li class="- topic/li ">Flash Player 或 AIR 尝试下载在 <codeph class="+ topic/ph pr-d/codeph ">Security.loadPolicyFile()</codeph> 调用中指定的任何未处理的策略文件。</li><li class="- topic/li ">Flash Player 或 AIR 尝试从与声音的 URL 相对应的默认位置（与 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.url</codeph> 所在的同一服务器上的 <codeph class="+ topic/ph pr-d/codeph ">/crossdomain.xml</codeph>）下载策略文件。（声音的 URL 在传递给 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 或 Sound() 构造函数的 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性中指定。）</li></ul>
     
     <p class="- topic/p ">无论哪种情况，Flash Player 或 AIR 都要求声音服务器上存在一个正确的策略文件，该文件可以提供对 <codeph class="+ topic/ph pr-d/codeph ">URLRequest.url</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>，则 Flash Player 或 AIR 会等到策略文件验证完成后再加载声音。应该等到从 Sound 对象调度了 <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 ">Sound.id3</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.computeSpectrum()</codeph>。
     </p>
     
     <p class="- topic/p ">如果将 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，但未找到适当的策略文件，则将直到执行需要策略文件的操作时才会收到错误，然后，Flash Player 或 AIR 会引发 <codeph class="+ topic/ph pr-d/codeph ">SecurityError</codeph> 异常。收到 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件后，通过在 <codeph class="+ topic/ph pr-d/codeph ">try</codeph> 块内获取 <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> 的值，并查看是否会引发 <codeph class="+ topic/ph pr-d/codeph ">SecurityError</codeph>，您可以测试是否已找到相关策略文件。</p>
     
     
     <p class="- topic/p ">如果正在从使用服务器端 HTTP 重定向的 URL 中下载声音，请谨慎使用 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph>。Flash Player 或 AIR 尝试检索与传递到 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 的 URLRequest 对象的 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性相对应的策略文件。如果最终声音文件由于 HTTP 重定向而来自不同的 URL，那么，最初下载的策略文件可能不适用于声音的最终 URL，此 URL 与安全决策相关。</p>
     
     <p class="- topic/p ">如果发生此情况，这里有一个可能的解决方案。收到 <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件后，可以检查包含声音的最终 URL 的 <codeph class="+ topic/ph pr-d/codeph ">Sound.url</codeph> 属性值。然后用根据声音的最终 URL 计算的策略文件 URL 调用 <codeph class="+ topic/ph pr-d/codeph ">Security.loadPolicyFile()</codeph> 方法。最后，轮询 <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> 的值，直到没有引发异常为止。</p>
     
     <p class="- topic/p ">这一点不适用于 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></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound/load()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Sound.load()</linktext></link><link href="flash.media.xml#Sound/id3" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Sound.id3</linktext></link><link href="flash.media.xml#SoundMixer/computeSpectrum()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.SoundMixer.computeSpectrum()</linktext></link><link href="flash.media.xml#Sound/url" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Sound.url</linktext></link><link href="flash.system.xml#Security/loadPolicyFile()" class="- topic/link "><linktext class="- topic/linktext ">flash.system.Security.loadPolicyFile()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:SoundChannel" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">SoundChannel</apiName><shortdesc class="- topic/shortdesc ">
 SoundChannel 类控制应用程序中的声音。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><refpath>
  
  </refpath></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 ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 SoundChannel 类控制应用程序中的声音。每个声音均分配给一个声道，而且应用程序可以具有混合在一起的多个声道。SoundChannel 类包含 <codeph class="+ topic/ph pr-d/codeph ">stop()</codeph> 方法、用于监控声道幅度（音量）的属性以及用于对声道指定 SoundTransform 对象的属性。
 
 </apiDesc><example conref="examples\SoundChannelExample.as" class="- topic/example "> 以下示例加载一个 MP3 文件，进行播放，并显示在加载和播放该 MP3 文件时所发生的声音事件的相关信息。Timer 对象每 50 毫秒提供一次有关播放头位置的更新信息。要运行此示例，请将一个名为 MySound.mp3 的文件放在 SWF 文件所在的同一目录中。

<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.net.URLRequest;
    import flash.utils.Timer;

    public class SoundChannelExample extends Sprite {
        private var url:String = "MySound.mp3";
        private var soundFactory:Sound;
        private var channel:SoundChannel;
        private var positionTimer:Timer;

        public function SoundChannelExample() {
            var request:URLRequest = new URLRequest(url);
            soundFactory = new Sound();
            soundFactory.addEventListener(Event.COMPLETE, completeHandler);
            soundFactory.addEventListener(Event.ID3, id3Handler);
            soundFactory.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            soundFactory.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            soundFactory.load(request);

            channel = soundFactory.play();
            channel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);

            positionTimer = new Timer(50);
            positionTimer.addEventListener(TimerEvent.TIMER, positionTimerHandler);
            positionTimer.start();
        }
        

        private function positionTimerHandler(event:TimerEvent):void {
            trace("positionTimerHandler: " + channel.position.toFixed(2));
        }

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

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

        private function ioErrorHandler(event:Event):void {
            trace("ioErrorHandler: " + event);
            positionTimer.stop();       
        }

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

        private function soundCompleteHandler(event:Event):void {
            trace("soundCompleteHandler: " + event);
            positionTimer.stop();
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound" class="- topic/link "><linktext class="- topic/linktext ">Sound</linktext></link><link href="flash.media.xml#SoundTransform" class="- topic/link "><linktext class="- topic/linktext ">SoundTransform</linktext></link></related-links><adobeApiEvent id="flash.media:SoundChannel_flash.events.Event.SOUND_COMPLETE_soundComplete" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">soundComplete</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.SOUND_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><example conref="examples\SoundChannel_event_soundCompleteExample.as" class="- topic/example "> 在以下示例中，用户从播放列表中选择歌曲，然后选择“播放”以按所选顺序播放歌曲。
 
 <p class="- topic/p ">在构造函数中，定义了一个用于保存歌曲列表的文本字段和一个用于选择播放的行。（通常，使用按钮来表示歌曲列表的播放和列表框。）定义了一个文本格式对象，以便在选择歌曲行后将其格式更改为斜体。当用户选择文本字段时，将调用 <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> 方法。</p> 
 
<p class="- topic/p ">在 <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> 方法中，文本字段对象的 <codeph class="+ topic/ph pr-d/codeph ">getLineIndexAtPoint()</codeph> 方法返回用户选择的行的索引。通过使用行索引，<codeph class="+ topic/ph pr-d/codeph ">getLineText()</codeph> 方法可获取文本的内容。if 语句检查用户是否已选择播放歌曲或将歌曲添加到播放列表中。如果用户选择了播放并已选择了歌曲，则会删除鼠标单击的事件侦听器，然后调用 <codeph class="+ topic/ph pr-d/codeph ">playNext()</codeph> 方法以开始播放歌曲。如果用户已选择歌曲名称，则会将该行的内容添加到 <codeph class="+ topic/ph pr-d/codeph ">songList</codeph> 数组中，并将行的格式设置为斜体。</p>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">playNext()</codeph> 方法循环访问数组列表以加载并播放每首歌曲。还会将歌曲分配给声道。添加了一个声道事件侦听器，以便在播放完歌曲时做出响应，然后调度 <codeph class="+ topic/ph pr-d/codeph ">Event.SOUND_COMPLETE</codeph> 事件。<codeph class="+ topic/ph pr-d/codeph ">soundCompleteHandler()</codeph> 方法随后调用 <codeph class="+ topic/ph pr-d/codeph ">playNext()</codeph> 方法以播放下一首歌曲。此过程继续进行，直至播放完数组中列出的所有歌曲。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.events.MouseEvent;
    import flash.text.TextFormat;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.events.IOErrorEvent;

    public class SoundChannel_event_soundCompleteExample extends Sprite {
        private var channel:SoundChannel = new SoundChannel();
        private var songList:Array = new Array();
        private var listTextField:TextField = new TextField();
        private var songFormat:TextFormat = new TextFormat();
        private var arrayIndex:int = 0;
        private var songSelected:Boolean = false;
        
        public function SoundChannel_event_soundCompleteExample() {
            
            listTextField.autoSize = TextFieldAutoSize.LEFT;
            listTextField.border = true
            listTextField.background = true;
            listTextField.text = "Song1.mp3\n" + "Song2.mp3\n" 
                                + "Song3.mp3\n" + "Song4.mp3\n" + "PLAY";
        
            songFormat.italic = true;
 
            listTextField.addEventListener(MouseEvent.CLICK, clickHandler);
                        
            addChild(listTextField);
        }
        
        private function clickHandler(e:MouseEvent):void {
            var index:int = listTextField.getLineIndexAtPoint(e.localX, e.localY);
            var line:String = listTextField.getLineText(index);
            var firstIndex:uint = listTextField.getLineOffset(index);
            var playLine:uint = listTextField.numLines - 1;

                if((index == playLine) &amp;&amp; (songSelected == true)) {
                    listTextField.removeEventListener(MouseEvent.CLICK, clickHandler);
                    playNext();       

                } else if (index != playLine) {
                     songList.push(line.substr(0, (line.length - 1)));
                     listTextField.setTextFormat(songFormat, firstIndex, 
                                (firstIndex + listTextField.getLineLength(index)));     
                    songSelected = true;
                 }
        }

        private function playNext():void {
 
             if(arrayIndex &lt; songList.length) {
                var snd:Sound = new Sound();
                snd.load(new URLRequest(songList[arrayIndex]));
                channel = snd.play();
                
                channel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
                arrayIndex++;
 
            } else {
                songSelected = false;
                    
                while(arrayIndex > 0) {
                    songList.pop();
                    arrayIndex--;
                }
            }
        }    

        private function soundCompleteHandler(e:Event):void {
            playNext();
        }

        private function errorHandler(errorEvent:IOErrorEvent):void {
            trace(errorEvent.text);
        }
    }
}
</codeblock></example></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.media:SoundChannel: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 apiOperation/apiOperation "><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="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 "><refpath>
	 
	 </refpath></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><example conref="examples\SoundChannel_stopExample.as" class="- topic/example "> 在以下示例中，用户可暂停并重放声音文件。
 
 <p class="- topic/p ">在构造函数中，加载了该声音文件。（本示例假定该文件位于与 SWF 文件相同的目录中。）将一个文本字段用作按钮，供用户播放或暂停声音时使用。当用户选择 <codeph class="+ topic/ph pr-d/codeph ">button</codeph> 文本字段时，将调用 <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> 方法。</p>
 
 <p class="- topic/p ">在 <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> 方法中，当用户第一次选择文本字段时，会将声音设置为播放并将声音分配给声道。接下来，当此用户选择暂停文本字段时，声音将停止播放。声道的 <codeph class="+ topic/ph pr-d/codeph ">position</codeph> 属性记录声音停止时的位置。此属性用于在用户选择该文本字段以重新开始播放后从该位置开始恢复播放声音。每次调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.play()</codeph> 方法时，将创建一个新的 SoundChannel 对象并将其分配给 <codeph class="+ topic/ph pr-d/codeph ">channel</codeph> 变量。要使用声道的 <codeph class="+ topic/ph pr-d/codeph ">stop()</codeph> 方法暂停声音，必须将 Sound 对象分配给 SoundChannel 对象。</p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">

package {
    import flash.display.Sprite;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.text.TextField;
    import flash.events.MouseEvent;
    import flash.text.TextFieldAutoSize;
            
    public class SoundChannel_stopExample extends Sprite {
        private var snd:Sound = new Sound();
        private var channel:SoundChannel = new SoundChannel();
        private var button:TextField = new TextField();

        public function SoundChannel_stopExample() {
            var req:URLRequest = new URLRequest("MySound.mp3");
            snd.load(req);
            
            button.x = 10;
            button.y = 10;
            button.text = "PLAY";
            button.border = true;
            button.background = true;
            button.selectable = false;
            button.autoSize = TextFieldAutoSize.CENTER;

            button.addEventListener(MouseEvent.CLICK, clickHandler);

            this.addChild(button);
        }

        private function clickHandler(e:MouseEvent):void {
            var pausePosition:int = channel.position;

            if(button.text == "PLAY") {
                channel = snd.play(pausePosition);
                button.text = "PAUSE";
            } 
            else {
                channel.stop();
                button.text = "PLAY";
            }
        }
    }
}
</codeblock></example></apiOperationDetail></apiOperation><apiValue id="flash.media:SoundChannel:leftPeak: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 ">leftPeak</apiName><shortdesc class="- topic/shortdesc "> 
	 左声道的当前幅度（音量），范围从 0（静音）至 1（最大幅度）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
	 左声道的当前幅度（音量），范围从 0（静音）至 1（最大幅度）。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:SoundChannel:position: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 ">position</apiName><shortdesc class="- topic/shortdesc ">
	 当播放声音时，position 属性表示声音文件中当前播放的位置（以毫秒为单位）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 当播放声音时，<codeph class="+ topic/ph pr-d/codeph ">position</codeph> 属性表示声音文件中当前播放的位置（以毫秒为单位）。当停止或暂停播放声音时，<codeph class="+ topic/ph pr-d/codeph ">position</codeph> 属性表示声音文件中上次播放的位置。
	 
	 <p class="- topic/p ">一种常见使用情形是，在停止播放声音时保存 <codeph class="+ topic/ph pr-d/codeph ">position</codeph> 属性的值。以后，您可以从保存的位置重新开始以恢复播放声音。
	 </p>
	 
	 <p class="- topic/p ">如果循环播放声音，则在每次循环开始时，将 <codeph class="+ topic/ph pr-d/codeph ">position</codeph> 重置为 0。</p>
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:SoundChannel:rightPeak: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 ">rightPeak</apiName><shortdesc class="- topic/shortdesc "> 
	 右声道的当前幅度（音量），范围从 0（静音）至 1（最大幅度）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
	 右声道的当前幅度（音量），范围从 0（静音）至 1（最大幅度）。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:SoundChannel: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 "> 
	 分配给该声道的 SoundTransform 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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="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 "> 
	 分配给该声道的 SoundTransform 对象。SoundTransform 对象包含用于设置音量、平移、左扬声器指定和右扬声器指定的属性。
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#SoundTransform" class="- topic/link "><linktext class="- topic/linktext ">SoundTransform</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:SoundMixer" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">SoundMixer</apiName><shortdesc class="- topic/shortdesc ">
SoundMixer 类包含用于在应用程序中进行全局声音控制的静态属性和方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">
SoundMixer 类包含用于在应用程序中进行全局声音控制的静态属性和方法。SoundMixer 类在应用程序中控制嵌入的声音流。它不控制动态创建的声音（即响应调度 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件的 Sound 对象而生成的声音）。

</apiDesc></apiClassifierDetail><apiOperation id="flash.media:SoundMixer:areSoundsInaccessible" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">areSoundsInaccessible</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><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 "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">布尔值的字符串表示形式。
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
     确定是否因安全限制而无法访问任何声音。例如，如果声音所在的服务器没有用于授予对所在域的访问权限的 URL 策略文件，则无法访问从调用此方法的内容所在域之外的其他域加载的声音。仍然可以加载和播放声音，但无法对不可访问的声音执行低级操作，如获取声音的 ID3 元数据。
     
     <p class="- topic/p ">对于应用程序安全沙箱中的 AIR 应用程序内容，调用此方法始终返回 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。应用程序安全沙箱中的内容可以访问所有声音（包括从其他域加载的声音）。</p>
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#SoundMixer/computeSpectrum()" class="- topic/link "><linktext class="- topic/linktext ">computeSpectrum()</linktext></link></related-links></apiOperation><apiOperation id="flash.media:SoundMixer:computeSpectrum" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">computeSpectrum</apiName><shortdesc class="- topic/shortdesc ">
     获取当前声音波形的快照，并将其放在指定的 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="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Should confirm if the floating point numbers are single- or double-precision.
     
     </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 "/><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 ">outputArray</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.utils:ByteArray</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">用于保存与声音关联的值的 ByteArray 对象。如果由于安全性限制 (<codeph class="+ topic/ph pr-d/codeph ">areSoundsInaccessible == true</codeph>) 而导致任何声音不可用，则 <codeph class="+ topic/ph pr-d/codeph ">outputArray</codeph> 对象将保持不变。如果停止了所有声音，则用零填充 <codeph class="+ topic/ph pr-d/codeph ">outputArray</codeph> 对象。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">FFTMode</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 ">一个用于表示是否首先对声音数据执行 Fourier 转换的布尔值。将此参数设置为 <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 ">stretchFactor</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 ">stretchFactor</codeph> 值设置为 0，则会按 44.1 KHz 对数据进行采样；如果值为 1，则按 22.05 KHz 对数据进行采样；如果值为 2，则按 11.025 KHz 对数据进行采样；依此类推。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     获取当前声音波形的快照，并将其放在指定的 ByteArray 对象中。这些值已设置为标准浮点值（范围为 -1.0 到 1.0）格式。新值覆盖了传递到 <codeph class="+ topic/ph pr-d/codeph ">outputArray</codeph> 参数的 ByteArray 对象。创建的 ByteArray 对象的大小固定为 512 个浮点值，其中前 256 个值表示左声道，后 256 个值表示右声道。
     
     <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>此方法受本地文件安全性限制和跨域加载限制的约束。如果正在使用本地文件或从服务器（该服务器与执行调用的内容在不同的域中）中加载的声音，则可能需要通过跨域策略文件来解决沙箱限制问题。有关详细信息，请参阅 Sound 类说明。此外，此方法无法用于从 RTMP 流中提取数据，即使与 RTMP 服务器位于相同域中的内容调用此方法时也是如此。</p>
     
     
     <p class="- topic/p ">在 Flash Player 9.0.115.0 及更高版本和 Adobe AIR 中，通过 RTMP 支持此方法。在 Flash Media Server 上，可以在服务器端脚本中控制对流的访问。有关详细信息，请参阅 <xref href="http://www.adobe.com/go/documentation_cn" scope="external" class="- topic/xref "><i class="+ topic/ph hi-d/i "> Server-Side ActionScript Language Reference for Adobe Flash Media Server</i></xref>（《Adobe Flash Media Server 服务器端 ActionScript 语言参考》）中的 <codeph class="+ topic/ph pr-d/codeph ">Client.audioSampleAccess</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">Client.videoSampleAccess</codeph> 属性。</p>
     
     </apiDesc><example conref="examples\SoundMixer_computeSpectrumExample.as" class="- topic/example "> 在下面的示例中，使用 <codeph class="+ topic/ph pr-d/codeph ">computeSpectrum()</codeph> 方法生成声音波形数据的图形表示形式。 
 
 <p class="- topic/p ">在构造函数中，加载了一个声音文件，并将其设置为播放。（此示例中没有任何错误处理代码，并假定该声音文件位于与 SWF 文件相同的目录中。）该示例在播放声音时侦听 <codeph class="+ topic/ph pr-d/codeph ">Event.ENTER_FRAME</codeph> 事件，从而反复触发 <codeph class="+ topic/ph pr-d/codeph ">onEnterFrame()</codeph> 方法以绘制声音数据值的图表。在播放完声音后，<codeph class="+ topic/ph pr-d/codeph ">onPlaybackComplete()</codeph> 方法可通过删除 <codeph class="+ topic/ph pr-d/codeph ">Event.ENTER_FRAME</codeph> 事件的侦听器以停止绘制过程。</p>
 
 <p class="- topic/p ">在 <codeph class="+ topic/ph pr-d/codeph ">onEnterFrame()</codeph> 方法中，<codeph class="+ topic/ph pr-d/codeph ">computeSpectrum()</codeph> 方法在 <codeph class="+ topic/ph pr-d/codeph ">bytes</codeph> 字节数组对象中存储原始声音。数据是按 44.1 KHz 进行采样的。包含 512 字节数据的字节数组，每个数组包含一个介于 -1 和 1 之间的浮点值。第一组 256 字节值表示左声道，而第二组 256 字节值表示右声道。第一个 for 循环读取第一组 256 字节数据值（表示左立体声道），然后使用 <codeph class="+ topic/ph pr-d/codeph ">Graphics.lineTo()</codeph> 方法绘制一条从每个点到下一个点的直线。（声音波形的矢量图形显示内容直接写入到类的 Sprite 对象中。）声音字节是作为 32 位浮点数从字节流中读取的，并乘以绘制高度以使其位于图表垂直范围内。宽度被设置为声道长度的两倍。第二个 for 循环读取下一批 256 字节值（右立体声道），并按相反的顺序绘制直线。<codeph class="+ topic/ph pr-d/codeph ">g.lineTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT);</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">g.lineTo(0, PLOT_HEIGHT);</codeph> 方法绘制波形的基线。生成的波形图会产生镜像效果。</p>  

<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.display.Graphics;
    import flash.events.Event;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.media.SoundMixer;
    import flash.net.URLRequest;
    import flash.utils.ByteArray;
    import flash.text.TextField;

    public class SoundMixer_computeSpectrumExample extends Sprite {

        public function SoundMixer_computeSpectrumExample() {
            var snd:Sound = new Sound();
            var req:URLRequest = new URLRequest("Song1.mp3");
            snd.load(req);
            
            var channel:SoundChannel;
            channel = snd.play();
            addEventListener(Event.ENTER_FRAME, onEnterFrame);
            channel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
        }

        private function onEnterFrame(event:Event):void {
            var bytes:ByteArray = new ByteArray();
            const PLOT_HEIGHT:int = 200;
            const CHANNEL_LENGTH:int = 256;

            SoundMixer.computeSpectrum(bytes, false, 0);
            
            var g:Graphics = this.graphics;
            
            g.clear();
       
            g.lineStyle(0, 0x6600CC);
            g.beginFill(0x6600CC);
            g.moveTo(0, PLOT_HEIGHT);
            
            var n:Number = 0;
            
            for (var i:int = 0; i &lt; CHANNEL_LENGTH; i++) {
                n = (bytes.readFloat() * PLOT_HEIGHT);
                g.lineTo(i * 2, PLOT_HEIGHT - n);
            }

            g.lineTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT);
            g.endFill();
 
            g.lineStyle(0, 0xCC0066);
            g.beginFill(0xCC0066, 0.5);
            g.moveTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT);
            
            for (i = CHANNEL_LENGTH; i > 0; i--) {
                n = (bytes.readFloat() * PLOT_HEIGHT);
                g.lineTo(i * 2, PLOT_HEIGHT - n);
            }
  
            g.lineTo(0, PLOT_HEIGHT);
            g.endFill();
        }
        
        private function onPlaybackComplete(event:Event):void {
            removeEventListener(Event.ENTER_FRAME, onEnterFrame);
        }
    }
}

</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#SoundMixer/areSoundsInaccessible()" class="- topic/link "><linktext class="- topic/linktext ">areSoundsInaccessible()</linktext></link><link href="flash.utils.xml#ByteArray" class="- topic/link "><linktext class="- topic/linktext ">flash.utils.ByteArray</linktext></link><link href="flash.media.xml#Sound" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Sound</linktext></link><link href="flash.media.xml#SoundLoaderContext/checkPolicyFile" class="- topic/link "><linktext class="- topic/linktext ">flash.media.SoundLoaderContext.checkPolicyFile</linktext></link></related-links></apiOperation><apiOperation id="flash.media:SoundMixer:stopAll" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">stopAll</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 "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><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 Professional 中，此方法不会停止播放头。设置到流的声音在播放头移过它们所在的帧时将恢复播放。</p>
     
     <p class="- topic/p ">在使用此属性时，请考虑以下安全模型：</p>
     
     <ul class="- topic/ul "><li class="- topic/li "> 默认情况下，调用 <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.stopAll()</codeph> 方法只会停止与调用此方法的对象在相同安全沙箱中的声音。任何声音播放如果不是从与调用对象相同的沙箱中启动的，则不会停止这样的声音。</li><li class="- topic/li ">使用 Sound 类的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法加载声音时，可指定 <codeph class="+ topic/ph pr-d/codeph ">context</codeph> 参数，该参数为一个 SoundLoaderContext 对象。如果将 SoundLoaderContext 对象的 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> 属性设为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则 <ph class="- topic/ph ">Flash Player 或 </ph>Adobe AIR 将在从其中加载该声音的服务器上检查跨域策略文件是否存在。如果该服务器具有跨域策略文件，且该文件允许访问执行调用的内容域，则该文件可使用 <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.stopAll()</codeph> 方法停止加载的声音；否则就不可以。</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\SoundMixer_stopAllExample.as" class="- topic/example "> 在下面的示例中，使用 <codeph class="+ topic/ph pr-d/codeph ">stopAll()</codeph> 方法将同时播放的两种声音静音。 
 
 <p class="- topic/p ">在构造函数中，加载了两个不同的声音文件，并将其设置为播放。第一种声音是本地加载的，并将其分配给一个声道。（假定该文件位于与 SWF 文件相同的目录中。）第二个文件是从 Adobe 站点加载并流式传输的。要使用 <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.stopAll()</codeph> 方法，必须能够访问所有声音。（可以使用 SoundLoaderContext 对象来检查跨域策略文件。）每种声音还包含一个事件侦听器，如果在加载声音文件时发生 IO 错误，则会调用该事件侦听器。还创建了一个 <codeph class="+ topic/ph pr-d/codeph ">muteButton</codeph> 文本字段。它侦听 click 事件，这将调用 <codeph class="+ topic/ph pr-d/codeph ">muteButtonClickHandler()</codeph> 方法。</p>
 
 <p class="- topic/p ">在 <codeph class="+ topic/ph pr-d/codeph ">muteButtonClickHandler()</codeph> 方法中，如果文本字段的内容为“MUTE”，<codeph class="+ topic/ph pr-d/codeph ">areSoundsInaccessible()</codeph> 方法将检查混音器是否具有文件的访问权限。如果可以访问文件，<codeph class="+ topic/ph pr-d/codeph ">stopAll()</codeph> 方法将停止播放声音。通过再次选择文本字段，第一个声音开始播放并且文本字段的内容再次更改为“MUTE”。此时，<codeph class="+ topic/ph pr-d/codeph ">stopAll()</codeph> 方法将正在播放的那种声音静音。请注意，也可以使用声道的 <codeph class="+ topic/ph pr-d/codeph ">stop()</codeph> 方法停止播放为声道分配的特定声音。（为了使用声道功能，每次调用 <codeph class="+ topic/ph pr-d/codeph ">play()</codeph> 方法时，都需要为声道重新分配声音。）</p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import flash.media.Sound;
    import flash.media.SoundLoaderContext;
    import flash.media.SoundChannel;
    import flash.media.SoundMixer;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.events.MouseEvent;
    import flash.events.IOErrorEvent;

    public class SoundMixer_stopAllExample extends Sprite  {
        private var firstSound:Sound = new Sound();
        private var secondSound:Sound = new Sound();
        private var muteButton:TextField = new TextField();
        private var channel1:SoundChannel = new SoundChannel();
        
        public function SoundMixer_stopAllExample() {
            firstSound.load(new URLRequest("mySound.mp3"));
            secondSound.load(new URLRequest("http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3"));

            firstSound.addEventListener(IOErrorEvent.IO_ERROR, firstSoundErrorHandler);
            secondSound.addEventListener(IOErrorEvent.IO_ERROR, secondSoundErrorHandler);
            
            channel1 = firstSound.play();
            secondSound.play();
            
            muteButton.autoSize = TextFieldAutoSize.LEFT;
            muteButton.border = true;
            muteButton.background = true;
            muteButton.text = "MUTE";
        
            muteButton.addEventListener(MouseEvent.CLICK, muteButtonClickHandler);         
        
            this.addChild(muteButton);
        }

        private function muteButtonClickHandler(event:MouseEvent):void {

            if(muteButton.text == "MUTE") {        
  
                if(SoundMixer.areSoundsInaccessible() == false) {
                    SoundMixer.stopAll();
                    muteButton.text = "click to play only one of sound.";
                }
                else {
                    muteButton.text = "The sounds are not accessible.";
                }
            }
           else {
                firstSound.play();        
                muteButton.text = "MUTE";
           }
        } 

        private function firstSoundErrorHandler(errorEvent:IOErrorEvent):void {
            trace(errorEvent.text);
        }

        private function secondSoundErrorHandler(errorEvent:IOErrorEvent):void {
            trace(errorEvent.text);
        }
    }
}
</codeblock></example></apiOperationDetail></apiOperation><apiValue id="flash.media:SoundMixer: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 "><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 "/><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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     在开始传输嵌入的声音流之前，将其预加载到缓冲区中所用的秒数。除非实现了一个跨域策略文件，否则已加载声音中的数据（包括其缓冲时间）无法被位于其他域的 SWF 文件访问。有关安全性和声音的详细信息，请参阅 Sound 类说明。<ph class="- topic/ph ">除非实现了一个跨域策略文件，否则位于其他域的文件中的代码将无法访问已加载声音中的数据（包括其缓冲时间）。但是，在 AIR 应用程序中应用程序安全沙箱中，代码可以访问来自任何源的声音文件中的数据。有关安全性和声音的详细信息，请参阅 Sound 类说明。</ph> 
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">SoundMixer.bufferTime</codeph> 属性只会影响 SWF 中嵌入声音流的缓冲时间，该属性与动态创建的 Sound 对象（即在 ActionScript 中创建的 Sound 对象）无关。<codeph class="+ topic/ph pr-d/codeph ">SoundMixer.bufferTime</codeph> 的值无法覆盖或设置传递到 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 方法的 SoundLoaderContext 对象中指定的缓冲时间默认值。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound" class="- topic/link "><linktext class="- topic/linktext ">Sound</linktext></link></related-links></apiValue><apiValue id="flash.media:SoundMixer: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 "> 
     控制全局声音属性的 SoundTransform 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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 "/><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.media:SoundTransform</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
     控制全局声音属性的 SoundTransform 对象。SoundTransform 对象包含用于设置音量、平移、左扬声器指定和右扬声器指定的属性。在此属性中使用的 SoundTransform 对象提供最终声音设置，这些设置将在应用了任何个别声音设置之后应用于所有声音。
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#SoundTransform" class="- topic/link "><linktext class="- topic/linktext ">SoundTransform</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:CameraUI" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">CameraUI</apiName><shortdesc class="- topic/shortdesc ">
	 CameraUI 类允许您使用设备上的默认摄像头应用程序捕获静态图像或视频。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">
	 CameraUI 类允许您使用设备上的默认摄像头应用程序捕获静态图像或视频。 	 
	 
	 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">launch()</codeph> 方法请求设备打开默认摄像头应用程序。捕获的图像或视频在为 complete 事件调度的 MediaEvent 对象中是可用的。由于默认摄像头应用程序可以各种格式保存图像或视频，无法保证返回的媒体对象能够由 AIR 运行时加载并显示。 </p>
	 
	 <p class="- topic/p ">在某些平台上，摄像头返回的 media 对象作为基于文件的媒体承诺是可访问的。在其他平台上，媒体承诺不是基于文件的，MediaPromise 对象的 <codeph class="+ topic/ph pr-d/codeph ">file</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">relativePath</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。不要在多个平台上使用的代码中使用这些属性。</p>
	 
	 <p class="- topic/p ">在某些平台上，media 对象自动存储在设备媒体库中。在图像和视频不通过默认摄像机应用程序自动存储的那些平台上，您可以使用 CameraRoll <codeph class="+ topic/ph pr-d/codeph ">addBitmapData()</codeph> 函数存储 media 对象。</p>
	 
	 <p class="- topic/p ">在 Android 上，如果外部存储卡不可用（例如，用户将卡作为 USB 大容量存储器设备载入），则默认摄像机应用程序不打开。此外，启动摄像头的 AIR 应用程序会丢失焦点。如果设备在运行时资源不足，可以在媒体捕获完成之前由操作系统终止 AIR 应用程序。</p>
	 
	 <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>移动设备支持此功能，但桌面操作系统或用于电视的 AIR 设备不支持此功能。您可以使用 <codeph class="+ topic/ph pr-d/codeph ">CameraUI.isSupported</codeph> 属性在运行时测试是否受支持。有关在多个配置文件之间支持 API 的详细信息，请参阅 <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">AIR 配置文件支持</xref>。</p>
	 
	 </apiDesc><example conref="examples\CameraUIExample.Still.1.as" class="- topic/example "> 下面的示例使用 CameraUI 类启动设备上的默认摄像头应用程序。用户拍照时，该示例将图像置于显示列表中。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package  {
 import flash.desktop.NativeApplication;
 import flash.display.Loader;
 import flash.display.MovieClip;
 import flash.display.StageAlign;
 import flash.display.StageScaleMode;
 import flash.events.ErrorEvent;
 import flash.events.Event;
 import flash.events.IOErrorEvent;
 import flash.events.MediaEvent;
 import flash.media.CameraUI;
 import flash.media.MediaPromise;
 import flash.media.MediaType;
 
     public class CameraUIStillImage extends MovieClip{

          private var deviceCameraApp:CameraUI = new CameraUI();
          private var imageLoader:Loader; 
    
          public function CameraUIStillImage() {
               this.stage.align = StageAlign.TOP_LEFT;
               this.stage.scaleMode = StageScaleMode.NO_SCALE;
       
               if( CameraUI.isSupported )
               {
                trace( "Initializing camera..." );
    
                deviceCameraApp.addEventListener( MediaEvent.COMPLETE, imageCaptured );
                deviceCameraApp.addEventListener( Event.CANCEL, captureCanceled );
                deviceCameraApp.addEventListener( ErrorEvent.ERROR, cameraError );
                deviceCameraApp.launch( MediaType.IMAGE );
               }
               else
               {
                trace( "Camera interface is not supported.");
               }
          }
    
          private function imageCaptured( event:MediaEvent ):void
          {
               trace( "Media captured..." );
       
               var imagePromise:MediaPromise = event.data;
       
               if( imagePromise.isAsync )
               {
                trace( "Asynchronous media promise." );
                imageLoader = new Loader();
                imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, asyncImageLoaded );
                imageLoader.addEventListener( IOErrorEvent.IO_ERROR, cameraError );
                
                imageLoader.loadFilePromise( imagePromise );
               }
               else
               {
                trace( "Synchronous media promise." );
                imageLoader.loadFilePromise( imagePromise );
                showMedia( imageLoader );
               }
          }
    
          private function captureCanceled( event:Event ):void
          {
               trace( "Media capture canceled." );
               NativeApplication.nativeApplication.exit();
          }
    
          private function asyncImageLoaded( event:Event ):void
          {
               trace( "Media loaded in memory." );
               showMedia( imageLoader );    
          }
    
          private function showMedia( loader:Loader ):void
          {
               this.addChild( loader );
          }
      
          private function cameraError( error:ErrorEvent ):void
          {
               trace( "Error:" + error.text );
               NativeApplication.nativeApplication.exit();
          }
     }
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="http://www.riagora.com/2010/07/android-air-and-the-camera/" class="- topic/link "><linktext class="- topic/linktext ">Michael Chaize：Android、AIR 和摄像头</linktext></link></related-links><adobeApiEvent id="flash.media:CameraUI_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 ">
	 当用户关闭 Camera UI 而不保存图片或视频时，会调度 cancel 事件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.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 ">
	 当用户关闭摄像头 UI 而不保存照片或视频时，会调度 <codeph class="+ topic/ph pr-d/codeph ">cancel</codeph> 事件。
	 
	 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:CameraUI_flash.events.ErrorEvent.ERROR_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 adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">error</apiName><shortdesc class="- topic/shortdesc ">
 	当默认摄像头无法打开时，将调度 error 事件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.ErrorEvent.ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ErrorEvent</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 ">error</codeph> 事件。
	
 	</apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:CameraUI_flash.events.MediaEvent.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 ">
 	当用户在摄像头 UI 中捕获静态图片或视频时，将调度 complete 事件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.MediaEvent.COMPLETE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.MediaEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 	当用户在摄像头 UI 中捕获静态图片或视频时，将调度 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件。
	
 	</apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.media:CameraUI:CameraUI" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">CameraUI</apiName><shortdesc class="- topic/shortdesc ">
		 创建 CameraUI 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">
		 创建 CameraUI 对象。
		 
		 </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.media:CameraUI:launch" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">launch</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.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 "/><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 ">requestedMediaType</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要捕获的媒体对象的类型。在 MediaType 类中定义此参数的有效值：
		 <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">MediaType.IMAGE</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">MediaType.VIDEO</codeph></li></ul> 
		  
		 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
		 启动设备上的默认摄像头应用程序。 
		 
		 <p class="- topic/p ">您可以使用此类捕获静态图像或视频。视频捕获使用设备上的“低品质”可携式摄像机配置文件。</p>
		 
		 <p class="- topic/p ">调用 <codeph class="+ topic/ph pr-d/codeph ">launch()</codeph> 方法时，会调用设备上的默认摄像头应用程序。AIR 应用程序丢失焦点并等待用户捕获静态图像或完成捕获视频。一旦用户捕获了所需的媒体，AIR 应用程序会重新获得焦点，此 CameraUI 对象调度 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件。如果用户取消操作，则此 CameraUI 对象调度 <codeph class="+ topic/ph pr-d/codeph ">cancel</codeph> 事件。</p>
		 
		 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>AIR 应用程序在后台等待用户捕获图像或视频时，可能会被 Android 操作系统关闭。如果发生这种情况，用户必须重新启动应用程序。AIR 应用程序不对上一个图像捕获调度 media 事件。</p>
		 
		 <p class="- topic/p ">您可以使用为 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件调度的 MediaEvent 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性访问捕获的媒体文件。此属性是 MediaPromise 类的实例，您可以使用 Loader 类的 <codeph class="+ topic/ph pr-d/codeph ">loadFilePromise()</codeph> 方法将其加载到您的应用程序。请注意，设备摄像头可以用各种格式保存捕获的媒体。因此，视频很容易出问题。在 AIR 中可能无法显示捕获的媒体。</p>
		 
		 </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#MediaType" class="- topic/link "><linktext class="- topic/linktext ">MediaType</linktext></link><link href="flash.media.xml#MediaPromise" class="- topic/link "><linktext class="- topic/linktext ">MediaPromise</linktext></link><link href="flash.display.xml#Loader/loadFilePromise()" class="- topic/link "><linktext class="- topic/linktext ">Loader.loadFilePromise()</linktext></link></related-links><adobeApiEvent id="flash.media:CameraUI:launch_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:MediaEvent</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.media:CameraUI:launch_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.media:CameraUI:launch_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 adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">error</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:ErrorEvent</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.media:CameraUI:launch_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 adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">error</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:ErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 AIR 应用程序在后台运行且它调用此函数时进行调度。
		 
		 </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当 AIR 应用程序在后台运行且它调用此函数时进行调度。</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.media:CameraUI: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 ">
		 报告当前设备是否支持 CameraUI 类。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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 ">
		 报告当前设备是否支持 CameraUI 类。
		 
		 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:SoundCodec" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">SoundCodec</apiName><shortdesc class="- topic/shortdesc ">
SoundCodec 类是在设置 Microphone 类的 codec 属性时使用的常量值的枚举。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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><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 ">
SoundCodec 类是在设置 <codeph class="+ topic/ph pr-d/codeph ">Microphone</codeph> 类的 <codeph class="+ topic/ph pr-d/codeph ">codec</codeph> 属性时使用的常量值的枚举。

</apiDesc></apiClassifierDetail><apiValue id="flash.media:SoundCodec:NELLYMOSER" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">NELLYMOSER</apiName><shortdesc class="- topic/shortdesc "> 
	指定将使用 Nellymoser 编解码器进行音频压缩。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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 ">NellyMoser</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
	指定将使用 Nellymoser 编解码器进行音频压缩。此常量为 <codeph class="+ topic/ph pr-d/codeph ">Microphone.codec</codeph> 属性的默认值。
	
	</apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:SoundCodec:SPEEX" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">SPEEX</apiName><shortdesc class="- topic/shortdesc "> 
	指定将使用 Speex 编解码器进行音频压缩。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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 ">Speex</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
	指定将使用 Speex 编解码器进行音频压缩。
	
	</apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:CameraRoll" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">CameraRoll</apiName><shortdesc class="- topic/shortdesc ">
CameraRoll 类允许您访问系统媒体库或“相机卷”中的图像数据。AIR 配置文件支持：移动设备支持此功能，但桌面操作系统或用于电视的 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="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 ">
CameraRoll 类允许您访问系统媒体库或“相机卷”中的图像数据。 

<p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>移动设备支持此功能，但桌面操作系统或用于电视的 AIR 设备不支持此功能。有关在多个配置文件之间支持 API 的详细信息，请参阅 <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">AIR 配置文件支持</xref>。</p>

<p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">CameraRoll.addBitmapData()</codeph> 方法将图像添加到设备的专用媒体库。要在运行时检查应用程序是否支持 <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.addBitmapData()</codeph> 方法，请检查 <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.supportsAddBitmapData</codeph> 属性。</p>

<p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">CameraRoll.browseForImage()</codeph> 方法打开一个图像选择对话框，以便用户在媒体库中选择图像。当用户选择图像时，CameraRoll 对象调度 <codeph class="+ topic/ph pr-d/codeph ">select</codeph> 事件。使用为此事件调度的 MediaEvent 对象访问所选的图像。要在运行时检查您的应用程序是否支持 <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.browseForImage()</codeph> 方法，请检查 <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.supportsBrowseForImage</codeph> 属性。</p>

</apiDesc></apiClassifierDetail><adobeApiEvent id="flash.media:CameraRoll_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="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.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 ">
 当用户取消浏览图像操作而不选择图像时进行调度。
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:CameraRoll_flash.events.MediaEvent.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="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.MediaEvent.SELECT</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.MediaEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 当用户从设备媒体库选择图像时进行调度。
 
 <p class="- topic/p ">为此事件调度的 MediaEvent 对象提供对所选媒体的访问权限。</p>
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:CameraRoll_flash.events.ErrorEvent.ERROR_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 adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">error</apiName><shortdesc class="- topic/shortdesc ">
 当出错时调度 error 事件。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.ErrorEvent.ERROR</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ErrorEvent</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 ">error</codeph> 事件。
 
 <p class="- topic/p ">错误源包括：</p> 
 <ul class="- topic/ul "><li class="- topic/li ">图像浏览器无法打开。</li><li class="- topic/li ">图像浏览器已在使用中。</li><li class="- topic/li ">AIR 应用程序尝试在后台浏览图像。</li><li class="- topic/li ">图像无法添加到媒体库。</li><li class="- topic/li ">设备不支持调用的方法。</li></ul>
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><adobeApiEvent id="flash.media:CameraRoll_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 ">
 表示 addBitmapData() 操作成功完成。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.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 ">
 表示 addBitmapData() 操作成功完成。
 
 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiConstructor id="flash.media:CameraRoll:CameraRoll" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">CameraRoll</apiName><shortdesc class="- topic/shortdesc ">
	 创建一个 CameraRoll 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "/></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 创建一个 CameraRoll 对象。
	 
	 <p class="- topic/p ">ActionScript 仅支持一个媒体库。所有 CameraRoll 对象都保存到相同的图像储备库。</p>
	 
	 </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.media:CameraRoll:addBitmapData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">addBitmapData</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 "><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 ">bitmapData</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.display:BitmapData</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 BitmapData 对象，其中包含要发送到相机卷的图像。 
	
	</apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	将图像添加到设备摄像头卷。 
	
	
	<p class="- topic/p ">要在运行时检查应用程序是否支持 <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.addBitmapData()</codeph> 方法，请检查 <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.supportsAddBitmapData</codeph> 属性。</p>
	
	</apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.media:CameraRoll:browseForImage" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">browseForImage</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.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 "/><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 ">当用户选择图像时，此 CameraRoll 实例调度一个包含 MediaEvent 对象的 <codeph class="+ topic/ph pr-d/codeph ">select</codeph> 事件。使用 MediaEvent 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性加载图像。<codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性是一个 MediaPromise 对象，您可以使用 Loader 类的 <codeph class="+ topic/ph pr-d/codeph ">loadFilePromise()</codeph> 方法加载它。</p>
	
	<p class="- topic/p ">要在运行时检查您的应用程序是否支持 <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.browseForImage()</codeph> 方法，请检查 <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.supportsBrowseForImage</codeph> 属性。</p>
	
	</apiDesc><example conref="examples\CameraRoll_browseForImage_1.as" class="- topic/example "><codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">package flash.media.examples
{
        import flash.media.CameraRoll;
        import flash.media.MediaPromise;
        import flash.media.MediaType;
        import flash.events.MediaEvent;
        import flash.events.Event;
        import flash.display.Loader;
        import flash.display.Sprite;
        import flash.events.IOErrorEvent;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
        
        public class CameraRollTest extends Sprite{
            private var mediaSource:CameraRoll = new CameraRoll();
            
            public function CameraRollTest() {
                this.stage.align = StageAlign.TOP_LEFT;
                this.stage.scaleMode = StageScaleMode.NO_SCALE;
                
                if( CameraRoll.supportsBrowseForImage )
                {
                    log( "Browsing for image..." );
                    mediaSource.addEventListener( MediaEvent.SELECT, imageSelected );
                    mediaSource.addEventListener( Event.CANCEL, browseCanceled );
                    
                    mediaSource.browseForImage();
                }
                else
                {
                    log( "Browsing in camera roll is not supported.");
                }
            }
            
            private var imageLoader:Loader; 
            private function imageSelected( event:MediaEvent ):void
            {
                log( "Image selected..." );
                
                var imagePromise:MediaPromise = event.data;
                
                imageLoader = new Loader();
                if( imagePromise.isAsync )
                {
                    log( "Asynchronous media promise." );
                    imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, imageLoaded );
                    imageLoader.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, imageLoadFailed );
                    imageLoader.loadFilePromise( imagePromise );
                }
                else
                {
                    log( "Synchronous media promise." );
                    imageLoader.loadFilePromise( imagePromise );
                    this.addChild( imageLoader );
                }
            }
            
            private function browseCanceled( event:Event ):void
            {
                log( "Image browse canceled." );
            }
            
            private function imageLoaded( event:Event ):void
            {
                log( "Image loaded asynchronously." );
                this.addChild( imageLoader );
            }
            
            private function imageLoadFailed( event:Event ):void
            {
                log( "Image load failed." );
            }
            
            private function log( text:String ):void
            {
                trace( text );
            }
            
        }
        
    }
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.events.xml#MediaEvent" class="- topic/link "><linktext class="- topic/linktext ">MediaEvent</linktext></link><link href="flash.media.xml#MediaPromise" class="- topic/link "><linktext class="- topic/linktext ">MediaPromise</linktext></link><link href="flash.display.xml#Loader/loadFilePromise()" class="- topic/link "><linktext class="- topic/linktext ">Loader.loadFilePromise()</linktext></link></related-links><adobeApiEvent id="flash.media:CameraRoll:browseForImage_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:MediaEvent</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.media:CameraRoll:browseForImage_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.media:CameraRoll:browseForImage_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 adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">error</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:ErrorEvent</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.media:CameraRoll:browseForImage_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 adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">error</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:ErrorEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">当 AIR 应用程序在后台运行且它调用此函数时进行调度。
	 
	</apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">当 AIR 应用程序在后台运行且它调用此函数时进行调度。</shortdesc></adobeApiEvent></apiOperation><apiValue id="flash.media:CameraRoll:supportsAddBitmapData: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 ">supportsAddBitmapData</apiName><shortdesc class="- topic/shortdesc ">
	是否支持 CameraRoll.addBitmapData() 方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
	是否支持 <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.addBitmapData()</codeph> 方法。当前，仅移动设备中的 AIR 应用程序支持此功能。
	
	</apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:CameraRoll:supportsBrowseForImage: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 ">supportsBrowseForImage</apiName><shortdesc class="- topic/shortdesc ">
	报告是否支持 CameraRoll.browseForImage() 方法。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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><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><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">报告是否支持 CameraRoll browseForImage() 方法。
	</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	报告是否支持 <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.browseForImage()</codeph> 方法。当前，仅移动设备中的 AIR 应用程序支持此功能。
	
	</apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:Microphone" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">Microphone</apiName><shortdesc class="- topic/shortdesc ">
 使用 Microphone 类监视音频或从麦克风捕获音频。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Microphone, audio, sound
 </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 ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 使用 Microphone 类监视音频或从麦克风捕获音频。
 
 <p class="- topic/p ">
 要获得对 Microphone 实例的引用，请使用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph> 方法或 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getEnhancedMicrophone()</codeph> 方法。增强的麦克风实例可执行回音消除。使用回音消除功能可创建不需要耳机的实时音频/视频应用程序。 
 </p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">创建实时聊天应用程序</b></p>
 <p class="- topic/p ">若要创建实时聊天应用程序，请捕获音频并将其发送到 Flash Media Server。使用 NetConnection 和 NetStream 类可将音频流发送到 Flash Media Server。Flash Media Server 可将音频广播到其他客户端。若要创建不需要耳机的聊天应用程序，请使用回音消除功能。回音消除功能可防止反馈回路 — 当音频进入麦克风，离开扬声器，并再次进入麦克风时，将产生反馈回路。若要使用回音消除功能，请调用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getEnhancedMicrophone()</codeph> 方法以获得对 Microphone 实例的引用。将 <codeph class="+ topic/ph pr-d/codeph ">Microphone.enhancedOptions</codeph> 设置为 <codeph class="+ topic/ph pr-d/codeph ">MicrophoneEnhancedOptions</codeph> 类的实例可配置设置。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">在本地播放麦克风音频</b></p>
 <p class="- topic/p ">调用 Microphone <codeph class="+ topic/ph pr-d/codeph ">setLoopback()</codeph> 方法将麦克风音频直接传送到本地计算机或设备音频输出。未控制的音频反馈始终是个问题，每当音频输出可以由麦克风输入拾取时都可能发生。<codeph class="+ topic/ph pr-d/codeph ">setUseEchoSuppression()</codeph> 方法可以减少（但无法消除）反馈放大的风险。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">捕获麦克风音频以便进行本地录制或处理</b></p>
 <p class="- topic/p ">要捕获麦克风音频，请侦听由 Microphone 实例调度的 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件。为此事件调度的 SampleDataEvent 对象包含音频数据。</p>
 
 <p class="- topic/p ">有关捕获视频的信息，请参阅 Camera 类。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">运行时麦克风支持</b></p>
 <p class="- topic/p ">在移动浏览器中运行的 Flash Player 不支持 Microphone 类。</p>
 
 <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>桌面操作系统支持 Microphone 类，但并非所有移动设备均支持此功能。用于电视的 AIR 设备不支持此功能。有关在多个配置文件之间支持 API 的详细信息，请参阅 <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">AIR 配置文件支持</xref>。</p>
 
 <p class="- topic/p ">您可以使用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.isSupported</codeph> 属性在运行时测试是否受支持。注意，在用于电视的 AIR 设备上，<codeph class="+ topic/ph pr-d/codeph ">Microphone.isSupported</codeph> 为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，但是 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph> 始终返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">隐私控制</b></p>
 <p class="- topic/p ">
 Flash Player 显示一个“隐私”对话框，让用户选择是允许还是拒绝访问麦克风。您的应用程序窗口大小必须至少是 215 x 138 像素，这是显示对话框要求的最小大小，否则自动拒绝访问。
 </p>
 <p class="- topic/p ">在 AIR 应用程序沙箱中运行的内容不需要访问麦克风的权限，并且不显示对话框。在应用程序沙箱外运行的 AIR 内容要求权限，并显示“隐私”对话框。</p>
 
 </apiDesc><example conref="examples\MicrophoneExample.as" class="- topic/example "> 以下示例在用户允许访问其计算机的麦克风后通过使用麦克风的回音抑制捕获声音。<codeph class="+ topic/ph pr-d/codeph ">Security.showSettings()</codeph> 方法显示 Flash Player 对话框，请求提供对用户的麦克风的访问权限。对 <codeph class="+ topic/ph pr-d/codeph ">setLoopBack(true)</codeph> 的调用会将输入重新发送到本地扬声器，以便在运行示例时可以听到声音。
 
 <p class="- topic/p ">有两个侦听器用于侦听 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">status</codeph> 事件。<codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件在会话开始和结束（如果有）时被调度，并由 <codeph class="+ topic/ph pr-d/codeph ">activityHandler()</codeph> 方法捕获（此方法跟踪有关该事件的信息）。<codeph class="+ topic/ph pr-d/codeph ">status</codeph> 事件在附加的 Microphone 对象报告任何状态信息时被调度；将使用 <codeph class="+ topic/ph pr-d/codeph ">statusHandler()</codeph> 方法捕获并跟踪此信息。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>必须将麦克风与计算机连接，此示例才能正常运行。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.media.Microphone;
    import flash.system.Security;

    public class MicrophoneExample extends Sprite {
        public function MicrophoneExample() {
            var mic:Microphone = Microphone.getMicrophone();
            Security.showSettings("2");
            mic.setLoopBack(true);
                    
            if (mic != null) {
                mic.setUseEchoSuppression(true);
                mic.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
                mic.addEventListener(StatusEvent.STATUS, statusHandler);
            }
        }

        private function activityHandler(event:ActivityEvent):void {
            trace("activityHandler: " + event);
        }

        private function statusHandler(event:StatusEvent):void {
            trace("statusHandler: " + event);
        }
    }
}
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Camera</linktext></link><link href="flash.media.xml#MicrophoneEnhancedMode" class="- topic/link "><linktext class="- topic/linktext ">flash.media.MicrophoneEnhancedMode</linktext></link><link href="flash.media.xml#MicrophoneEnhancedOptions" class="- topic/link "><linktext class="- topic/linktext ">flash.media.MicrophoneEnhancedOptions</linktext></link><link href="http://mrbinitie.blogspot.com/2011/03/implementing-acoustic-echo-suppression.html" class="- topic/link "><linktext class="- topic/linktext ">aYo Binitie：在 Flash/Flex 应用程序中实现回音抑制</linktext></link><link href="http://coenraets.org/blog/air-for-android-samples/voice-notes-for-android/" class="- topic/link "><linktext class="- topic/linktext ">Cristophe Coenraets：Android 语音注意事项</linktext></link><link href="http://www.riagora.com/2010/08/air-android-and-the-microphone/" class="- topic/link "><linktext class="- topic/linktext ">Michael Chaize：AIR、Android 和麦克风</linktext></link></related-links><adobeApiEvent id="flash.media:Microphone_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 ">
 在麦克风报告其状态时调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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.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 ">code</codeph> 属性的值为“<codeph class="+ topic/ph pr-d/codeph ">Microphone.Muted</codeph>”，则表示用户拒绝 SWF 文件访问麦克风。如果 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性的值为“<codeph class="+ topic/ph pr-d/codeph ">Microphone.Unmuted</codeph>”，则表示用户允许 SWF 文件访问麦克风。
 
 <p class="- topic/p ">在 Adobe AIR 应用程序中不调度 Status 事件；无法动态更改对麦克风的访问权限。在大多数平台上，AIR 应用程序始终可以访问麦克风。在 Android 上，应用程序必须在应用程序描述符中指定 Android RECORD_AUDIO 权限。否则，Android 会同时拒绝对麦克风的访问。</p>
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/getMicrophone()" class="- topic/link "><linktext class="- topic/linktext ">Microphone.getMicrophone()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.media:Microphone_flash.events.SampleDataEvent.SAMPLE_DATA_sampleData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">sampleData</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><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.SampleDataEvent.SAMPLE_DATA</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.SampleDataEvent</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 ">Microphone.rate</codeph> 属性确定每秒生成的采样数。每个事件的样本数是每秒样本数和事件调用之间延迟的一个系数。
 </p>
 
 </apiDesc><example conref="examples\Microphone.sampleDataEvent.1.as" class="- topic/example "> 以下示例从默认麦克风捕获 4 秒钟的音频采样，然后回放该音频。确保麦克风已连接。<codeph class="+ topic/ph pr-d/codeph ">micSampleDataHandler()</codeph> 是 Microphone 对象的 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件的事件侦听器。<codeph class="+ topic/ph pr-d/codeph ">micSampleDataHandler()</codeph> 方法获取可用采样并将它们的值附加到 ByteArray 对象。Timer 对象设置为 4 秒。Timer 删除 Microphone 对象事件侦听器的 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件，创建 Sound 对象，并为 Sound 对象添加 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件侦听器。Sound 对象的 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件侦听器，即 <codeph class="+ topic/ph pr-d/codeph ">playbackSampleHandler()</codeph> 方法，为要播放的 Sound 对象提供了音频采样。这些音频采样是从存储 Microphone 采样的 ByteArray 对象中检索出的。由于 Microphone 采样使用单声道声音记录而 Sound 对象请求立体声对采样，所以采样被写入 Sound 对象两次。Microphone 对象的 <codeph class="+ topic/ph pr-d/codeph ">rate</codeph> 属性设置为 44，以匹配 Sound 对象使用的 44 kHz 采样率。
 
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock "> 
const DELAY_LENGTH:int = 4000;

var mic:Microphone = Microphone.getMicrophone();
mic.setSilenceLevel(0, DELAY_LENGTH);
mic.gain = 100;
mic.rate = 44;
mic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);

var timer:Timer = new Timer(DELAY_LENGTH);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();

var soundBytes:ByteArray = new ByteArray();

function micSampleDataHandler(event:SampleDataEvent):void
{
    while(event.data.bytesAvailable)
    {
        var sample:Number = event.data.readFloat();
        soundBytes.writeFloat(sample);
    }
}

function timerHandler(event:TimerEvent):void
{        
    mic.removeEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);
    timer.stop();
    soundBytes.position = 0;
    var sound:Sound = new Sound();
    sound.addEventListener(SampleDataEvent.SAMPLE_DATA, playbackSampleHandler);
    sound.play();
}

function playbackSampleHandler(event:SampleDataEvent):void
{
    for (var i:int = 0; i &lt; 8192 &amp;&amp; soundBytes.bytesAvailable > 0; i++) 
    {
        var sample:Number = soundBytes.readFloat();
        event.data.writeFloat(sample);
        event.data.writeFloat(sample);
    }
}
</codeblock></example><example conref="examples\MicrophoneExample.as" class="- topic/example "> 以下示例在用户允许访问其计算机的麦克风后通过使用麦克风的回音抑制捕获声音。<codeph class="+ topic/ph pr-d/codeph ">Security.showSettings()</codeph> 方法显示 Flash Player 对话框，请求提供对用户的麦克风的访问权限。对 <codeph class="+ topic/ph pr-d/codeph ">setLoopBack(true)</codeph> 的调用会将输入重新发送到本地扬声器，以便在运行示例时可以听到声音。
 
 <p class="- topic/p ">有两个侦听器用于侦听 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">status</codeph> 事件。<codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件在会话开始和结束（如果有）时被调度，并由 <codeph class="+ topic/ph pr-d/codeph ">activityHandler()</codeph> 方法捕获（此方法跟踪有关该事件的信息）。<codeph class="+ topic/ph pr-d/codeph ">status</codeph> 事件在附加的 Microphone 对象报告任何状态信息时被调度；将使用 <codeph class="+ topic/ph pr-d/codeph ">statusHandler()</codeph> 方法捕获并跟踪此信息。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>必须将麦克风与计算机连接，此示例才能正常运行。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">

package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.media.Microphone;
    import flash.system.Security;

    public class MicrophoneExample extends Sprite {
        public function MicrophoneExample() {
            var mic:Microphone = Microphone.getMicrophone();
            Security.showSettings("2");
            mic.setLoopBack(true);
                    
            if (mic != null) {
                mic.setUseEchoSuppression(true);
                mic.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
                mic.addEventListener(StatusEvent.STATUS, statusHandler);
            }
        }

        private function activityHandler(event:ActivityEvent):void {
            trace("activityHandler: " + event);
        }

        private function statusHandler(event:StatusEvent):void {
            trace("statusHandler: " + event);
        }
    }
}
</codeblock></example></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.events.xml#SampleDataEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.SampleDataEvent</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.media:Microphone_flash.events.ActivityEvent.ACTIVITY_activity" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">activity</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><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.ActivityEvent.ACTIVITY</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ActivityEvent</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 ">activating</codeph> 属性值为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 的此事件所需的音量，或者指定在没有声音的情况下经过多长时间才会触发 <codeph class="+ topic/ph pr-d/codeph ">activating</codeph> 属性值为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph> 的此事件，请使用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph>。
 </p>
 <p class="- topic/p ">要使 Microphone 对象调度 activity 事件，应用程序必须通过调用 <codeph class="+ topic/ph pr-d/codeph ">setLoopback( true )</codeph> 或侦听 sampleData 事件或者将麦克风附加到 NetStream 对象来监视输入。</p>
 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/setSilenceLevel()" class="- topic/link "><linktext class="- topic/linktext ">setSilenceLevel()</linktext></link></related-links></adobeApiEvent><apiOperation id="flash.media:Microphone:getEnhancedMicrophone" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">getEnhancedMicrophone</apiName><shortdesc class="- topic/shortdesc ">
	 返回对可以执行回音消除功能的增强的 Microphone 对象的引用。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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><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 "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对用于捕获音频的 Microphone 对象的引用。如果增强的音频初始化失败，则返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
	 </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:Microphone</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">index</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 ">麦克风的索引值。
	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 返回对可以执行回音消除功能的增强的 Microphone 对象的引用。使用回音消除功能可创建不需要耳机的音频/视频聊天应用程序。
	 
	 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">Microphone.getEnhancedMicrophone()</codeph> 方法和 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph> 方法的 <codeph class="+ topic/ph pr-d/codeph ">index</codeph> 参数的工作方式相同。</p>
	 
	 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">重要说明：</b>在任何给定时间，您只能具有单个增强麦克风设备实例。所有其他 Microphone 实例都将停止提供音频数据，并且将收到 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">Microphone.Unavailable</codeph> 的 <codeph class="+ topic/ph pr-d/codeph ">StatusEvent</codeph>。当增强的音频初始化失败时，调用此方法将返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，为 <codeph class="+ topic/ph pr-d/codeph ">Microphone.enhancedOptions</codeph> 设置值没有效果，并且所有现有 Microphone 实例的工作方式保持不变。</p>
	 
	 <p class="- topic/p ">若要配置增强的 Microphone 对象，请设置 <codeph class="+ topic/ph pr-d/codeph ">Microphone.enhancedOptions</codeph> 属性。下面的代码在本地测试中使用增强的 Microphone 对象和全双工回音消除功能：</p>
	 
	 <pre xml:space="preserve" class="- topic/pre ">
	     var mic:Microphone = Microphone.getEnhancedMicrophone();
	     var options:MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions();
	     options.mode = MicrophoneEnhancedMode.FULL_DUPLEX;
	     mic.enhancedOptions = options;
	     mic.setLoopBack(true);
	 </pre>
	 
	 <p class="- topic/p ">在使用回音消除功能时，将忽略 <codeph class="+ topic/ph pr-d/codeph ">setUseEchoSuppression()</codeph> 方法。
	 </p>
	 
	 <p class="- topic/p ">
	 当 SWF 文件尝试访问 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getEnhancedMicrophone()</codeph> 返回的对象时（例如，在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachAudio()</codeph> 时），Flash Player 将显示“隐私”对话框，用户可从中选择是允许还是拒绝访问麦克风。（确保舞台大小至少为 215 x 138 个像素；这是 Flash Player 显示该对话框所需的最小大小。）
	 </p>
	 
	 
	 </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/getMicrophone()" class="- topic/link "><linktext class="- topic/linktext ">Microphone.getMicrophone()</linktext></link><link href="flash.media.xml#Microphone/enhancedOptions" class="- topic/link "><linktext class="- topic/linktext ">Microphone.enhancedOptions</linktext></link><link href="flash.media.xml#Microphone/event:status" class="- topic/link "><linktext class="- topic/linktext ">Microphone.status</linktext></link></related-links></apiOperation><apiOperation id="flash.media:Microphone:getMicrophone" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">getMicrophone</apiName><shortdesc class="- topic/shortdesc ">
	 
	 返回对用于捕获音频的 Microphone 对象的引用。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Microphone, Microphone.getMicropone, getMicrophone
	 
	 </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 "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">对用于捕获音频的 Microphone 对象的引用。
	 
 	 </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:Microphone</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">index</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 ">麦克风的索引值。
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 
	 返回对用于捕获音频的 Microphone 对象的引用。要开始捕获音频，您必须将 Microphone 对象附加到 NetStream 对象（请参阅 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachAudio()</codeph>）。
	 
	 <p class="- topic/p ">
	 多个对 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph> 的调用引用相同的麦克风。因此，如果您的代码包含 <codeph class="+ topic/ph pr-d/codeph ">mic1 = Microphone.getMicrophone()</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">mic2 = Microphone.getMicrophone()</codeph> 行，那么 <codeph class="+ topic/ph pr-d/codeph ">mic1</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">mic2</codeph> 都会引用相同的（默认）麦克风。</p>
	 
	 <p class="- topic/p ">
	 通常，不应传递 <codeph class="+ topic/ph pr-d/codeph ">index</codeph> 的值。只需调用 <codeph class="+ topic/ph pr-d/codeph ">air.Microphone.getMicrophone()</codeph> 即可返回对默认麦克风的引用。使用 Flash Player 设置面板的“麦克风设置”部分，用户可以指定应用程序应该使用的默认麦克风。（用户通过右键单击在 Web 浏览器中运行的 Flash Player 内容来访问 Flash Player 设置面板。）如果您为 <codeph class="+ topic/ph pr-d/codeph ">index</codeph> 传递一个值，您可以引用与用户选择的麦克风不同的麦克风。在极少数情况下（例如，应用程序同时从两个麦克风捕获音频），您可能会使用 <codeph class="+ topic/ph pr-d/codeph ">index</codeph>。在 Adobe AIR 中运行的内容也使用默认麦克风的 Flash Player 设置。</p>
	 
	 <p class="- topic/p ">
	 使用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.index</codeph> 属性可以获取当前 Microphone 对象的索引值。然后，可以将该值传递给 Microphone 类的其他方法。
	 </p>
	 
	 <p class="- topic/p ">
	 当 SWF 文件尝试访问 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph> 返回的对象时（例如，在调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachAudio()</codeph> 时），Flash Player 将显示“隐私”对话框，用户可从中选择是允许还是拒绝访问麦克风。（确保舞台大小至少为 215 x 138 个像素；这是 Flash Player 显示该对话框所需的最小大小。）
	 </p>
	 
	 <p class="- topic/p ">
         当用户对此对话框做出响应时，将调度 <codeph class="+ topic/ph pr-d/codeph ">status</codeph> 事件以表示用户的响应。还可以检查 <codeph class="+ topic/ph pr-d/codeph ">Microphone.muted</codeph> 属性以确定用户是允许还是拒绝访问麦克风。 
	 </p>
	 
	 <p class="- topic/p ">
	 如果 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph> 返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则表明麦克风正由其它应用程序使用，或者系统上没有安装任何麦克风。要确定是否安装了任何麦克风，请使用 <codeph class="+ topic/ph pr-d/codeph ">Microphones.names.length</codeph>。要显示 Flash Player 的“麦克风设置”面板（用户可从中选择 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone</codeph> 所引用的麦克风），请使用 <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings()</codeph>。 
	 
	 </p>
	 
	 </apiDesc><example conref="examples\Microphone_getMicrophone.as" class="- topic/example "> 以下示例显示如何通过使用静态 Microphone.getMicrophone() 方法并侦听状态事件来请求对用户麦克风的访问权限。<xref href="http://actionscriptexamples.com/2008/12/04/detecting-the-microphone-in-flash-using-actionscript-30/" scope="_mmexternal" class="- topic/xref ">ActionScriptExamples.com</xref> 提供的示例。 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var mic:Microphone = Microphone.getMicrophone();
mic.setLoopBack();
mic.addEventListener(StatusEvent.STATUS, mic_status);
 
var tf:TextField = new TextField();
tf.autoSize = TextFieldAutoSize.LEFT;
tf.text = "Detecting microphone...";
addChild(tf);
 
function mic_status(evt:StatusEvent):void {
    tf.text = "Microphone is muted?: " + mic.muted;
    switch (evt.code) {
        case "Microphone.Unmuted":
            tf.appendText("\n" + "Microphone access was allowed.");
            break;
        case "Microphone.Muted":
            tf.appendText("\n" + "Microphone access was denied.");
            break;
    }
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/event:status" class="- topic/link "><linktext class="- topic/linktext ">Microphone.status</linktext></link><link href="flash.net.xml#NetStream/attachAudio()" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.attachAudio()</linktext></link><link href="flash.system.xml#Security/showSettings()" class="- topic/link "><linktext class="- topic/linktext ">flash.system.Security.showSettings()</linktext></link></related-links><adobeApiEvent id="flash.media:Microphone:getMicrophone_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 ">code</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">"Microphone.Muted"</codeph>，则表示用户拒绝 SWF 文件访问其麦克风。如果 <codeph class="+ topic/ph pr-d/codeph ">code</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">"Microphone.Unmuted"</codeph>，则表示用户允许 SWF 文件访问其麦克风。
	 
	 </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">在麦克风报告其状态时调度。</shortdesc></adobeApiEvent></apiOperation><apiOperation id="flash.media:Microphone:setLoopBack" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">setLoopBack</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>Document this better with 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 ">state</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">true</apiData></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 将麦克风捕获的音频传送到本地扬声器。
	 
	 </apiDesc></apiOperationDetail></apiOperation><apiOperation id="flash.media:Microphone:setSilenceLevel" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">setSilenceLevel</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 ">Microphone, audio, sound, Microphone.setSilenceLevel, setSilenceLevel
	 </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 ">silenceLevel</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">激活麦克风并调度 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件所需的音量。可接受值的范围为 0 到 100。 
	 
	 </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">timeout</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 ">在没有活动的情况下经过的毫秒数，必须经过这么长的时间，Flash Player 或 Adobe AIR 才会认为声音已停止并调度 <codeph class="+ topic/ph pr-d/codeph ">dispatch</codeph> 事件。默认值为 2000（2 秒）。(<b class="+ topic/ph hi-d/b ">注意：</b>在签名中显示的默认值 -1 是一个内部值，用于表示 Flash Player 或 Adobe AIR 使用 2000。）
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 设置可认定为有声的最低音量输入水平，以及实际静音前需经历的无声时间长度（可选）。
	 <ul class="- topic/ul "><li class="- topic/li ">要完全禁止麦克风检测声音，请为 <codeph class="+ topic/ph pr-d/codeph ">silenceLevel</codeph> 传递值 100；这样就决不会再调度 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件了。 </li><li class="- topic/li ">要确定麦克风当前所检测的音量，请使用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.activityLevel</codeph>。 </li></ul>
	 
	 <p class="- topic/p ">Speex 具有语音活动检测功能 (VAD)，在未检测到语音时将自动减小带宽。使用 Speex 编解码器时，Adobe 建议将静音级别设置为 0。</p>
	 
	 <p class="- topic/p ">活动检测是检测声音级别在何时表示某人正在谈话的功能。当某人没有谈话时，由于不需要发送关联的音频流，因此可以节约带宽。此信息也可用于视频反馈，以便让用户知道他们（或其它人）没有谈话。</p>
	 
	 <p class="- topic/p ">静音值与活动值直接对应。完全静音对应于活动值 0。持续噪音（根据当前增益设置可以检测到的噪音）对应于活动值 100。当增益得到适当调整之后，在您没有说话时，活动值将小于静音值；在您说话时，活动值将大于静音值。</p>
	 
	 <p class="- topic/p ">此方法与 <codeph class="+ topic/ph pr-d/codeph ">Camera.setMotionLevel()</codeph> 类似；这两种方法都用于指定何时调度 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件。不过，这两种方法在对发布流的影响上具有显著的差异：</p>
	 
	 <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">Camera.setMotionLevel()</codeph> 设计用于检测运动，并且不影响带宽用量。即使视频流未检测到运动，仍将发送视频。</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> 设计用于优化带宽。在认为音频流被静音时，不发送任何音频数据。而改为发送一条表示静音已启动的消息。 </li></ul>
	 
	 </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/setMotionLevel()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Camera.setMotionLevel()</linktext></link><link href="flash.media.xml#Microphone/activityLevel" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.activityLevel</linktext></link><link href="flash.media.xml#Microphone/event:activity" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.activity</linktext></link><link href="flash.media.xml#Microphone/gain" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.gain</linktext></link><link href="flash.media.xml#Microphone/silenceLevel" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.silenceLevel</linktext></link><link href="flash.media.xml#Microphone/silenceTimeout" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.silenceTimeout</linktext></link></related-links></apiOperation><apiOperation id="flash.media:Microphone:setUseEchoSuppression" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">setUseEchoSuppression</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 ">Microphone, audio, sound, Microphone.setUseEchoSuppression, setUseEchoSuppression
	 </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 ">useEchoSuppression</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 Boolean 值，表示是使用回音抑制 (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>) 还是不使用该功能 (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>)。 	 
	 
	 </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 指定是否使用音频编解码器的回音抑制功能。除非用户已经在 Flash Player 的“麦克风设置”面板中选择了“降低回音”，否则默认值为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
	 
	 <p class="- topic/p ">回音抑制是指降低音频回馈效果，当扬声器发出的声音由同一系统上的麦克风拾取时，将导致音频回馈。（这不同于回音消除，后者会完全移除反馈。在调用 <codeph class="+ topic/ph pr-d/codeph ">getEnhancedMicrophone()</codeph> 方法以使用回音消除功能时，将忽略 <codeph class="+ topic/ph pr-d/codeph ">setUseEchoSuppression()</codeph> 方法。）</p>
	 
	 <p class="- topic/p ">通常情况下，当通过扬声器（而不是耳机）播放所捕获的声音时，建议使用回音抑制。如果您的 SWF 文件允许用户指定声音输出设备，则当他们指定使用扬声器并且还将使用麦克风时，您可能需要调用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.setUseEchoSuppression(true)</codeph>。 </p>
	 
	 <p class="- topic/p ">用户也可以在 Flash Player 的“麦克风设置”面板中调整这些设置。</p>
	 
	 </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/setUseEchoSuppression()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.setUseEchoSuppression()</linktext></link><link href="flash.media.xml#Microphone/useEchoSuppression" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.useEchoSuppression</linktext></link></related-links></apiOperation><apiValue id="flash.media:Microphone:activityLevel: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 ">activityLevel</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 ">Microphone, audio, sound, Microphone.activityLevel, activityLevel
	 </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 ">
	 麦克风正在检测的音量。值的范围为 0（未检测到声音）到 100（检测到非常大的声音）。此属性的值有助于确定向 <codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> 方法传递的适当值。
	 
	 <p class="- topic/p ">如果麦克风 <codeph class="+ topic/ph pr-d/codeph ">muted</codeph> 属性为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，此属性的值始终为 -1。</p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/getMicrophone()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.getMicrophone()</linktext></link><link href="flash.media.xml#Microphone/setSilenceLevel()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.setSilenceLevel()</linktext></link><link href="flash.media.xml#Microphone/gain" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.gain</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone:codec: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 ">codec</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 ">Microphone, audio, sound, Microphone.getCodec, getCodec
	 </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 ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 用于压缩音频的编解码器。可用编解码器为 Nellymoser（默认值）和 Speex。枚举类 <codeph class="+ topic/ph pr-d/codeph ">SoundCodec</codeph> 包含各种对 <codeph class="+ topic/ph pr-d/codeph ">codec</codeph> 属性有效的值。
	 
	 <p class="- topic/p ">如果使用 Nellymoser 编解码器，可使用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.rate()</codeph> 设置采样率。如果使用 Speex 编解码器，则采样率会设置为 16 kHz。</p>
	 
	 <p class="- topic/p ">Speex 具有语音活动检测功能 (VAD)，在未检测到语音时将自动减小带宽。使用 Speex 编解码器时，Adobe 建议将静音级别设置为 0。要设置静音级别，请使用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> 方法。</p>
	 
	 
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/setSilenceLevel()" class="- topic/link "><linktext class="- topic/linktext ">setSilenceLevel()</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone:enableVAD: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 ">enableVAD</apiName><shortdesc class="- topic/shortdesc ">
	 启用 Speex 语音活动检测。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Microphone, audio, sound,
	 </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 ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 启用 Speex 语音活动检测。 
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:Microphone:encodeQuality: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 ">encodeQuality</apiName><shortdesc class="- topic/shortdesc ">
	 使用 Speex 编解码器时的编码语音品质。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Microphone, audio, sound,
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 使用 Speex 编解码器时的编码语音品质。可能值为从 0 到 10 的值。默认值为 6。数字越大，表示品质越高，但需要更多的带宽，如下表所示。列出的比特率值表示净比特率，并不包括信息分包开销。
	 <p class="- topic/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 ">所需的比特率（KB/秒）</entry></row></thead><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry ">0</entry><entry class="- topic/entry "> 3.95</entry></row><row class="- topic/row "><entry class="- topic/entry ">1</entry><entry class="- topic/entry ">5.75</entry></row><row class="- topic/row "><entry class="- topic/entry ">2</entry><entry class="- topic/entry ">7.75</entry></row><row class="- topic/row "><entry class="- topic/entry ">3</entry><entry class="- topic/entry ">9.80</entry></row><row class="- topic/row "><entry class="- topic/entry ">4</entry><entry class="- topic/entry ">12.8</entry></row><row class="- topic/row "><entry class="- topic/entry ">5</entry><entry class="- topic/entry ">16.8</entry></row><row class="- topic/row "><entry class="- topic/entry ">6</entry><entry class="- topic/entry ">20.6</entry></row><row class="- topic/row "><entry class="- topic/entry ">7</entry><entry class="- topic/entry ">23.8</entry></row><row class="- topic/row "><entry class="- topic/entry ">8</entry><entry class="- topic/entry ">27.8</entry></row><row class="- topic/row "><entry class="- topic/entry ">9</entry><entry class="- topic/entry ">34.2</entry></row><row class="- topic/row "><entry class="- topic/entry ">10</entry><entry class="- topic/entry ">42.2</entry></row></tbody></tgroup></adobetable>
	 </p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/codec" class="- topic/link "><linktext class="- topic/linktext ">codec</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone:enhancedOptions: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 ">enhancedOptions</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="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">flash.media:MicrophoneEnhancedOptions</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">	
	 控制增强的麦克风选项。有关详细信息，请参阅 <codeph class="+ topic/ph pr-d/codeph ">MicrophoneEnhancedOptions</codeph> 类。对于非增强的 Microphone 实例，此属性被忽略。
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#MicrophoneEnhancedOptions" class="- topic/link "><linktext class="- topic/linktext ">flash.media.MicrophoneEnhancedOptions</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone:framesPerPacket: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 ">framesPerPacket</apiName><shortdesc class="- topic/shortdesc ">
	 在一个包（消息）中传输的 Speex 语音帧的数目。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Microphone, audio, sound,
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 在一个包（消息）中传输的 Speex 语音帧的数目。每帧长 20 ms。默认值为每个包两帧。
	 
	 <p class="- topic/p ">消息中包含的 Speex 帧越多，需要的带宽就越小，但发送消息延迟的时间就越长。Speex 帧越少，需要的带宽就越大，而延迟的时间就会越短。</p>
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:Microphone:gain: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 ">gain</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 ">Microphone, audio, sound, Microphone.gain, gain
	 </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 ">
	 麦克风放大信号的程度。有效值为 0 到 100。默认值为 50。
	 
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/gain" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.gain</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone:index: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 ">index</apiName><shortdesc class="- topic/shortdesc ">
	 麦克风的索引，它反映在 Microphone.names 返回的数组中。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Microphone, audio, sound, Microphone.index, index
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 麦克风的索引，它反映在 <codeph class="+ topic/ph pr-d/codeph ">Microphone.names</codeph> 返回的数组中。
	 
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/getMicrophone()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.getMicrophone()</linktext></link><link href="flash.media.xml#Microphone/names" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.names</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone: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 ">
    如果当前平台支持 Microphone 类，则 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 ">
    如果当前平台支持 Microphone 类，则 <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.media:Microphone:muted: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 ">muted</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="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Microphone, audio, sound, Microphone.muted, muted
	 </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 ">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>)。当该值发生变化时，将调度 <codeph class="+ topic/ph pr-d/codeph ">status</codeph> 事件。有关详细信息，请参阅 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph>。 
	 
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/getMicrophone()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.getMicrophone()</linktext></link><link href="flash.media.xml#Microphone/event:status" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.status</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone: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 "><keyword class="- topic/keyword ">Microphone, audio, sound, Microphone.name, name
	 </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 ">
	 当前声音捕获设备的名称，它由声音捕获硬件返回。
	 
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/getMicrophone()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.getMicrophone()</linktext></link><link href="flash.media.xml#Microphone/names" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.names</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone:names: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 ">names</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 ">Microphone, audio, sound, Microphone.names, names
	 </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 "/><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 ">Array</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 包含所有可用声音捕获设备名称的字符串数组。返回名称，但不必向用户显示 Flash Player 的“专用设置”面板。此数组通过 <codeph class="+ topic/ph pr-d/codeph ">Microphone.names.length</codeph> 属性提供每个声音捕获设备的从零开始的索引和系统上声音捕获设备的数量。有关详细信息，请参阅 Array 类条目。
	 
	 <p class="- topic/p ">调用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.names</codeph> 要求全面检查硬件，并可能需要几秒钟时间才能生成数组。大多数情况下，使用默认麦克风即可。</p>
	 
	 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>要确定当前麦克风的名称，请使用 <codeph class="+ topic/ph pr-d/codeph ">name</codeph> 属性。</p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="#Array" class="- topic/link "><linktext class="- topic/linktext ">Array</linktext></link><link href="flash.media.xml#Microphone/name" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.name</linktext></link><link href="flash.media.xml#Microphone/getMicrophone()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.getMicrophone()</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone:noiseSuppressionLevel: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 ">noiseSuppressionLevel</apiName><shortdesc class="- topic/shortdesc ">
	 Speex 编码器使用的最大噪音衰减分贝数（负数）。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Microphone, audio, sound,
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 Speex 编码器使用的最大噪音衰减分贝数（负数）。如果启用，则在从 Microphone 捕获的声音进行 Speex 压缩之前应用噪音抑制。设置为 0 以禁用噪音抑制。默认启用噪音抑制，最大衰减为 -30 dB。选择 Nellymoser 编解码器时被忽略。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:Microphone:rate: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 ">rate</apiName><shortdesc class="- topic/shortdesc ">
	 麦克风捕获声音时使用的速率，单位是 kHz。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Microphone, audio, sound, Microphone.rate, rate
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 麦克风捕获声音时使用的速率，单位是 kHz。可接受的值为 5、8、11、22 和 44。如果您的声音捕获设备支持 8 kHz，则默认值为 8 kHz。否则，默认值是您的声音捕获设备支持的高于 8 kHz 的下一个可用捕获级别，通常为 11 kHz。
	 
	 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>实际速率与下表中注明的 <codeph class="+ topic/ph pr-d/codeph ">rate</codeph> 值稍有不同：</p>
	 
	 <adobetable class="+ topic/table adobe-d/adobetable "><tgroup cols="2" class="- topic/tgroup "><thead class="- topic/thead "><row class="- topic/row "><entry class="- topic/entry "><codeph class="+ topic/ph pr-d/codeph ">rate</codeph> 值</entry><entry class="- topic/entry ">实际频率</entry></row></thead><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry ">44</entry><entry class="- topic/entry ">44,100 Hz</entry></row><row class="- topic/row "><entry class="- topic/entry ">22</entry><entry class="- topic/entry ">22,050 Hz</entry></row><row class="- topic/row "><entry class="- topic/entry ">11</entry><entry class="- topic/entry ">11,025 Hz</entry></row><row class="- topic/row "><entry class="- topic/entry ">8</entry><entry class="- topic/entry ">8,000 Hz</entry></row><row class="- topic/row "><entry class="- topic/entry ">5</entry><entry class="- topic/entry ">5,512 Hz</entry></row></tbody></tgroup></adobetable>
	 
	 
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/rate" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.rate</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone:silenceLevel: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 ">silenceLevel</apiName><shortdesc class="- topic/shortdesc ">
	 激活麦克风并调度 activity 事件所需的音量。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Microphone, audio, sound, Microphone.silenceLevel, silenceLevel
	 </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 ">activity</codeph> 事件所需的音量。默认值为 10。
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/gain" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.gain</linktext></link><link href="flash.media.xml#Microphone/setSilenceLevel()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.setSilenceLevel()</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone:silenceTimeout: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 ">silenceTimeout</apiName><shortdesc class="- topic/shortdesc ">
	 麦克风停止检测声音的时间和调度 activity 事件的时间之间相差的毫秒数。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Microphone, audio, sound, Microphone.silenceTimeout, silenceTimeout
	 </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 麦克风停止检测声音的时间和调度 <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> 事件的时间之间相差的毫秒数。默认值为 2000（2 秒）。
	 
	 <p class="- topic/p ">要设置此值，请使用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> 方法。</p>
	 
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/setSilenceLevel()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.setSilenceLevel()</linktext></link></related-links></apiValue><apiValue id="flash.media:Microphone: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 ">
	 在此麦克风对象处于环回模式时，控制它的声音。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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>Document this better with examples.
	 </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 ">flash.media:SoundTransform</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 在此麦克风对象处于环回模式时，控制它的声音。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:Microphone:useEchoSuppression: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 ">useEchoSuppression</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="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Microphone, audio, sound, Microphone.useEchoSuppression, useEchoSuppression
	 </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 ">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>。除非用户已经在 Flash Player 的“麦克风设置”面板中选择了“降低回音”，否则默认值为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。
	 
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/setUseEchoSuppression()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.setUseEchoSuppression()</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:StageVideo" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">StageVideo</apiName><shortdesc class="- topic/shortdesc ">
    StageVideo 对象使用设备的硬件加速功能（如果可用）以显示应用程序中的直播视频或录制视频。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "/><apiPlatform description="" name="Flash" version="10.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 ">
    StageVideo 对象使用设备的硬件加速功能（如果可用）以显示应用程序中的直播视频或录制视频。大部分设备上都有硬件加速功能。StageVideo 对象支持的视频格式与 Video 对象相同。有关这些格式的详细信息，请参阅 flash.net.NetStream 类。
    
    <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR 配置文件支持：</i>在 AIR 2.5 中，仅在运行用于电视的 AIR 的设备上支持此功能。有关在多个配置文件之间支持 API 的详细信息，请参阅 <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">AIR 配置文件支持</xref>。   
    </p>
       
    <p class="- topic/p ">StageVideo 对象显示的视频始终显示在舞台的矩形区域中，在所有 Flash 显示列表对象后面。因此，StageVideo 对象利用硬件加速，同时支持显示视频的大部分情形：覆盖有视频控件的矩形显示区域。</p>   
    
    
    <p class="- topic/p ">使用 StageVideo 对象比使用 Video 对象更好的方面是：</p>
    
    <p class="- topic/p "><ul class="- topic/ul "><li class="- topic/li ">由于使用了硬件加速，因此优化了视频播放性能。</li><li class="- topic/li ">减少了处理器和电量的使用。</li><li class="- topic/li ">开发内容的灵活性和创造性，如视频控件，显示在 StageVideo 对象前面。</li></ul></p>
      
    <p class="- topic/p ">由于 StageVideo 对象使用设备硬件功能，因此 StageVideo 对象与 Video 对象相比受到以下约束：</p>
    
    <p class="- topic/p "><ul class="- topic/ul "><li class="- topic/li ">视频显示区域只能是矩形。您无法使用更先进的显示区域，如椭圆形或不规则形状。</li><li class="- topic/li ">不能旋转 StageVideo 对象。</li><li class="- topic/li ">不能以位图形式缓存 StageVideo 对象，</li><li class="- topic/li ">不能使用 BitmapData 访问视频数据。</li><li class="- topic/li ">不能将视频嵌入 SWF 文件。只能将 StageVideo 对象与 NetStream 对象一起使用。</li><li class="- topic/li ">不能对 StageVideo 对象应用滤镜、混合模式或 alpha 值。</li><li class="- topic/li ">不能对 StageVideo 对象应用颜色转换、3D 转换或矩阵转换。</li><li class="- topic/li ">不能对 StageVideo 对象应用遮罩或 scale9Grid。</li><li class="- topic/li ">应用于 StageVideo 对象之前的 display 对象的混合模式不会应用于 StageVideo 对象。</li><li class="- topic/li ">只能将 StageVideo 对象放置在全像素边界上。</li><li class="- topic/li ">对于每个 SWF 文件，Flash Player 将可同时显示视频的 StageVideo 对象数限制为四个。但是，根据设备硬件资源，实际的限制可能更低。在用于电视的 AIR 设备上，一次只有一个 StageVideo 对象可以显示视频。</li><li class="- topic/li ">视频计时与运行时显示的 Flash 内容的计时不同步。</li><li class="- topic/li ">尽管视频演示是给定硬件设备的最佳可用模式，但不同设备并不能实现 100%“像素相同”。像素会因驱动程序和硬件的不同而略有差异。</li><li class="- topic/li ">有几种设备不支持所有必需的颜色空间。例如，有些设备不支持 BT.709，H.264 标准。在这样的情况下，您可以使用 BT.601 进行快速显示。</li><li class="- topic/li ">您不能将舞台视频与 WMODE 设置一起使用，如 <codeph class="+ topic/ph pr-d/codeph ">normal</codeph>、<codeph class="+ topic/ph pr-d/codeph ">opaque</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">transparent</codeph>。当不处于全屏模式时，舞台视频只支持 <codeph class="+ topic/ph pr-d/codeph ">WMODE=direct</codeph>。WMODE 在 Safari 4 或更高版本、IE 9 或更高版本或用于电视的 AIR 中无效。</li></ul></p>
    
    <p class="- topic/p ">下列步骤总结了如何使用 StageVideo 对象来播放视频：</p>
    
    <p class="- topic/p "><ol class="- topic/ol "><li class="- topic/li ">侦听 StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY 事件以了解 Stage.stageVideos 矢量何时更改。（不支持 AIR 2.5 for TV。） </li><li class="- topic/li ">如果 StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY 事件报告舞台视频可用，则在事件处理函数中使用 <codeph class="+ topic/ph pr-d/codeph ">Stage.stageVideos</codeph> 矢量对象来访问 StageVideo 对象。在 AIR 2.5 for TV 中，呈现第一个 SWF 帧后，访问 <codeph class="+ topic/ph pr-d/codeph ">Stage.stageVideos</codeph>。<b class="+ topic/ph hi-d/b ">注意：</b>您无法创建 StageVideo 对象。</li><li class="- topic/li ">使用 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.attachNetStream()</codeph> 连接 NetStream 对象。</li><li class="- topic/li ">使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 播放视频。</li><li class="- topic/li ">侦听 StageVideo 对象上的 <codeph class="+ topic/ph pr-d/codeph ">StageVideoEvent.RENDER_STATE</codeph> 事件，以确定播放视频的状态。收到此事件还说明，视频的宽度和高度属性已初始化或更改。 </li><li class="- topic/li ">侦听 Video 对象上的 <codeph class="+ topic/ph pr-d/codeph ">VideoEvent.RENDER_STATE</codeph> 事件。此事件提供与 StageVideoEvent.RENDER_STATE 相同的状态，因此您也可以使用它来确定 GPU 加速是否可用。收到此事件还说明，视频的宽度和高度属性已初始化或更改。（不支持 AIR 2.5 for TV。）</li></ol></p>
    
    
    <p class="- topic/p ">如果 <codeph class="+ topic/ph pr-d/codeph ">StageVideoEvent.RENDER_STATE</codeph> 事件表明视频无法显示，您可以恢复为使用 Video 对象，而不使用 StageVideo 对象。视频附加到 NetStream 对象并播放后调度此事件。此外，根据不同的平台，播放状态中的任何更改可能导致调度此事件。处理 <codeph class="+ topic/ph pr-d/codeph ">StageVideoEvent.RENDER_STATE</codeph> 事件以确保应用程序播放视频或不播放视频。
    </p>
    
    <p class="- topic/p ">如果运行的视频从不支持舞台视频的 WMODE 进入全屏模式，舞台视频可以变为可用。同样，如果用户退出全屏模式，舞台视频可以变为不可用。在这些情况下，Stage.stageVideos 矢量发生更改。要收到此更改的通知，请侦听 StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABITY 事件。<b class="+ topic/ph hi-d/b ">注意：</b>在 AIR 2.5 for TV 中不提供此通知。</p>
    </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.events.xml#StageVideoEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.StageVideoEvent</linktext></link><link href="flash.events.xml#StageVideoAvailabilityEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.StageVideoAvailabilityEvent</linktext></link><link href="flash.events.xml#VideoEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.VideoEvent</linktext></link><link href="flash.display.xml#Stage/stageVideos" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Stage.stageVideos</linktext></link><link href="flash.media.xml#Video" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Video</linktext></link><link href="flash.net.xml#NetStream" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream</linktext></link><link href="http://www.adobe.com/go/learn_as3_stageVideo_en" class="- topic/link "><linktext class="- topic/linktext ">将 StageVideo 类用于硬件加速呈现</linktext></link></related-links><adobeApiEvent id="flash.media:StageVideo_flash.events.StageVideoEvent.RENDER_STATE_renderState" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">renderState</apiName><shortdesc class="- topic/shortdesc ">
	 StageVideo 对象的呈现状态变化后，被 StageVideo 对象调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "/><apiPlatform description="" name="Flash" version="10.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.StageVideoEvent.RENDER_STATE</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.StageVideoEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 StageVideo 对象的呈现状态变化后，被 StageVideo 对象调度。
	 
	 </apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.media:StageVideo:attachNetStream" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">attachNetStream</apiName><shortdesc class="- topic/shortdesc ">
        指定要在应用程序中 StageVideo 对象的边界内显示的视频流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "/><apiPlatform description="" name="Flash" version="10.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 ">netStream</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:NetStream</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 NetStream 对象。要切断与该 StageVideo 对象的连接，请传递 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
        </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
        指定要在应用程序中 StageVideo 对象的边界内显示的视频流。视频流或者是通过 NetStream.play() 播放的视频文件，或者为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。视频文件可以存储在本地文件系统或 Flash Media Server 上。如果 <codeph class="+ topic/ph pr-d/codeph ">netStream</codeph> 参数的值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则视频不会再在 StageVideo 对象中播放。
        
        
        <p class="- topic/p ">再次调用 <codeph class="+ topic/ph pr-d/codeph ">attachNetStream()</codeph> 之前，调用当前连接的 NetStream 对象的 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 方法。 调用 <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> 会释放所有资源，包括硬件解码器，有关播放视频方面。然后，可以调用带有另一个 NetStream 对象或 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 的 <codeph class="+ topic/ph pr-d/codeph ">attachNetStream()</codeph>。</p>
        
        <p class="- topic/p ">
        如果视频文件仅包含音频，您无需使用此方法；当您调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 时，视频文件的音频部分会自动播放。 要控制与视频文件相关联的音频，请使用用于播放视频文件的 NetStream 对象的 <codeph class="+ topic/ph pr-d/codeph ">soundTransform</codeph> 属性。
        </p>        
        
        </apiDesc></apiOperationDetail></apiOperation><apiValue id="flash.media:StageVideo:colorSpaces: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 ">colorSpaces</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.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.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 "/><apiType value="Vector$String" name="type" class="- topic/state reference/state apiRef/apiType "/></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
        返回此视频表面可用色彩空间的名称。通常，此列表包括“BT.601”和“BT.709”。有些配置中仅支持“BT.601”，这表示视频可能没有呈现在正确的色彩空间中。
		
		<p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在用于电视的 AIR 设备上，“BT.601”值表示软件播放，“BT.709”值表示硬件播放。 </p>
		
        </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageVideo:depth: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 ">depth</apiName><shortdesc class="- topic/shortdesc ">
        StageVideo 对象的深度级别与其他 StageVideo 对象相关。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "/><apiPlatform description="" name="Flash" version="10.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><apiTipTexts><apiTipText class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiTipText ">StageVideo 对象的深度与其他 StageVideo 对象相关。
		</apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
        StageVideo 对象的深度级别与其他 StageVideo 对象相关。
		
		<p class="- topic/p ">StageVideo 对象始终显示在舞台上其他对象后面。如果平台支持多个 StageVideo 对象，<codeph class="+ topic/ph pr-d/codeph ">depth</codeph> 属性表示 StageVideo 对象的深度级别。底部 StageVideo 对象的 <codeph class="+ topic/ph pr-d/codeph ">depth</codeph> 属性具有最小值。如果多个 StageVideo 对象具有相同的深度设置，它们显示在 <codeph class="+ topic/ph pr-d/codeph ">stage,stageVideos</codeph> 矢量中的顺序决定了它们的相对深度。</p>	
		
        <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b> AIR for TV 设备仅支持一个 StageVideo 对象。因此，此属性不适用于这些设备。它是将来支持其他设备的占位符。</p> 
		
        </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.display.xml#Stage/stageVideos" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Stage.stageVideos</linktext></link></related-links></apiValue><apiValue id="flash.media:StageVideo:pan: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 ">pan</apiName><shortdesc class="- topic/shortdesc ">
        显示视频的平移设置，指定为 Point 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "/><apiPlatform description="" name="Flash" version="10.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.geom:Point</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Point 值无效。
		
		</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</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 ">
        显示视频的平移设置，指定为 Point 对象。 
        
        <p class="- topic/p ">默认情况下，<codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 值为 <codeph class="+ topic/ph pr-d/codeph ">(0,0)</codeph>。此默认值将视频置于 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 指定的矩形的中心。</p>
		
		<p class="- topic/p ">仅当 <codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 属性值为非默认值 <codeph class="+ topic/ph pr-d/codeph ">(1.0, 1.0)</codeph> 时，<codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 值很大。当视频以默认 <codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 值显示在 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形中时，平台会调整视频大小，使其适合矩形尺寸。因此，整个视频都是可见的。然后，如果指定了缩放系数，整个视频不一定可见。在此情况下，您可以设置 <codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 值来指定哪个视频的子矩形显示在 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形中。</p>
		
		<p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 属性的有效值范围是从 <codeph class="+ topic/ph pr-d/codeph ">(-1.0, -1.0)</codeph> 到 <codeph class="+ topic/ph pr-d/codeph ">(1.0, 1.0)</codeph>。具体是：</p>
		
		<p class="- topic/p "><ul class="- topic/ul "><li class="- topic/li ">
		<codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 值 <codeph class="+ topic/ph pr-d/codeph ">(-1.0, -1.0)</codeph> 将视频的左上角像素放置到 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形的左上角位置。
		</li><li class="- topic/li ">
		<codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 值 <codeph class="+ topic/ph pr-d/codeph ">(1.0, 1.0)</codeph> 将视频的右下角位置放置到 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形的右下角位置。
		</li><li class="- topic/li ">
		<codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 值 <codeph class="+ topic/ph pr-d/codeph ">(1.0, -1.0)</codeph> 将视频的右上角像素放置到 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形的右上角位置。
		</li><li class="- topic/li ">
		<codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 值 <codeph class="+ topic/ph pr-d/codeph ">(-1.0, 1.0)</codeph> 将视频的左下角像素放置到 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形的左下角位置。
		</li></ul>
		</p>
		
		<p class="- topic/p ">值 -1.0 到 1.0 之间根据比例平移。</p>
        
        <p class="- topic/p ">如果将 <codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 属性设置为有效范围之外的值，将引发 <codeph class="+ topic/ph pr-d/codeph ">RangeError</codeph> 意外。运行时将值重置为上一个有效值。</p>
        
        <p class="- topic/p ">另外，考虑到要使用 StageVideo 对象，将 <codeph class="+ topic/ph pr-d/codeph ">Stage.stageVideos</codeph> 矢量对象的元素调度给 StageVideo 变量。设置 StageVideo 变量的 <codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 属性时，底层 <codeph class="+ topic/ph pr-d/codeph ">Stage.stageVideos</codeph> 矢量元素也会更改。如果后来将该元素调度给另一个 StageVideo 变量以播放另一段视频，则会重置 <codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 属性。</p>
        
        </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#StageVideo/zoom" class="- topic/link "><linktext class="- topic/linktext ">缩放</linktext></link></related-links></apiValue><apiValue id="flash.media:StageVideo:videoHeight: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 ">videoHeight</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.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.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 ">您可能需要使用此属性，例如，为了确保用户以捕获时的相同高度观看视频，而无论 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形的大小如何。</p>		
		
        </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageVideo:videoWidth: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 ">videoWidth</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.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.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 ">您可能需要使用此属性，例如，为了确保用户以捕获时的相同宽度观看视频，而无论 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形的大小如何。</p>		
		
        </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageVideo:viewPort: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 ">viewPort</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.5" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Flash" version="10.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.geom:Rectangle</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 ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
        以像素表示的视频表面的绝对位置和大小。
        
        <p class="- topic/p ">视频的位置与舞台的左上角相关。</p>
        
        <p class="- topic/p ">
        <codeph class="+ topic/ph pr-d/codeph ">viewPort</codeph> 矩形队对象的 <codeph class="+ topic/ph pr-d/codeph ">x</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">y</codeph> 属性的有效范围是 -8192 至 8191。所以，您可以将视频完全或部分偏移舞台。如果将 <codeph class="+ topic/ph pr-d/codeph ">viewPort</codeph> 属性的 <codeph class="+ topic/ph pr-d/codeph ">width</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">height</codeph> 属性设置为大于舞台，您也可以使视频大于舞台。</p>
        
        </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:StageVideo:zoom: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 ">zoom</apiName><shortdesc class="- topic/shortdesc ">
        视频的缩放设置，指定为 Point 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "/><apiPlatform description="" name="Flash" version="10.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.geom:Point</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Point 值无效。
		
		</apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">RangeError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">RangeError</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 ">
        视频的缩放设置，指定为 Point 对象。 
        
        <p class="- topic/p ">缩放点为比例因子。默认情况下，<codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 值为 <codeph class="+ topic/ph pr-d/codeph ">(1.0, 1.0)</codeph>。此默认值将整个视频显示在 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形中。</p>
        
	    <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 属性的有效值范围为 <codeph class="+ topic/ph pr-d/codeph ">(1.0, 1.0)</codeph> 到 <codeph class="+ topic/ph pr-d/codeph ">(16.0, 16.0)</codeph>。缩放 Point 对象的 <codeph class="+ topic/ph pr-d/codeph ">x</codeph> 属性指定了水平像素的缩放值，y 属性指定垂直像素的缩放值。</p>
		
		<p class="- topic/p ">例如，<codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 值 <codeph class="+ topic/ph pr-d/codeph ">(2.0, 2.0)</codeph> 在 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形中仅显示一半水平像素和一半垂直像素。即，视频仍然在 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形内，但是仅有一半视频可见，形成了 2 倍的缩放效果。类似地，<codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 值 <codeph class="+ topic/ph pr-d/codeph ">(16.0, 16.0)</codeph> 在 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形中仅显示水平像素的 1/16 和垂直像素的 1/16，放大到了最大 16 倍。</p>
		
		<p class="- topic/p ">您设置 <codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 属性时，请设置 <codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 属性，以使 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形显示视频的适当子矩形。</p>
		
		<p class="- topic/p ">考虑下列情形，将 <codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> Point 对象的 <codeph class="+ topic/ph pr-d/codeph ">x</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">y</codeph> 属性设置为不同的值很有用。首先，注意当视频以默认 <codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 值显示在 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形中时，平台会调整视频大小以正好适应矩形大小。如果视频的矩形不能均匀缩放到 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形大小，则视频显示可能扭曲。即，视频的高宽比以及 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 不相等。此情况可能在以下情形出现：例如，如果视频的宽度和高度不同，但是 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 属性指定了一个正方形。为了解决扭曲变形问题，为 <codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> Point 对象的 <codeph class="+ topic/ph pr-d/codeph ">x</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">y</codeph> 属性设置不同的值。然后设置 <codeph class="+ topic/ph pr-d/codeph ">pan</codeph> 属性，以确保 <codeph class="+ topic/ph pr-d/codeph ">StageVideo.viewPort</codeph> 矩形显示视频的适当子矩形。</p> 
        
        <p class="- topic/p ">如果将 <codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 属性设置为非有效范围内的一个值，则会引发 <codeph class="+ topic/ph pr-d/codeph ">RangeError</codeph> 意外。运行时将值重置为上一个有效值。</p>
        
        <p class="- topic/p ">另外，考虑到要使用 StageVideo 对象，将 <codeph class="+ topic/ph pr-d/codeph ">Stage.stageVideos</codeph> 矢量对象的元素调度给 StageVideo 变量。设置 StageVideo 变量的 <codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 属性时，底层 <codeph class="+ topic/ph pr-d/codeph ">Stage.stageVideos</codeph> 矢量元素也会更改。如果您后来将该元素调度给另一个 StageVideo 变量以播放另一个视频，请重置 <codeph class="+ topic/ph pr-d/codeph ">zoom</codeph> 属性。</p>       
		
		
        </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#StageVideo/pan" class="- topic/link "><linktext class="- topic/linktext ">平移</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:MicrophoneEnhancedOptions" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">MicrophoneEnhancedOptions</apiName><shortdesc class="- topic/shortdesc ">
 MicrophoneEnhancedOptions 类为增强的音频（回音消除）提供配置选项。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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><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 ">
 MicrophoneEnhancedOptions 类为增强的音频（回音消除）提供配置选项。回音消除功能使多位参与者无须使用耳机即可在音频/视频聊天应用程序中进行交流。 
 
 <p class="- topic/p ">若要使用回音消除功能，请调用 <codeph class="+ topic/ph pr-d/codeph ">Microphone.getEnhancedMicrophone()</codeph> 以获得对增强的 Microphone 对象的引用。将 <codeph class="+ topic/ph pr-d/codeph ">Microphone.enhancedOptions</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">MicrophoneEnhancedOptions</codeph> 类的实例。
 </p>
 
 </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone/enhancedOptions" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.enhancedOptions</linktext></link><link href="flash.media.xml#Microphone/getEnhancedMicrophone()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone.getEnhancedMicrophone()</linktext></link></related-links><apiValue id="flash.media:MicrophoneEnhancedOptions:autoGain: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 ">autoGain</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="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 ">
	 启用自动增益控制。将一种时间域自动增益控制算法与噪音去除功能配合使用。默认值为 off。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:MicrophoneEnhancedOptions:echoPath: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 ">echoPath</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="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 ">
	 指定用于回音消除的回音路径（单位为毫秒）。较长的回音路径可产生较好的回音消除效果。同时，较长的回音路径也导致较长的延迟，并且需要更高的计算复杂性。默认值为 128（建议值）。另一个可能的值为 256。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:MicrophoneEnhancedOptions:isVoiceDetected: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 ">isVoiceDetected</apiName><shortdesc class="- topic/shortdesc ">
	 表示 Microphone 输入是否检测到语音。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 表示 Microphone 输入是否检测到语音。
	 
	 <p class="- topic/p "> 可能的值包括：<codeph class="+ topic/ph pr-d/codeph ">-1</codeph>（未启用）、<codeph class="+ topic/ph pr-d/codeph ">0</codeph>（未检测到语音）、<codeph class="+ topic/ph pr-d/codeph ">1</codeph>（检测到语音）。
	 </p>
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:MicrophoneEnhancedOptions:mode: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 ">mode</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="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 ">
	 控制增强的麦克风模式。对于所有非 USB 麦克风，默认值为 <codeph class="+ topic/ph pr-d/codeph ">FULL_DUPLEX</codeph>。对于 USB 麦克风，默认值为 <codeph class="+ topic/ph pr-d/codeph ">HALF_DUPLEX</codeph>。有关可能的值及说明，请参阅 <codeph class="+ topic/ph pr-d/codeph ">MicrophoneEnhancedMode</codeph>。
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#MicrophoneEnhancedMode" class="- topic/link "><linktext class="- topic/linktext ">flash.media.MicrophoneEnhancedMode</linktext></link></related-links></apiValue><apiValue id="flash.media:MicrophoneEnhancedOptions:nonLinearProcessing: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 ">nonLinearProcessing</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="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>，此时将打开非线性处理。
	 
	 </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:Sound" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">Sound</apiName><shortdesc class="- topic/shortdesc ">
  Sound 类允许您在应用程序中使用声音。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><refpath>
   
   </refpath></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 ">
  Sound 类允许您在应用程序中使用声音。使用 Sound 类可以创建 Sound 对象、将外部 MP3 文件加载到该对象并播放该文件、关闭声音流，以及访问有关声音的数据，如有关流中字节数和 ID3 元数据的信息。可通过以下项对声音执行更精细的控制：声音源（声音的 SoundChannel 或 Microphone 对象）和 SoundTransform 类中用于控制向计算机扬声器输出声音的属性。 
  
  <p class="- topic/p ">在 Flash Player 10 及更高版本和 AIR 1.5 及更高版本中，也可以使用此类来处理动态生成的声音。在这种情况下，Sound 对象将使用向 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件处理函数分配的函数来轮询声音数据。从用声音数据填充的 ByteArray 对象检索声音的同时播放声音。可以使用 <codeph class="+ topic/ph pr-d/codeph ">Sound.extract()</codeph> 从 Sound 对象中提取声音数据，然后在将声音数据写回到流以进行播放之前可以对其进行操作。</p>
  
  <p class="- topic/p ">要控制嵌入到 SWF 文件的声音，请使用 SoundMixer 类中的属性。</p>
  
  <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意</b>：ActionScript 3.0 的 Sound API 与 ActionScript 2.0 不同。在 ActionScript 3.0 中，将无法采用声音对象并在层次结构中对其进行排列以控制其属性。</p>
  
  <p class="- topic/p ">在使用此类时，请考虑以下安全模型： </p>
  
  <ul class="- topic/ul "><li class="- topic/li ">如果执行调用的 文件在网络沙箱中，并且要加载的声音文件是本地文件，则不允许加载和播放声音。</li><li class="- topic/li ">默认情况下，若执行调用的文件是本地文件并且试图加载和播放远程声音，则不允许加载和播放声音。用户必须授予明确许可才能允许此类访问。</li><li class="- topic/li ">某些处理声音的操作受到限制。除非您实现了一个跨域策略文件，否则处于其它域的 文件无法访问已加载声音中的数据。受此限制约束的与声音相关的 API 为 <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph>、<codeph class="+ topic/ph pr-d/codeph ">SoundMixer.computeSpectrum()</codeph>、<codeph class="+ topic/ph pr-d/codeph ">SoundMixer.bufferTime</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">SoundTransform</codeph> 类。</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\SoundExample.as" class="- topic/example "> 以下示例显示有关打开并播放 MP3 文件时发生的声音事件的信息。要运行此示例，请将一个名为 MySound.mp3 的文件放在 SWF 文件所在的同一目录中。
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.events.*;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.net.URLRequest;

    public class SoundExample extends Sprite {
        private var url:String = "MySound.mp3";
        private var song:SoundChannel;

        public function SoundExample() {
            var request:URLRequest = new URLRequest(url);
            var soundFactory:Sound = new Sound();
            soundFactory.addEventListener(Event.COMPLETE, completeHandler);
            soundFactory.addEventListener(Event.ID3, id3Handler);
            soundFactory.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            soundFactory.addEventListener(ProgressEvent.PROGRESS, progressHandler);
            soundFactory.load(request);
            song = soundFactory.play();
        }

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

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

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

        private function progressHandler(event:ProgressEvent):void {
            trace("progressHandler: " + event);
        }
    }
}
</codeblock></example></apiClassifierDetail><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.media.xml#Microphone" class="- topic/link "><linktext class="- topic/linktext ">Microphone</linktext></link><link href="flash.media.xml#SoundChannel" class="- topic/link "><linktext class="- topic/linktext ">SoundChannel</linktext></link><link href="flash.media.xml#SoundMixer" class="- topic/link "><linktext class="- topic/linktext ">SoundMixer</linktext></link><link href="flash.media.xml#SoundTransform" class="- topic/link "><linktext class="- topic/linktext ">SoundTransform</linktext></link></related-links><adobeApiEvent id="flash.media:Sound_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 ">
 在加载操作进行过程中接收到数据时调度。
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound/load()" class="- topic/link "><linktext class="- topic/linktext ">load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.media:Sound_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.media.xml#Sound/load()" class="- topic/link "><linktext class="- topic/linktext ">load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.media:Sound_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.media.xml#Sound/load()" class="- topic/link "><linktext class="- topic/linktext ">load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.media:Sound_flash.events.Event.ID3_id3" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">id3</apiName><shortdesc class="- topic/shortdesc ">
 在存在可用于 MP3 声音的 ID3 数据时由 Sound 对象调度。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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.ID3</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 ">
 在存在可用于 MP3 声音的 ID3 数据时由 Sound 对象调度。 
 </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound/id3" class="- topic/link "><linktext class="- topic/linktext ">Sound.id3</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.media:Sound_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><related-links class="- topic/related-links "><link href="flash.media.xml#Sound/load()" class="- topic/link "><linktext class="- topic/linktext ">load()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.media:Sound_flash.events.SampleDataEvent.SAMPLE_DATA_sampleData" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">sampleData</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><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.SampleDataEvent.SAMPLE_DATA</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.SampleDataEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  在运行时请求新音频数据时调度。 
 
 </apiDesc><example conref="examples\Sound_SampleDataExample.as" class="- topic/example "> 下面的示例播放简单的正弦波。
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
var mySound:Sound = new Sound();
function sineWaveGenerator(event:SampleDataEvent):void {
    for ( var c:int=0; c&lt;8192; c++ ) {
        event.data.writeFloat(Math.sin((Number(c+event.position)/Math.PI/2))*0.25);
        event.data.writeFloat(Math.sin((Number(c+event.position)/Math.PI/2))*0.25);
    }
}

mySound.addEventListener(SampleDataEvent.SAMPLE_DATA,sineWaveGenerator);
mySound.play();
</codeblock></example></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound/extract()" class="- topic/link "><linktext class="- topic/linktext ">extract()</linktext></link><link href="flash.media.xml#Sound/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.events.xml#SampleDataEvent" class="- topic/link "><linktext class="- topic/linktext ">flash.events.SampleDataEvent</linktext></link></related-links></adobeApiEvent><apiConstructor id="flash.media:Sound:Sound" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">Sound</apiName><shortdesc class="- topic/shortdesc ">
     创建一个新的 Sound 对象。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><refpath>
      
      </refpath></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 "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">stream</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 "> 指向外部 MP3 文件的 URL。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">context</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:SoundLoaderContext</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 一个可选的 SoundLoader 上下文对象，可以定义缓冲时间（MP3 数据保留到 Sound 对象的缓冲区中所需的最小毫秒数）并且可以指定加载声音前应用程序是否应该检查跨域策略文件。
     
     </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建一个新的 Sound 对象。如果将有效的 URLRequest 对象传递到 Sound 构造函数，该构造函数将自动调用 Sound 对象的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 函数。如果未将有效的 URLRequest 对象传递到 Sound 构造函数，则必须自己调用 Sound 对象的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 函数，否则将不加载流。
     
     <p class="- topic/p ">一旦对某个 Sound 对象调用了 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph>，就不能再将另一个声音文件加载到该 Sound 对象中。要加载另一个声音文件，请创建新的 Sound 对象。</p>
     
     在 Flash Player 10 及更高版本和 AIR 1.5 及更高版本中，可以使用 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件处理函数将声音动态加载到 Sound 对象中，而不是使用 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph>。
     
     </apiDesc></apiConstructorDetail></apiConstructor><apiOperation id="flash.media:Sound: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 "><refpath>
     
     </refpath></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><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><example conref="examples\Sound_closeExample.as" class="- topic/example "> 在下面的示例中，当用户单击 Stop 按钮时，将调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.close()</codeph> 方法并停止声音流。
 
 <p class="- topic/p ">在构造函数中，为 Start 和 Stop 按钮创建了一个文本字段。当用户单击文本字段时，将调用 <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> 方法。它处理声音文件的启动和停止操作。请注意，根据网络连接情况或用户单击 Stop 按钮的时间，可能已加载了大部分文件，并且可能需要经过一段时间后才能停止播放声音文件。<codeph class="+ topic/ph pr-d/codeph ">try...catch</codeph> 块用于捕获在关闭流时可能发生的任何 IO 错误。例如，如果从本地目录中加载声音而没有进行流式传输，则会捕获到错误 2029，指出“此 URLStream 对象没有打开的流”。</p> 
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock "> 
package {
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import flash.media.Sound;    
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.events.MouseEvent;
    import flash.errors.IOError;
    import flash.events.IOErrorEvent;

    public class Sound_closeExample extends Sprite {
        private var snd:Sound = new Sound();
        private var button:TextField = new TextField();
        private var req:URLRequest = new URLRequest("http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3");
        
        public function Sound_closeExample() {
            button.x = 10;
            button.y = 10;
            button.text = "START";
            button.border = true;
            button.background = true;
            button.selectable = false;
            button.autoSize = TextFieldAutoSize.LEFT;

            button.addEventListener(MouseEvent.CLICK, clickHandler);

            this.addChild(button);
        }

        private function clickHandler(e:MouseEvent):void {

            if(button.text == "START") {

                snd.load(req);
                snd.play();        

                snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);

                button.text = "STOP";
            }
            else if(button.text == "STOP") {
                    
                try {
                    snd.close();
                    button.text = "Wait for loaded stream to finish.";
                }
                catch (error:IOError) {
                    button.text = "Couldn't close stream " + error.message;    
                }
            }
        }
        
        private function errorHandler(event:IOErrorEvent):void {
                button.text = "Couldn't load the file " + event.text;
        }
    }
}


</codeblock></example></apiOperationDetail></apiOperation><apiOperation id="flash.media:Sound:extract" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">extract</apiName><shortdesc class="- topic/shortdesc ">
      从 Sound 对象提取原始声音数据。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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><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 ">在 <codeph class="+ topic/ph pr-d/codeph ">target</codeph> 参数中指定的 ByteArray 中写入的范例数量。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">target</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 ">length</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">要提取的声音样本数。样本包含左声道和右声道，即 2 个 32 位浮点值。
          
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">startPosition</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">-1</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">开始提取处的样本。如果未指定值，则对 <codeph class="+ topic/ph pr-d/codeph ">Sound.extract()</codeph> 的第一个调用将在声音的开头启动；未指定 <codeph class="+ topic/ph pr-d/codeph ">startPosition</codeph> 值的后续调用将按顺序通过该文件。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
      从 Sound 对象提取原始声音数据。
     
      <p class="- topic/p ">当您通过将分配给 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件的函数用于不同的 Sound 对象，从而使用动态生成的音频时，可以使用此方法。即，您可以使用此方法从 Sound 对象中提取声音数据。然后，可以将此数据写入另一 Sound 对象用于对动态音频进行流式处理的字节数组。</p>
     
      <p class="- topic/p ">将音频数据放在目标字节数组中（从该字节数组的当前位置开始）。音频数据始终公开为 44100 Hz 立体声。样本类型是一个 32 位浮点值，可以使用 <codeph class="+ topic/ph pr-d/codeph ">ByteArray.readFloat()</codeph> 将该值转换为一个数字。 </p>
     
     </apiDesc><example conref="examples\Sound_extractExample.as" class="- topic/example "> 下面的示例加载一个 mp3 文件并使用 Sound 类的 <codeph class="+ topic/ph pr-d/codeph ">extract()</codeph> 方法来访问音频数据。
 <p class="- topic/p ">此 mp3 数据将加载到 <codeph class="+ topic/ph pr-d/codeph ">sourceSnd</codeph> Sound 对象中。当应用程序加载 mp3 数据时，它将调用 <codeph class="+ topic/ph pr-d/codeph ">loaded()</codeph> 函数（<codeph class="+ topic/ph pr-d/codeph ">sourceSnd</codeph> 对象的 <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> 事件的事件处理函数）。第二个 Sound 对象 <codeph class="+ topic/ph pr-d/codeph ">outputSound</codeph> 用于播放修改后的音频。<codeph class="+ topic/ph pr-d/codeph ">outputSound</codeph> 对象具有一个 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件侦听器；这样，一旦您调用该对象的 <codeph class="+ topic/ph pr-d/codeph ">play()</codeph> 方法，该对象将调度定期的 <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件。<codeph class="+ topic/ph pr-d/codeph ">upOctave()</codeph> 方法将返回一个基于源音频数据的修改后的音频数据的字节数组。该方法通过间隔跳过源数据中的音频采样，返回高一个八度的音频。<codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> 事件的事件处理函数将返回的字节数组写入到 <codeph class="+ topic/ph pr-d/codeph ">outputSound</codeph> 对象的 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 属性中。将 <codeph class="+ topic/ph pr-d/codeph ">data</codeph> 字节数组追加到 <codeph class="+ topic/ph pr-d/codeph ">outputSound</codeph> 对象的输出音频数据中。</p>
 <p class="- topic/p ">要测试此示例，请将 test.mp3 文件添加到 SWF 文件所在的同一目录中。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">

var sourceSnd:Sound = new Sound();
var outputSnd:Sound = new Sound();
var urlReq:URLRequest = new URLRequest("test.mp3");

sourceSnd.load(urlReq);
sourceSnd.addEventListener(Event.COMPLETE, loaded);

function loaded(event:Event):void
{
    outputSnd.addEventListener(SampleDataEvent.SAMPLE_DATA, processSound);
    outputSnd.play();
}

function processSound(event:SampleDataEvent):void
{
    var bytes:ByteArray = new ByteArray();
    sourceSnd.extract(bytes, 4096);
    event.data.writeBytes(upOctave(bytes));
}

function upOctave(bytes:ByteArray):ByteArray
{
    var returnBytes:ByteArray = new ByteArray();
    bytes.position = 0;
    while(bytes.bytesAvailable > 0)
    {
        returnBytes.writeFloat(bytes.readFloat());
        returnBytes.writeFloat(bytes.readFloat());
        if (bytes.bytesAvailable > 0)
        {
            bytes.position += 8;
        }
    }
    return returnBytes;
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound/play()" class="- topic/link "><linktext class="- topic/linktext ">play()</linktext></link><link href="flash.media.xml#Sound/event:sampleData" class="- topic/link "><linktext class="- topic/linktext ">sampleData</linktext></link></related-links></apiOperation><apiOperation id="flash.media:Sound: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 加载外部 MP3 文件的过程。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><refpath>
     
     </refpath></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 ">本地不受信任的 文件可能无法与 Internet 进行通信。可通过将此文件重新分类为<ph class="- topic/ph ">只能与远程内容交互或</ph>受信任来解决此问题。
     
     </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 ">stream</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><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 ">stream</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:URLRequest</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 指向外部 MP3 文件的 URL。
     
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">context</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:SoundLoaderContext</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 一个可选的 SoundLoader 上下文对象，可以定义缓冲时间（MP3 数据保留到 Sound 对象的缓冲区中所需的最小毫秒数）并且可以指定加载声音前应用程序是否应该检查跨域策略文件。
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     启动从指定 URL 加载外部 MP3 文件的过程。如果为 Sound 构造函数提供有效的 URLRequest 对象，该构造函数将为您调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph>。只有在未将有效的 URLRequest 对象传递到 Sound 构造函数或传递了 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 值的情况下，才需要自己调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph>。
     
     <p class="- topic/p ">一旦对某个 Sound 对象调用了 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph>，就不能再将另一个声音文件加载到该 Sound 对象中。要加载另一个声音文件，请创建新的 Sound 对象。</p>
     
     <p class="- topic/p ">在使用此方法时，请考虑以下安全模型：</p>
     
     <ul class="- topic/ul "><li class="- topic/li ">如果执行调用的 文件在只能与本地文件系统的内容交互的沙箱中，并且声音在网络沙箱中，则不允许调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph>。</li><li class="- topic/li ">从受信任的本地沙箱或只能与远程内容交互的沙箱进行访问需要通过 URL 策略文件获得网站的许可。</li><li class="- topic/li ">无法连接到常用的保留端口。有关已阻止的端口的完整列表，请参阅《ActionScript 3.0 开发人员指南》<i class="+ topic/ph hi-d/i "/>中的“限制网络 API”。</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 "> 在 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 ">在 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\Sound_loadExample.as" class="- topic/example "> 下面的示例显示了声音文件的加载进度。
 
 <p class="- topic/p ">在构造函数中，创建了一个 <codeph class="+ topic/ph pr-d/codeph ">URLRequest</codeph> 对象以确定声音文件（来自 Adobe 的播客）的位置。将在 <codeph class="+ topic/ph pr-d/codeph ">try...catch</codeph> 块中加载该文件，以便捕获在加载文件时可能发生的任何错误。如果发生 IO 错误，还会调用 <codeph class="+ topic/ph pr-d/codeph ">errorHandler()</codeph> 方法，并在用于显示进度报告的文本字段中写入错误消息。当加载操作正在进行时，将调度 <codeph class="+ topic/ph pr-d/codeph ">ProgressEvent.PROGRESS</codeph> 事件并调用 <codeph class="+ topic/ph pr-d/codeph ">progressHandler()</codeph> 方法。此处，使用 <codeph class="+ topic/ph pr-d/codeph ">ProgressEvent.PROGRESS</codeph> 事件作为计时器来计算加载进度。</p> 
  
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">progressHandler()</codeph> 方法将随 <codeph class="+ topic/ph pr-d/codeph ">ProgressEvent</codeph> 对象传递的 <codeph class="+ topic/ph pr-d/codeph ">bytesLoaded</codeph> 值除以 <codeph class="+ topic/ph pr-d/codeph ">bytesTotal</codeph> 值，以得出正在加载的声音数据的百分比。然后，它在文本字段中显示这些值。（请注意，如果文件很小、已缓存或位于本地目录中，则进度可能不太明显。）</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import flash.media.Sound;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.events.ProgressEvent;
    import flash.events.IOErrorEvent;
    
    public class Sound_loadExample extends Sprite {
        private var snd:Sound = new Sound();
        private var statusTextField:TextField  = new TextField();

        public function Sound_loadExample(){

            statusTextField.autoSize = TextFieldAutoSize.LEFT;
            var req:URLRequest = new URLRequest("http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3");
            
            try {
            snd.load(req);
            
            snd.play();
            }
            catch (err:Error) {
                trace(err.message);
            }
 
            snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
            snd.addEventListener(ProgressEvent.PROGRESS, progressHandler);
                     
            this.addChild(statusTextField);
        }
    
        private function progressHandler(event:ProgressEvent):void {
            var loadTime:Number = event.bytesLoaded / event.bytesTotal;
            var LoadPercent:uint = Math.round(100 * loadTime);
              
            statusTextField.text = "Sound file's size in bytes: " + event.bytesTotal + "\n" 
                                 + "Bytes being loaded: " + event.bytesLoaded + "\n" 
                                 + "Percentage of sound file that is loaded " + LoadPercent + "%.\n";
        }
 
        private function errorHandler(errorEvent:IOErrorEvent):void {
            statusTextField.text = "The sound could not be loaded: " + errorEvent.text;
        }
    }
}
</codeblock></example></apiOperationDetail></apiOperation><apiOperation id="flash.media:Sound: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 ">
     生成一个新的 SoundChannel 对象来回放该声音。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><refpath>
     
     </refpath></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 ">SoundChannel 对象，用于控制声音。如果没有声卡或用完了可用的声道，此方法将返回 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。一次最多可以使用 32 个声道。
     
     </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:SoundChannel</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">startTime</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Number</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 ">loops</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 ">startTime</codeph> 值的次数。 
     </apiDesc></apiParam><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">sndTransform</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:SoundTransform</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">分配给该声道的初始 SoundTransform 对象。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     生成一个新的 SoundChannel 对象来回放该声音。此方法返回 SoundChannel 对象，访问该对象可停止声音并监控音量。（要控制音量、平移和平衡，请访问分配给声道的 SoundTransform 对象。）
     
     </apiDesc><example conref="examples\Sound_playExample1.as" class="- topic/example "> 在下面的示例中，加载文件后，使用图形栏的用户可以选择声音文件的起始位置（开始时间）。
 
 <p class="- topic/p ">构造函数调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 方法以开始加载声音数据。接下来，它调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.play()</codeph> 方法；在加载了足够多的数据后，此方法将立即开始播放声音。<codeph class="+ topic/ph pr-d/codeph ">Sound.play()</codeph> 方法返回 SoundChannel 对象，该对象可用于控制声音回放。文本字段中显示了相关说明。要确保已加载了用户希望从中开始播放声音的内容，请创建 <codeph class="+ topic/ph pr-d/codeph ">bar</codeph> Sprite 对象，在加载完文件后将显示该对象。成功加载文件后，将调度一个 <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> 方法随后创建图形栏，并将其添加到显示列表中。（使用 Sprite 对象来支持交互功能，而不是形状对象。）当用户单击图形栏时，将触发 <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> 方法。</p> 
 
 <p class="- topic/p ">在 <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> 方法中，使用用户单击的 x 坐标位置 <codeph class="+ topic/ph pr-d/codeph ">event.localX</codeph> 来确定用户希望从中开始播放文件的位置。由于图形栏为 100 个像素并且从 x 坐标 100 个像素处开始，因此很容易确定位置的百分比。另外，由于加载了文件，声音文件的 <codeph class="+ topic/ph pr-d/codeph ">length</codeph> 属性将具有完整文件的长度（以毫秒为单位）。通过使用声音文件的长度和行中的位置，可以确定声音文件的起始位置。停止播放声音后，声音文件将在选定的起始位置重新开始播放，此位置是作为 <codeph class="+ topic/ph pr-d/codeph ">play()</codeph> 方法的 <codeph class="+ topic/ph pr-d/codeph ">startTime</codeph> 参数传递的。</p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock "> 
package {
    import flash.display.Sprite;
    import flash.display.Graphics;
    import flash.events.MouseEvent;
    import flash.media.Sound;;
    import flash.net.URLRequest;
    import flash.media.SoundChannel;
    import flash.events.ProgressEvent;
    import flash.events.Event;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.events.IOErrorEvent;
    
    public class Sound_playExample1 extends Sprite {
        private var snd:Sound = new Sound();
        private var channel:SoundChannel = new SoundChannel();
        private var infoTextField:TextField = new TextField();
    
        public function Sound_playExample1() {

            var req:URLRequest = new URLRequest("MySound.mp3");
            
            infoTextField.autoSize = TextFieldAutoSize.LEFT;
            infoTextField.text = "Please wait for the file to be loaded.\n" 
                                + "Then select from the bar to decide where the file should start.";
            
            snd.load(req);               
            channel = snd.play();

            snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
            snd.addEventListener(Event.COMPLETE, completeHandler);


            this.addChild(infoTextField);
        }

        private function completeHandler(event:Event):void {                
            infoTextField.text = "File is ready.";

            var bar:Sprite = new Sprite();

            bar.graphics.lineStyle(5, 0xFF0000);
            bar.graphics.moveTo(100, 100);
            bar.graphics.lineTo(200, 100);

            bar.addEventListener(MouseEvent.CLICK, clickHandler);

            this.addChild(bar);
        }
    
        private function clickHandler(event:MouseEvent):void {
            
                var position:uint = event.localX;
                var percent:uint = Math.round(position) - 100;   
                var cue:uint = (percent / 100) * snd.length;

                channel.stop();
                channel = snd.play(cue);    
        }

        private function errorHandler(errorEvent:IOErrorEvent):void {
            infoTextField.text = "The sound could not be loaded: " + errorEvent.text;
        }
    }
}
</codeblock></example><example conref="examples\Sound_playExample2.as" class="- topic/example "> 在下面的示例中，根据用户是单击还是双击按钮，将播放一次或两次声音。
 
 <p class="- topic/p ">在构造函数中，加载了声音并创建了一个简单的矩形 <codeph class="+ topic/ph pr-d/codeph ">button</codeph> Sprite 对象。（使用 Sprite 对象来支持交互功能，而不是形状对象。）此处，假定声音文件位于与 SWF 文件相同的目录中。（没有为本示例编写错误处理代码。）</p>
 
 <p class="- topic/p ">设置了两个事件侦听器以响应鼠标单击和双击。如果用户单击一下，将调用 <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> 方法以播放该声音。如果用户双击按钮，将调用 <codeph class="+ topic/ph pr-d/codeph ">doubleClickHandler()</codeph> 方法以播放两次声音文件。<codeph class="+ topic/ph pr-d/codeph ">play()</codeph> 方法的第二个参数设置为 <codeph class="+ topic/ph pr-d/codeph ">1</codeph>，表示声音将返回到声音开始时间一次并重新播放。开始时间（第一个参数）设置为 <codeph class="+ topic/ph pr-d/codeph ">0</codeph>，表示文件将从开始处播放。</p>
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import flash.media.Sound;
    import flash.net.URLRequest;

    public class Sound_playExample2 extends Sprite {
        private var button:Sprite = new Sprite(); 
        private var snd:Sound = new Sound();
            
        public function Sound_playExample2() {

            var req:URLRequest = new URLRequest("click.mp3");
            snd.load(req);               
     
            button.graphics.beginFill(0x00FF00);
            button.graphics.drawRect(10, 10, 50, 30);
            button.graphics.endFill();
     
            button.addEventListener(MouseEvent.CLICK, clickHandler);
            button.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler);
     
            this.addChild(button);
        }

        private function clickHandler(event:MouseEvent):void {
            snd.play();            
        }

        private function doubleClickHandler(event:MouseEvent):void {
            snd.play(0, 2);        
        }
    }
}
</codeblock></example><example conref="examples\Sound_playExample3.as" class="- topic/example "> 下面的示例显示了声音文件的加载和播放进度。
 
 <p class="- topic/p ">在构造函数中，在 <codeph class="+ topic/ph pr-d/codeph ">try...catch</codeph> 块中加载了该文件，以便捕获在加载文件时可能发生的任何错误。在声音对象中添加了一个侦听器，它通过调用 <codeph class="+ topic/ph pr-d/codeph ">errorHandler()</codeph> 方法来响应 <codeph class="+ topic/ph pr-d/codeph ">IOErrorEvent</codeph> 事件。还为主应用程序添加了一个侦听器以响应 <codeph class="+ topic/ph pr-d/codeph ">Event.ENTER_FRAME</codeph> 事件，它用作计时机制以显示回放进度。最后，为声道添加了第三个侦听器，它通过调用 <codeph class="+ topic/ph pr-d/codeph ">soundCompleteHandler()</codeph> 方法来响应 <codeph class="+ topic/ph pr-d/codeph ">Event.SOUND_COMPLETE</codeph> 事件（完成声音播放时）。<codeph class="+ topic/ph pr-d/codeph ">soundCompleteHandler()</codeph> 方法还删除了 <codeph class="+ topic/ph pr-d/codeph ">Event.ENTER_FRAME</codeph> 事件的事件侦听器。</p>
 
 <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">enterFrameHandler()</codeph> 方法将随 <codeph class="+ topic/ph pr-d/codeph ">ProgressEvent</codeph> 对象传递的 <codeph class="+ topic/ph pr-d/codeph ">bytesLoaded</codeph> 值除以 <codeph class="+ topic/ph pr-d/codeph ">bytesTotal</codeph> 值，以得出正在加载的声音数据的百分比。可通过将声道的 <codeph class="+ topic/ph pr-d/codeph ">position</codeph> 属性值除以声音数据长度，来确定正在播放的声音数据的百分比。但是，如果未完全加载声音数据，声音对象的 <codeph class="+ topic/ph pr-d/codeph ">length</codeph> 属性仅显示当前加载的声音数据的大小。估计的完整声音文件的最终大小是使用以下方法计算的：将当前声音对象的 <codeph class="+ topic/ph pr-d/codeph ">length</codeph> 值除以 <codeph class="+ topic/ph pr-d/codeph ">bytesLoaded</codeph> 属性值，再乘以 <codeph class="+ topic/ph pr-d/codeph ">bytesTotal</codeph> 属性值。</p>
 
 <p class="- topic/p ">请注意，如果文件很小、已缓存或位于本地目录中，则加载进度可能不太明显。另外，从声音数据开始加载到所加载的数据开始播放之间的延迟时间是由 <codeph class="+ topic/ph pr-d/codeph ">SoundLoaderContext.buffertime</codeph> 属性值确定的，此属性的默认值为 1000 毫秒，您可以对其进行重置。</p>
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    
    public class Sound_playExample3 extends Sprite {
        private var snd:Sound = new Sound();
        private var channel:SoundChannel;
        private var statusTextField:TextField  = new TextField();

        public function Sound_playExample3(){

            statusTextField.autoSize = TextFieldAutoSize.LEFT;

           var req:URLRequest = new URLRequest("http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3");
            
            try {
                snd.load(req);
            
                channel = snd.play();
            }
            catch (err:Error) {
                trace(err.message);
            }
                    
            snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
            addEventListener(Event.ENTER_FRAME, enterFrameHandler);
            channel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
                    
            this.addChild(statusTextField);
        }
    
        private function enterFrameHandler(event:Event):void {    
            var loadTime:Number = snd.bytesLoaded / snd.bytesTotal;
            var loadPercent:uint = Math.round(100 * loadTime);
            var estimatedLength:int = Math.ceil(snd.length / (loadTime));
            var playbackPercent:uint = Math.round(100 * (channel.position / estimatedLength));
      
            statusTextField.text = "Sound file's size is " + snd.bytesTotal + " bytes.\n" 
                                   + "Bytes being loaded: " + snd.bytesLoaded + "\n" 
                                   + "Percentage of sound file that is loaded " + loadPercent + "%.\n"
                                   + "Sound playback is " + playbackPercent + "% complete.";     
        }
 
        private function errorHandler(errorEvent:IOErrorEvent):void {
            statusTextField.text = "The sound could not be loaded: " + errorEvent.text;
        }

        private function soundCompleteHandler(event:Event):void {
            statusTextField.text = "The sound has finished playing.";
            removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
        }
    }
}
</codeblock></example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#SoundChannel/stop()" class="- topic/link "><linktext class="- topic/linktext ">SoundChannel.stop()</linktext></link><link href="flash.media.xml#SoundMixer/stopAll()" class="- topic/link "><linktext class="- topic/linktext ">SoundMixer.stopAll()</linktext></link></related-links></apiOperation><apiValue id="flash.media:Sound: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 "><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 ">uint</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回此声音对象中当前可用的字节数。此属性通常只对从外部加载的文件有用。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:Sound: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 "><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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回此声音对象中总的字节数。 
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:Sound:id3: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 ">id3</apiName><shortdesc class="- topic/shortdesc ">
     提供对作为 MP3 文件一部分的元数据的访问。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">sound, Sound.id3, id3, mp3
     </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 ">flash.media:ID3Info</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     提供对作为 MP3 文件一部分的元数据的访问。
     
     <p class="- topic/p ">MP3 声音文件可以包含 ID3 标签，ID3 标签提供有关该文件的元数据。如果使用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 方法加载的 MP3 声音包含 ID3 标签，则可以查询这些属性。只支持使用 UTF-8 字符集的 ID3 标签。</p>
     
     <p class="- topic/p "><ph class="- topic/ph ">Flash Player 9 和更高版本以及 AIR 支持</ph> ID3 2.0 标签，特别是 2.3 和 2.4 标签。下表列出了标准 ID3 2.0 标签以及该标签所表示的内容类型。<codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> 属性通过 <codeph class="+ topic/ph pr-d/codeph ">my_sound.id3.COMM</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">my_sound.id3.TIME</codeph> 等格式提供对这些标记的访问权限。第一个表描述了可通过 ID3 2.0 属性名称或 ActionScript 属性名称进行访问的标签。第二个表描述了在 ActionScript 中受支持但不具有预定义属性的 ID3 标签。 </p>
     
     <adobetable class="innertable"><tgroup cols="2" class="- topic/tgroup "><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry "><b class="+ topic/ph hi-d/b ">ID3 2.0 标签</b></entry><entry class="- topic/entry "><b class="+ topic/ph hi-d/b ">相应的 Sound 类属性</b></entry></row><row class="- topic/row "><entry class="- topic/entry ">COMM</entry><entry class="- topic/entry ">Sound.id3.comment</entry></row><row class="- topic/row "><entry class="- topic/entry ">TALB</entry><entry class="- topic/entry ">Sound.id3.album </entry></row><row class="- topic/row "><entry class="- topic/entry ">TCON</entry><entry class="- topic/entry ">Sound.id3.genre</entry></row><row class="- topic/row "><entry class="- topic/entry ">TIT2</entry><entry class="- topic/entry ">Sound.id3.songName </entry></row><row class="- topic/row "><entry class="- topic/entry ">TPE1</entry><entry class="- topic/entry ">Sound.id3.artist</entry></row><row class="- topic/row "><entry class="- topic/entry ">TRCK</entry><entry class="- topic/entry ">Sound.id3.track </entry></row><row class="- topic/row "><entry class="- topic/entry ">TYER</entry><entry class="- topic/entry ">Sound.id3.year </entry></row></tbody></tgroup></adobetable>
     
     <p class="- topic/p ">下表描述了在 Sound 类中受支持但不具有预定义属性的 ID3 标签。通过调用 <codeph class="+ topic/ph pr-d/codeph ">mySound.id3.TFLT</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">mySound.id3.TIME</codeph> 等来访问它们。<b class="+ topic/ph hi-d/b ">注意：</b>Flash Lite 4 不支持上述任何标签。</p>  
      <adobetable class="innertable"><tgroup cols="2" class="- topic/tgroup "><tbody class="- topic/tbody "><row class="- topic/row "><entry class="- topic/entry "><b class="+ topic/ph hi-d/b ">属性</b></entry><entry class="- topic/entry "><b class="+ topic/ph hi-d/b ">描述</b></entry></row><row class="- topic/row "><entry class="- topic/entry ">TFLT</entry><entry class="- topic/entry ">文件类型</entry></row><row class="- topic/row "><entry class="- topic/entry ">TIME</entry><entry class="- topic/entry ">时间</entry></row><row class="- topic/row "><entry class="- topic/entry ">TIT1</entry><entry class="- topic/entry ">内容组说明</entry></row><row class="- topic/row "><entry class="- topic/entry ">TIT2</entry><entry class="- topic/entry ">标题/歌曲名称/内容说明</entry></row><row class="- topic/row "><entry class="- topic/entry ">TIT3</entry><entry class="- topic/entry ">副标题/说明精选</entry></row><row class="- topic/row "><entry class="- topic/entry ">TKEY</entry><entry class="- topic/entry ">初始密钥</entry></row><row class="- topic/row "><entry class="- topic/entry ">TLAN</entry><entry class="- topic/entry ">语言</entry></row><row class="- topic/row "><entry class="- topic/entry ">TLEN</entry><entry class="- topic/entry ">长度</entry></row><row class="- topic/row "><entry class="- topic/entry ">TMED</entry><entry class="- topic/entry ">媒体类型</entry></row><row class="- topic/row "><entry class="- topic/entry ">TOAL</entry><entry class="- topic/entry ">原始唱片/影片/演出标题</entry></row><row class="- topic/row "><entry class="- topic/entry ">TOFN</entry><entry class="- topic/entry ">原始文件名</entry></row><row class="- topic/row "><entry class="- topic/entry ">TOLY</entry><entry class="- topic/entry ">原词作者/乐谱作者</entry></row><row class="- topic/row "><entry class="- topic/entry ">TOPE</entry><entry class="- topic/entry ">原始艺术家/表演者</entry></row><row class="- topic/row "><entry class="- topic/entry ">TORY</entry><entry class="- topic/entry ">原始发行年份</entry></row><row class="- topic/row "><entry class="- topic/entry ">TOWN</entry><entry class="- topic/entry ">文件所有者/获得授权者</entry></row><row class="- topic/row "><entry class="- topic/entry ">TPE1</entry><entry class="- topic/entry ">主要表演者/独奏（独唱）</entry></row><row class="- topic/row "><entry class="- topic/entry ">TPE2</entry><entry class="- topic/entry ">乐队/管弦乐队/伴奏</entry></row><row class="- topic/row "><entry class="- topic/entry ">TPE3</entry><entry class="- topic/entry ">指挥/主要演奏者</entry></row><row class="- topic/row "><entry class="- topic/entry ">TPE4</entry><entry class="- topic/entry ">翻译、混录员或以其它方式进行修改的人员</entry></row><row class="- topic/row "><entry class="- topic/entry ">TPOS</entry><entry class="- topic/entry ">歌曲集部分</entry></row><row class="- topic/row "><entry class="- topic/entry ">TPUB</entry><entry class="- topic/entry ">发行者</entry></row><row class="- topic/row "><entry class="- topic/entry ">TRCK</entry><entry class="- topic/entry ">歌曲集中的曲目编号/位置</entry></row><row class="- topic/row "><entry class="- topic/entry ">TRDA</entry><entry class="- topic/entry ">录制日期</entry></row><row class="- topic/row "><entry class="- topic/entry ">TRSN</entry><entry class="- topic/entry ">Internet 无线电台名称</entry></row><row class="- topic/row "><entry class="- topic/entry ">TRSO</entry><entry class="- topic/entry ">Internet 无线电台所有者</entry></row><row class="- topic/row "><entry class="- topic/entry ">TSIZ</entry><entry class="- topic/entry ">大小</entry></row><row class="- topic/row "><entry class="- topic/entry ">TSRC</entry><entry class="- topic/entry ">ISRC（国际标准音像制品编码）</entry></row><row class="- topic/row "><entry class="- topic/entry ">TSSE</entry><entry class="- topic/entry ">用于编码的软件/硬件和设置</entry></row><row class="- topic/row "><entry class="- topic/entry ">TYER</entry><entry class="- topic/entry ">年份</entry></row><row class="- topic/row "><entry class="- topic/entry ">WXXX</entry><entry class="- topic/entry ">URL 链接帧</entry></row></tbody></tgroup></adobetable>
     
     
     <p class="- topic/p ">使用此属性时，请考虑 Flash Player 安全模型：</p>
     
     <ul class="- topic/ul "><li class="- topic/li ">对于与声音文件位于同一安全沙箱的 SWF 文件，始终允许 Sound 对象的 <codeph class="+ topic/ph pr-d/codeph ">id3</codeph> 属性。对于其它沙箱中的文件，则需经过安全检查。</li><li class="- topic/li ">使用 Sound 类的 <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> 方法加载声音时，可指定 <codeph class="+ topic/ph pr-d/codeph ">context</codeph> 参数，该参数为一个 SoundLoaderContext 对象。如果将 SoundLoaderContext 对象的 <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> 属性设为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则 Flash Player 将在从其中加载声音的服务器上查找 URL 策略文件。如果存在一个策略文件并且允许从执行加载的 SWF 文件的域进行访问，则允许该文件访问 Sound 对象的 <codeph class="+ topic/ph pr-d/codeph ">id3</codeph> 属性；否则将不允许。</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\Sound_id3Example.as" class="- topic/example "> 下面的示例从声音文件中读取 ID3 信息，并在文本字段中显示该信息。
 
 <p class="- topic/p ">在构造函数中，加载了声音文件，但没有将其设置为播放。此处，假定该文件位于 SWF 目录中。系统必须具有权限，才能读取加载的声音文件的 ID3 标签。如果该文件中包含 ID3 信息并允许程序读取该信息，将触发一个 <codeph class="+ topic/ph pr-d/codeph ">Event.ID3</codeph> 事件，并填充声音文件的 <codeph class="+ topic/ph pr-d/codeph ">id3</codeph> 属性。<codeph class="+ topic/ph pr-d/codeph ">id3</codeph> 属性包含一个 <codeph class="+ topic/ph pr-d/codeph ">ID3Info</codeph> 对象，其中包含所有 ID3 信息。</p>
 
 <p class="- topic/p ">在 <codeph class="+ topic/ph pr-d/codeph ">id3Handler()</codeph> 方法中，将该文件的 ID3 标签存储在 ID3Info 类对象 <codeph class="+ topic/ph pr-d/codeph ">id3</codeph> 中。将实例化一个文本字段以显示 ID3 标签列表。for 循环将循环访问所有 ID3 2.0 标签，并将名称和值附加到文本字段的内容中。通过使用 ID3 信息 (<codeph class="+ topic/ph pr-d/codeph ">ID3Info</codeph>) 属性，还可以附加歌手、歌曲名称和专辑。ActionScript 3.0 和 Flash Player 9 及更高版本支持 ID3 2.0 标签，特别是 2.3 和 2.4。如果循环访问属性（像在 for 循环中一样），则仅显示 ID3 2.0 标签。但是，来自早期版本的数据也会存储在歌曲的 <codeph class="+ topic/ph pr-d/codeph ">id3</codeph> 属性中，可通过使用 ID3 信息类属性对其进行访问。ID3 1.0 的标签位于文件结尾；而 ID3 2.0 标签位于文件开头。（有时，文件可能在相同位置包含早期版本和较新版本的标签。）如果编码的文件开头和结尾分别包含 1.0 版和 2.0 版标签，将调用两次 <codeph class="+ topic/ph pr-d/codeph ">id3Handler()</codeph> 方法。它先读取 2.0 版标签，然后再读取 1.0 版标签。如果只有 ID3 1.0 标签可用，可通过 ID3 信息属性访问该信息，如 <codeph class="+ topic/ph pr-d/codeph ">id3.songname</codeph>。对于 ID3 2.0，<codeph class="+ topic/ph pr-d/codeph ">id3.TITS</codeph> 属性将使用新标签 (TITS) 来检索歌曲名称。</p>
 
 <p class="- topic/p ">请注意，没有为本示例编写错误处理代码，如果 ID3 内容很长，结果可能会超出可查看区域。</p> 
 
<codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
package {
    import flash.display.Sprite;
    import flash.media.Sound;
    import flash.net.URLRequest;
    import flash.media.ID3Info;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.events.Event;

    public class Sound_id3Example extends Sprite {
        private var snd:Sound = new Sound();       
        private var myTextField:TextField = new TextField();

        public function Sound_id3Example() {
            snd.addEventListener(Event.ID3, id3Handler);
            snd.load(new URLRequest("mySound.mp3"));
        }
    
        private function id3Handler(event:Event):void {
            var id3:ID3Info = snd.id3;

            myTextField.autoSize = TextFieldAutoSize.LEFT;
            myTextField.border = true;

            myTextField.appendText("Received ID3 Info: \n");
              
            for (var propName:String in id3) {
                myTextField.appendText(propName + " = " + id3[propName] + "\n");
            }
 
            myTextField.appendText("\n" + "Artist: " + id3.artist + "\n");
            myTextField.appendText("Song name: " + id3.songName + "\n");
            myTextField.appendText("Album: " + id3.album + "\n\n"); 
 
            this.addChild(myTextField);
        }
    }
}
</codeblock></example></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#SoundLoaderContext/checkPolicyFile" class="- topic/link "><linktext class="- topic/linktext ">SoundLoaderContext.checkPolicyFile</linktext></link></related-links></apiValue><apiValue id="flash.media:Sound:isBuffering: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 ">isBuffering</apiName><shortdesc class="- topic/shortdesc ">
     返回外部 MP3 文件的缓冲状态。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 "><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 ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     返回外部 MP3 文件的缓冲状态。如果值为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则在对象等待获取更多数据时，当前将会暂停任何回放。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:Sound:isURLInaccessible: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 ">isURLInaccessible</apiName><shortdesc class="- topic/shortdesc ">
	 表示 Sound.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="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 ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 表示 <codeph class="+ topic/ph pr-d/codeph ">Sound.url</codeph> 属性是否已截断。当 <codeph class="+ topic/ph pr-d/codeph ">isURLInaccessible</codeph> 值为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 时，<codeph class="+ topic/ph pr-d/codeph ">Sound.url</codeph> 值只是从其中加载声音的最终 URL 的域。例如，如果从 <codeph class="+ topic/ph pr-d/codeph ">http://www.adobe.com/assets/hello.mp3</codeph> 加载声音且 <codeph class="+ topic/ph pr-d/codeph ">Sound.url</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">http://www.adobe.com</codeph>，则该属性会被截断。仅当下列所有值也全部为 true 时，<codeph class="+ topic/ph pr-d/codeph ">isURLInaccessible</codeph> 值才为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>：
	 
	 <ul class="- topic/ul "><li class="- topic/li ">加载声音文件时发生 HTTP 重定向。</li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 的 SWF 文件与声音文件的最终 URL 来自不同的域。</li><li class="- topic/li ">调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 的 SWF 文件无权访问该声音文件。授予访问声音文件的权限的方式与为 <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> 属性授予权限的方式相同：建立一个策略文件，然后使用 <codeph class="+ topic/ph pr-d/codeph ">SoundLoaderContext.checkPolicyFile</codeph> 属性。</li></ul>
	 
	 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b><codeph class="+ topic/ph pr-d/codeph ">isURLInaccessible</codeph> 属性是为 Flash Player 10.1 和 AIR 2.0 添加的。但是，如果 Flash 运行时支持该属性，则该属性适用于所有版本的 SWF 文件。因此，在“严谨模式”下使用某些创作工具会导致出现编译错误。要避免出现此错误，请使用间接语法 <codeph class="+ topic/ph pr-d/codeph ">mySound["isURLInaccessible"]</codeph> 或禁用严格模式。如果您使用的是 Flash Professional CS5 或 Flex SDK 4.1，则可以对在 Flash Player 10.1 和 AIR 2 之前发布的运行时使用和编译此 API。</p>
	 
	 <p class="- topic/p ">对于 AIR 中的应用程序内容，该属性的值始终为 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>。</p>
	 
	 </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound/url" class="- topic/link "><linktext class="- topic/linktext ">url</linktext></link><link href="flash.media.xml#Sound/id3" class="- topic/link "><linktext class="- topic/linktext ">id3</linktext></link><link href="flash.media.xml#SoundLoaderContext/checkPolicyFile" class="- topic/link "><linktext class="- topic/linktext ">flash.media.SoundLoaderContext.checkPolicyFile</linktext></link></related-links></apiValue><apiValue id="flash.media:Sound:length: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 ">length</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 ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     当前声音的长度（以毫秒为单位）。
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:Sound: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="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 ">
     从中加载此声音的 URL。此属性只适用于使用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 方法加载的 Sound 对象。对于与 SWF 文件库中的声音资源关联的 Sound 对象，<codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性的值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
     
     <p class="- topic/p ">首次调用 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 时，<codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性最初具有 <codeph class="+ topic/ph pr-d/codeph ">null</codeph> 值，因为最终 URL 未知。只要从 Sound 对象中调度了 <codeph class="+ topic/ph pr-d/codeph ">open</codeph> 事件，<codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性就会具有非空值。</p>
     
     <p class="- topic/p "><codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性包含已从其中加载了声音的最终、绝对 URL。<codeph class="+ topic/ph pr-d/codeph ">url</codeph> 的值通常与传递给 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> 的 <codeph class="+ topic/ph pr-d/codeph ">stream</codeph> 参数的值相同。但是，如果已将一个相对 URL 传递给 <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph>，则 <codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性的值将表示绝对 URL。此外，如果 HTTP 服务器重定向原始 URL 请求，<codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性的值将反映从其中实际下载声音文件的最终 URL。这种报告绝对、最终 URL 的行为与 <codeph class="+ topic/ph pr-d/codeph ">LoaderInfo.url</codeph> 的行为等效。</p>
     <p class="- topic/p ">在某些情况下，<codeph class="+ topic/ph pr-d/codeph ">url</codeph> 属性的值会被截断；有关详细信息，请参阅 <codeph class="+ topic/ph pr-d/codeph ">isURLInaccessible</codeph> 属性。</p>
     
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound/load()" class="- topic/link "><linktext class="- topic/linktext ">load()</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.media.xml#Sound/isURLInaccessible" class="- topic/link "><linktext class="- topic/linktext ">isURLInaccessible</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:MicrophoneEnhancedMode" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">MicrophoneEnhancedMode</apiName><shortdesc class="- topic/shortdesc ">
 MicrophoneEnhancedMode 类是在设置 MicrophoneEnhancedOptions 类的 mode 属性时使用的常量值的枚举。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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><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 ">
 MicrophoneEnhancedMode 类是在设置 <codeph class="+ topic/ph pr-d/codeph ">MicrophoneEnhancedOptions</codeph> 类的 <codeph class="+ topic/ph pr-d/codeph ">mode</codeph> 属性时使用的常量值的枚举。
 
 </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#MicrophoneEnhancedOptions" class="- topic/link "><linktext class="- topic/linktext ">flash.media.MicrophoneEnhancedOptions</linktext></link></related-links><apiValue id="flash.media:MicrophoneEnhancedMode:FULL_DUPLEX" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">FULL_DUPLEX</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 "><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 ">fullDuplex</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc "> 
	 使用此模式可使双方同时讲话。回音消除功能在全双工模式下工作。全双工模式是最高品质的回音消除。此模式需要高品质的麦克风和扬声器，并且需要最大的计算能力。不要将此模式用于 USB 麦克风。
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:MicrophoneEnhancedMode:HALF_DUPLEX" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">HALF_DUPLEX</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 "><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 ">halfDuplex</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
	 请对较旧的低品质扬声器和麦克风使用此模式。回音消除功能在半双工模式下工作。在半双工模式下，一次只能有一方可以讲话。半双工模式要求的处理比全双工模式更简单。半双工模式是 USB 麦克风设备的默认模式。
	 
	 <p class="- topic/p ">如果应用程序使用默认 <codeph class="+ topic/ph pr-d/codeph ">enhancedOptions</codeph> 设置和 USB 麦克风，Flash Player 会自动切换到 <codeph class="+ topic/ph pr-d/codeph ">halfDuplex</codeph> 模式。如果应用程序使用默认的 <codeph class="+ topic/ph pr-d/codeph ">enhancedOptions</codeph> 设置和内置麦克风，Flash Player 将使用 <codeph class="+ topic/ph pr-d/codeph ">fullDuplex</codeph> 模式。</p>
	 
	 </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:MicrophoneEnhancedMode:HEADSET" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">HEADSET</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 "><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 ">headset</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.media:MicrophoneEnhancedMode:OFF" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">OFF</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 "><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 ">off</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.media:MicrophoneEnhancedMode:SPEAKER_MUTE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">SPEAKER_MUTE</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 "><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 ">speakerMute</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.media.xml#MicrophoneEnhancedOptions/autoGain" class="- topic/link "><linktext class="- topic/linktext ">flash.media.MicrophoneEnhancedOptions.autoGain</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:Video" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">Video</apiName><shortdesc class="- topic/shortdesc ">
 
 Video 类在应用程序中显示实时视频或录制视频，而无需在 SWF 文件中嵌入视频。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Camera, video, 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.display:DisplayObject</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
 
 Video 类在应用程序中显示实时视频或录制视频，而无需在 SWF 文件中嵌入视频。此类创建播放下列任一类型视频的 Video 对象：在服务器上存储的或本地存储的录制的视频文件；用户捕获的实时视频。Video 对象是应用程序的显示列表中的一个显示对象，它表示在用户界面中运行视频的可见空间。
 
 <p class="- topic/p ">
 将 Video 对象与 Flash Media Server 一起使用时，可通过该对象将用户捕获的实时视频发送到服务器，然后从服务器向其他用户广播此视频。通过使用这些功能，您可以开发媒体应用程序，例如，简单的视频播放器、具有在服务器间进行多点发布功能的视频播放器或者用于用户社区的视频共享应用程序。
 </p>
 
 <p class="- topic/p ">
 Flash Player 9 和更高版本支持发布和回放使用 Sorenson Spark 或 On2 VP6 编解码器编码的 FLV 文件，还支持 Alpha 通道。与以前的技术相比，On2 VP6 视频编解码器使用的带宽较少，并且提供了额外的马赛克消除滤镜和色度去环滤镜。有关视频播放和支持格式的详细信息，请参阅 flash.net.NetStream 类。</p>
 
 
 <p class="- topic/p ">
 Flash Player 9.0.115.0 和更高版本支持 mipmap 处理以优化运行时，从而呈现品质和性能。对于视频回放，如果将 Video 对象的 <codeph class="+ topic/ph pr-d/codeph ">smoothing</codeph> 属性设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph>，则 Flash Player 使用 mipmap 优化。 
 </p> 
 
 <p class="- topic/p ">
 与显示列表中的其它显示对象一样，您可以控制 Video 对象的各种属性。例如，可以通过使用 Video 对象的 <codeph class="+ topic/ph pr-d/codeph ">x</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">y</codeph> 属性在舞台上移动该对象，以及通过使用其 <codeph class="+ topic/ph pr-d/codeph ">height</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">width</codeph> 属性更改其大小，等等。 
 </p>
 
 <p class="- topic/p ">
 要播放视频流，请使用 <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">attachNetStream()</codeph> 将视频附加到 Video 对象。然后，使用 <codeph class="+ topic/ph pr-d/codeph ">addChild()</codeph> 将 Video 对象添加到显示列表中。
 </p>
 
 <p class="- topic/p ">
 如果您使用的是 Flash Professional，则还可以将 Video 对象放在舞台上，而不是使用 <codeph class="+ topic/ph pr-d/codeph ">addChild()</codeph> 进行添加，如下所示：
 </p>
 
 <ol class="- topic/ol "><li class="- topic/li ">如果看不到“库”面板，请选择“窗口”>“库”，让该面板显示出来。</li><li class="- topic/li ">单击“库”面板标题栏右侧的“选项”菜单，然后选择“新建视频”，在库中添加一个嵌入式 Video 对象。</li><li class="- topic/li ">在“视频属性”对话框中，命名嵌入的 Video 对象以便在库中使用，然后单击“确定”。</li><li class="- topic/li ">将该 Video 对象拖放到舞台上，然后使用属性检查器为其指定一个唯一的实例名称，如 <codeph class="+ topic/ph pr-d/codeph ">my_video</codeph>。（不要将其命名为“Video”。）</li></ol>
 
 <p class="- topic/p ">在桌面上的 AIR 应用程序中，以全屏模式播放视频会禁用任何电源和屏幕节省功能（如果操作系统允许）。</p>
 
 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>Video 类不是 InteractiveObject 类的子类，因此它无法调度鼠标事件。但是，您可以对包含 Video 对象的显示对象容器调用 <codeph class="+ topic/ph pr-d/codeph ">addEventListener()</codeph> 方法。
 </p>
 
 </apiDesc><example conref="examples\VideoExample.as" class="- topic/example "> 以下示例将 Video 对象与 NetConnection 和 NetStream 类一同使用，以加载和播放 FLV 文件。为了运行此示例，需要一个名称和位置与传递给 <codeph class="+ topic/ph pr-d/codeph ">videoURL</codeph> 的变量相匹配的 FLV 文件，在本例中，使用 SWF 文件所在目录下的一个名为 Video.flv 的 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> 事件返回一个 info 对象，该对象带有一个表示成功的 <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.*;
    import flash.media.Video;
    import flash.net.NetConnection;
    import flash.net.NetStream;

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

        public function VideoExample() {
            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("Unable to locate video: " + videoURL);
                    break;
            }
        }

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

        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }
        
        private function asyncErrorHandler(event:AsyncErrorEvent):void {
            // ignore AsyncErrorEvent events.
        }
    }
 }
</codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Video/attachCamera()" class="- topic/link "><linktext class="- topic/linktext ">attachCamera()</linktext></link><link href="flash.media.xml#Video/attachNetStream()" class="- topic/link "><linktext class="- topic/linktext ">attachNetStream()</linktext></link><link href="flash.media.xml#Camera/getCamera()" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Camera.getCamera()</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" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream</linktext></link><link href="flash.display.xml#DisplayObjectContainer/addChild()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.DisplayObjectContainer.addChild()</linktext></link><link href="flash.display.xml#Stage/addChild()" class="- topic/link "><linktext class="- topic/linktext ">flash.display.Stage.addChild()</linktext></link><link href="http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e1a.html" class="- topic/link "><linktext class="- topic/linktext ">使用视频</linktext></link></related-links><apiConstructor id="flash.media:Video:Video" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">Video</apiName><shortdesc class="- topic/shortdesc ">
     创建新的 Video 实例。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Camera, video, NetStream
     </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 "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">width</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">320</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 ">height</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">int</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">240</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">视频的高度，以像素为单位。
     
     </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     创建新的 Video 实例。如果没有提供 <codeph class="+ topic/ph pr-d/codeph ">width</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">height</codeph> 参数的值，将使用默认值。在初始构建后，也可以使用 <codeph class="+ topic/ph pr-d/codeph ">Video.width</codeph> 和 <codeph class="+ topic/ph pr-d/codeph ">Video.height</codeph> 设置 Video 对象的宽度和高度属性。在创建新的 Video 对象时，不允许宽度和高度的值为零；如果传递零，则将应用默认值。
     
     <p class="- topic/p ">创建 Video 后，请调用 <codeph class="+ topic/ph pr-d/codeph ">DisplayObjectContainer.addChild()</codeph> 或 <codeph class="+ topic/ph pr-d/codeph ">DisplayObjectContainer.addChildAt()</codeph> 方法以便将 Video 对象添加到父级 DisplayObjectContainer 对象。</p>
     
     </apiDesc><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></apiConstructorDetail></apiConstructor><apiOperation id="flash.media:Video: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 ">
     指定要在应用程序中 Video 对象的边界内显示的来自摄像头的视频流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Camera, video, Video.attachCamera, attachCamera()
     </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 ">camera</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:Camera</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">正在捕获视频数据的 Camera 对象。要切断与该 Video 对象的连接，请传递 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定要在应用程序中 Video 对象的边界内显示的来自摄像头的视频流。
     
     <p class="- topic/p ">
     使用此方法将用户捕获的实时视频附加到 Video 对象。您可以在捕获实时视频的同一台计算机或设备上本地播放该视频，也可以将其发送到 Flash Media Server，然后使用该服务器将视频流式传输到其他用户。
     </p>
     
	 <p class="- topic/p "><b class="+ topic/ph hi-d/b ">注意：</b>在 iOS AIR 应用程序中，当应用程序使用 GPU 呈现模式时，不能显示摄像头视频。</p>
	 
     </apiDesc><example class="- topic/example ">有关如何使用此方法的说明，请参阅 <xref href="Camera.html#getCamera()" class="- topic/xref ">Camera.getCamera()</xref> 方法示例。 
     </example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Video/attachNetStream()" class="- topic/link "><linktext class="- topic/linktext ">Video.attachNetStream()</linktext></link><link href="flash.media.xml#Camera" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Camera</linktext></link></related-links></apiOperation><apiOperation id="flash.media:Video:attachNetStream" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (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 ">attachNetStream</apiName><shortdesc class="- topic/shortdesc ">
     指定要在应用程序中 Video 对象的边界内显示的视频流。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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, video, Video.attachNetStream, attachNetStream()
     
     </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 ">netStream</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.net:NetStream</apiOperationClassifier><apiDesc class="- topic/section reference/section apiRef/apiDesc ">一个 NetStream 对象。要切断与该 Video 对象的连接，请传递 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。
     
     </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定要在应用程序中 Video 对象的边界内显示的视频流。视频流是使用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 播放的视频文件，Camera 对象或 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>。如果使用视频文件，则可以将其存储在本地文件系统或 Flash Media Server 中。如果 <codeph class="+ topic/ph pr-d/codeph ">netStream</codeph> 参数的值为 <codeph class="+ topic/ph pr-d/codeph ">null</codeph>，则不会再在 Video 对象中播放视频。
     
     <p class="- topic/p ">
     如果视频文件只包含音频，则无需使用此方法；当调用 <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph> 时，将自动播放视频文件的音频部分。要控制与视频文件相关联的音频，请使用用于播放视频文件的 NetStream 对象的 <codeph class="+ topic/ph pr-d/codeph ">soundTransform</codeph> 属性。
     </p>
     
     </apiDesc><example class="- topic/example ">有关如何使用此方法的说明，请参阅此类末尾的示例。 
      
      </example></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Video/attachCamera()" class="- topic/link "><linktext class="- topic/linktext ">Video.attachCamera()</linktext></link><link href="flash.net.xml#NetStream/soundTransform" class="- topic/link "><linktext class="- topic/linktext ">flash.net.NetStream.soundTransform</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.media.xml#SoundTransform" class="- topic/link "><linktext class="- topic/linktext ">SoundTransform</linktext></link></related-links></apiOperation><apiOperation id="flash.media:Video: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 ">
     清除 Video 对象（而非视频流）中当前显示的图像。</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Camera, video, Video.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 ">
     清除 Video 对象（而非视频流）中当前显示的图像。此方法对于处理当前图像非常有用。例如，您可以清除最后一幅图像或显示待机信息，而无需隐藏 Video 对象。
     
     </apiDesc></apiOperationDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Video/attachCamera()" class="- topic/link "><linktext class="- topic/linktext ">Video.attachCamera()</linktext></link></related-links></apiOperation><apiValue id="flash.media:Video:deblocking: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 ">deblocking</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 ">Camera, video, Video.deblocking, deblocking
      
      </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     表示作为后处理的一部分应用于已解码视频的滤镜的类型。默认值为 0，表示允许视频压缩程序根据需要应用消除马赛克的滤镜。
     
     <p class="- topic/p ">压缩视频可能会导致产生不希望有的伪像。可以使用 <codeph class="+ topic/ph pr-d/codeph ">deblocking</codeph> 属性设置用于减少马赛克（而对于使用 On2 编解码器压缩的视频，则用于降低扭曲边缘）的过滤器。</p>
     
     <p class="- topic/p "><i class="+ topic/ph hi-d/i ">马赛克</i>是指组成每个视频帧的块的边界之间的可见瑕疵。<i class="+ topic/ph hi-d/i ">扭曲边缘</i>是指视频图像内元素周围的扭曲边缘。</p>
     
     <p class="- topic/p ">有两种消除马赛克的滤镜：分别在 Sorenson 编解码器和 On2 VP6 编解码器中。此外，如果使用 On2 VP6 编解码器，则可以使用色度去环滤镜。要设置滤镜，请使用下列值之一：</p>
     
     <ul class="- topic/ul "><li class="- topic/li ">0 － 允许视频压缩程序根据需要应用消除马赛克的滤镜。</li><li class="- topic/li ">1 － 不使用消除马赛克的滤镜。</li><li class="- topic/li ">2 － 使用 Sorenson 消除马赛克的滤镜。</li><li class="- topic/li ">3 －（只限 On2 视频）使用 On2 消除马赛克的滤镜，但不使用色度去环滤镜。</li><li class="- topic/li ">4 －（只限 On2 视频）使用 On2 消除马赛克的滤镜和色度去环滤镜。</li><li class="- topic/li ">5 － （只限 On2 视频）使用 On2 消除马赛克的滤镜和性能更高的 On2 色度去环滤镜。</li></ul>
     
     <p class="- topic/p ">如果在使用 Sorenson 编解码器时为视频选择了大于 2 的值，则 Sorenson 解码器默认为 2。</p>
     
     <p class="- topic/p ">使用消除马赛克的滤镜会影响整体回放性能，而且对于高带宽视频通常没有必要。如果用户系统的功能不够强大，则用户在启用消除马赛克的滤镜的情况下回放视频可能会有困难。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:Video:smoothing: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 ">smoothing</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 ">Camera, video, Video.smoothing, smoothing
      
      </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 ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
     指定在缩放视频时是否应进行平滑处理（插补数据）。为顺畅工作，运行时必须处于高品质模式（默认值）。默认值是 <codeph class="+ topic/ph pr-d/codeph ">false</codeph>（不进行平滑处理）。
     <p class="- topic/p ">对于使用 Flash Player 9.0.115.0 及更高版本进行的视频回放，请将此属性设置为 <codeph class="+ topic/ph pr-d/codeph ">true</codeph> 以利用 mipmap 图像优化。</p>
     
     </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:Video:videoHeight: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 ">videoHeight</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 ">Camera, video, Video.height, height
      
      </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
      一个整数，以像素为单位指定视频流的高度。对于实时流，此值与正在捕获该视频流的 Camera 对象的 <codeph class="+ topic/ph pr-d/codeph ">Camera.height</codeph> 属性相同。对于录制的视频文件，此值为视频高度。
     <p class="- topic/p ">例如，您可能需要使用此属性来确保用户以捕获时的相同大小观看视频，而无论 Video 对象在舞台上的实际大小是什么。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/height" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Camera.height</linktext></link></related-links></apiValue><apiValue id="flash.media:Video:videoWidth: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 ">videoWidth</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 ">Camera, video, Video.width, width
      
      </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 ">int</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
      一个整数，以像素为单位指定视频流的宽度。对于实时流，此值与正在捕获该视频流的 Camera 对象的 <codeph class="+ topic/ph pr-d/codeph ">Camera.width</codeph> 属性相同。对于录制的视频文件，此值为视频宽度。
     
     <p class="- topic/p ">例如，您可能需要使用此属性来确保用户以捕获时的相同大小观看视频，而无论 Video 对象在舞台上的实际大小是什么。</p>
     
     </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/width" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Camera.width</linktext></link></related-links></apiValue></apiClassifier></apiPackage>