PageRenderTime 431ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 3ms

/frameworks/projects/playerglobal/bundles/en_US/docs/flash.media.xml

https://github.com/adufilie/flex-sdk
XML | 3292 lines | 2671 code | 603 blank | 18 comment | 0 complexity | 398e875f47a89b5b98f6be69ec66f0de MD5 | raw file
Possible License(s): Apache-2.0
  1. <?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 ">
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. The ID3Info class contains properties that reflect ID3 metadata.</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 ">
  17. The ID3Info class contains properties that reflect ID3 metadata. You can get additional
  18. metadata for MP3 files by accessing the <codeph class="+ topic/ph pr-d/codeph ">id3</codeph>
  19. property of the Sound class; for example, <codeph class="+ topic/ph pr-d/codeph ">mySound.id3.TIME</codeph>.
  20. For more information, see the entry for <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> and
  21. the ID3 tag definitions at <xref href="http://www.id3.org" class="- topic/xref ">http://www.id3.org</xref>.
  22. </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 ">
  23. The name of the album; corresponds to the ID3 2.0 tag 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 ">
  24. The name of the album; corresponds to the ID3 2.0 tag TALB.
  25. </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 ">
  26. The name of the artist; corresponds to the ID3 2.0 tag 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 ">
  27. The name of the artist; corresponds to the ID3 2.0 tag TPE1.
  28. </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 ">
  29. A comment about the recording; corresponds to the ID3 2.0 tag 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 ">
  30. A comment about the recording; corresponds to the ID3 2.0 tag COMM.
  31. </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 ">
  32. The genre of the song; corresponds to the ID3 2.0 tag 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 ">
  33. The genre of the song; corresponds to the ID3 2.0 tag TCON.
  34. </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 ">
  35. The name of the song; corresponds to the ID3 2.0 tag 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 ">
  36. The name of the song; corresponds to the ID3 2.0 tag TIT2.
  37. </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 ">
  38. The track number; corresponds to the ID3 2.0 tag 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 ">
  39. The track number; corresponds to the ID3 2.0 tag TRCK.
  40. </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 ">
  41. The year of the recording; corresponds to the ID3 2.0 tag 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 ">
  42. The year of the recording; corresponds to the ID3 2.0 tag TYER.
  43. </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 ">
  44. The MediaType class enumerates the general types of media that can be returned by a 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="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 ">
  45. The MediaType class enumerates the general types of media that can be returned by a camera.
  46. <p class="- topic/p ">Use the constants defined in this class as input to the <codeph class="+ topic/ph pr-d/codeph ">launch()</codeph> method
  47. of the CameraUI class. MediaType values are also used in the <codeph class="+ topic/ph pr-d/codeph ">mediaType</codeph> property
  48. of the MediaPromise class.</p>
  49. </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 ">
  50. A single image.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  51. A single image.
  52. </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 ">
  53. A 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="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 ">
  54. A video.
  55. </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 ">
  56. Forces a rescan of the microphones and cameras on the system.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">
  57. Forces a rescan of the microphones and cameras on the system.
  58. </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 ">
  59. Use the Camera class to capture video from the client system's 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
  60. </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 ">
  61. Use the Camera class to capture video from the client system's camera.
  62. Use the Video class to monitor the video locally.
  63. Use the NetConnection and NetStream classes to transmit the video to Flash Media Server.
  64. Flash Media Server can send the video stream to other servers and broadcast it to other clients running Flash Player.
  65. <p class="- topic/p ">A Camera instance captures video in landscape aspect ratio. On devices that can change the screen orientation,
  66. such as mobile phones, a Video object attached to the camera will only show upright video in a landscape-aspect orientation.
  67. Thus, mobile apps should use a landscape orientation when displaying video and should not auto-rotate.</p>
  68. <p class="- topic/p ">As of AIR 2.6, autofocus is enabled automatically on mobile devices with an autofocus camera. If the camera does not support continuous autofocus,
  69. and many mobile device cameras do not, then the camera is focused when the Camera object is attached to a video stream and whenever
  70. the <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> method is called. On desktop computers, autofocus behavior is dependent on the camera driver and settings.</p>
  71. <p class="- topic/p ">In an AIR application on Android and iOS, the camera does not capture video while an AIR app is not the active, foreground application.
  72. In addition, streaming connections can be lost when the application is in the background. On iOS, the camera video cannot be
  73. displayed when an application uses the GPU rendering mode. The camera video can still be streamed to a server.</p>
  74. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Mobile Browser Support:</b> This class is not supported in mobile browsers.</p>
  75. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> This feature is supported
  76. on desktop operating systems, but it is not supported on all mobile devices. It is not
  77. supported on AIR for TV devices. See
  78. <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
  79. AIR Profile Support</xref> for more information regarding API support across multiple profiles.</p>
  80. <p class="- topic/p ">You can test
  81. for support at run time using the <codeph class="+ topic/ph pr-d/codeph ">Camera.isSupported</codeph> property.
  82. Note that for AIR for TV devices, <codeph class="+ topic/ph pr-d/codeph ">Camera.isSupported</codeph> is <codeph class="+ topic/ph pr-d/codeph ">true</codeph> but
  83. <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> always returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.</p>
  84. <p class="- topic/p ">
  85. For information about capturing audio, see the Microphone class.
  86. </p>
  87. <p class="- topic/p ">
  88. <b class="+ topic/ph hi-d/b ">Important: </b>Flash Player displays a Privacy dialog box that lets the user choose whether
  89. to allow or deny access to the camera. Make sure your application window size is at least 215 x 138 pixels;
  90. this is the minimum size required to display the dialog box.
  91. </p>
  92. <p class="- topic/p ">To create or reference a Camera object, use the <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> method.</p>
  93. </apiDesc><example conref="examples\CameraExample.as" class="- topic/example "> The following example shows the image from a camera after acknowledging the
  94. security warning. The Stage is set such that it cannot be scaled and is aligned to the
  95. top-left of the player window. The <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event is dispatched at the
  96. start and end (if any) of the session and is captured by the <codeph class="+ topic/ph pr-d/codeph ">activityHandler()</codeph>
  97. method, which prints out information about the event.
  98. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> A camera must be attached to your computer for this example
  99. to work correctly.</p>
  100. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  101. package {
  102. import flash.display.Sprite;
  103. import flash.display.StageAlign;
  104. import flash.display.StageScaleMode;
  105. import flash.events.*;
  106. import flash.media.Camera;
  107. import flash.media.Video;
  108. public class CameraExample extends Sprite {
  109. private var video:Video;
  110. public function CameraExample() {
  111. stage.scaleMode = StageScaleMode.NO_SCALE;
  112. stage.align = StageAlign.TOP_LEFT;
  113. var camera:Camera = Camera.getCamera();
  114. if (camera != null) {
  115. camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
  116. video = new Video(camera.width * 2, camera.height * 2);
  117. video.attachCamera(camera);
  118. addChild(video);
  119. } else {
  120. trace("You need a camera.");
  121. }
  122. }
  123. private function activityHandler(event:ActivityEvent):void {
  124. trace("activityHandler: " + event);
  125. }
  126. }
  127. }
  128. </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: Video Chat for Android in 30 Lines of Code</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, and the Camera</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 ">
  129. Dispatched when a camera reports its status.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">
  130. Dispatched when a camera reports its status.
  131. Before accessing a camera, Flash Player displays a Privacy dialog box to let users
  132. allow or deny access to their camera. If the value of the <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">"Camera.Muted"</codeph>,
  133. the user has refused to allow the SWF file access to the user's camera.
  134. If the value of the <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">"Camera.Unmuted"</codeph>,
  135. the user has allowed the SWF file access to the user's camera.
  136. </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 ">
  137. Dispatched when a camera begins or ends a session.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">
  138. Dispatched when a camera begins or ends a session.
  139. Call <codeph class="+ topic/ph pr-d/codeph ">Camera.setMotionLevel()</codeph> to specify the amount of motion
  140. required to trigger an <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event with an <codeph class="+ topic/ph pr-d/codeph ">activating</codeph>
  141. value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph>, or the time without activity
  142. that must elapse before triggering an <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event with an <codeph class="+ topic/ph pr-d/codeph ">activating</codeph>
  143. value of <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
  144. </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 ">
  145. Returns a reference to a Camera object for capturing 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, constructor, Camera.getCamera, getCamera
  146. </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 ">If the <codeph class="+ topic/ph pr-d/codeph ">name</codeph> parameter is not specified, this method returns a reference
  147. to the default camera or, if it is in use by another application, to the first
  148. available camera. (If there is more than one camera installed, the user may specify
  149. the default camera in the Flash Player Camera Settings panel.) If no cameras are available
  150. or installed, the method returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.
  151. </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 ">Specifies which camera to get, as determined from the array
  152. returned by the <codeph class="+ topic/ph pr-d/codeph ">names</codeph> property. For most applications, get the default camera
  153. by omitting this parameter. To specify a value for this parameter, use the string representation
  154. of the zero-based index position within the Camera.names array. For example, to specify the third
  155. camera in the array, use <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera("2")</codeph>.
  156. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  157. Returns a reference to a Camera object for capturing video. To begin capturing
  158. the video, you must attach the Camera object to a Video object (see <codeph class="+ topic/ph pr-d/codeph ">Video.attachCamera()
  159. </codeph>). To transmit video to Flash Media Server, call <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachCamera()</codeph>
  160. to attach the Camera object to a NetStream object.
  161. <p class="- topic/p ">Multiple calls to the <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> method reference the same camera driver.
  162. Thus, if your code contains code like <codeph class="+ topic/ph pr-d/codeph ">firstCam:Camera = getCamera()</codeph>
  163. and <codeph class="+ topic/ph pr-d/codeph ">secondCam:Camera = getCamera()</codeph>,
  164. both <codeph class="+ topic/ph pr-d/codeph ">firstCam</codeph> and <codeph class="+ topic/ph pr-d/codeph ">secondCam</codeph> reference the same camera,
  165. which is the user's default camera.</p>
  166. <p class="- topic/p ">On iOS devices with a both a front- and a rear-facing camera, you can only capture
  167. video from one camera at a time. On Android devices, you can only access the rear-facing camera.</p>
  168. <p class="- topic/p ">In general, you shouldn't pass a value for the <codeph class="+ topic/ph pr-d/codeph ">name</codeph> parameter; simply use
  169. <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> to return a reference to the default camera. By means of the Camera
  170. settings panel (discussed later in this section), the user can specify the default camera
  171. to use. </p>
  172. <p class="- topic/p ">You can't use ActionScript to set a user's Allow or Deny permission setting
  173. for access to the camera, but you can display the Adobe Flash Player Settings camera
  174. setting dialog box where the user can set the camera permission. When a SWF file using
  175. the <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> method tries to
  176. attach the camera returned by the <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> method to a Video or
  177. NetStream object, Flash Player displays a dialog box that lets the user choose
  178. to allow or deny access to the camera. (Make sure your application window size is at least
  179. 215 x 138 pixels; this is the minimum size Flash Player requires to display the dialog box.)
  180. When the user responds to the camera setting dialog box, Flash Player returns an
  181. information object in the <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event that indicates the user's response:
  182. <codeph class="+ topic/ph pr-d/codeph ">Camera.muted</codeph> indicates
  183. the user denied access to a camera; <codeph class="+ topic/ph pr-d/codeph ">Camera.Unmuted</codeph> indicates the user allowed access
  184. to a camera. To determine whether the user has denied or allowed access to the camera without
  185. handling the <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event, use the <codeph class="+ topic/ph pr-d/codeph ">muted</codeph> property.</p>
  186. <p class="- topic/p ">In Flash Player, the user can specify permanent privacy settings for a particular domain by right-clicking
  187. (Windows and Linux) or Control-clicking (Macintosh) while a SWF file is playing, selecting Settings,
  188. opening the Privacy dialog, and selecting Remember. If the user selects Remember, Flash Player no longer
  189. asks the user whether to allow or deny SWF files from this domain access to your camera.</p>
  190. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> The <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> method will not invoke the dialog box
  191. to Allow or Deny access to the camera if the user has denied access by selecting Remember
  192. in the Flash Player Settings dialog box. In this case, you can prompt the user to change the
  193. Allow or Deny setting by displaying the Flash Player Privacy panel for the user
  194. using <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings(SecurityPanel.PRIVACY)</codeph>.</p>
  195. <p class="- topic/p ">If <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>, either the camera is in use by another
  196. application, or there are no cameras installed on the system. To determine whether any cameras
  197. are installed, use the <codeph class="+ topic/ph pr-d/codeph ">names.length</codeph> property. To display the Flash Player Camera Settings panel,
  198. which lets the user choose the camera to be referenced by <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph>, use
  199. <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings(SecurityPanel.CAMERA)</codeph>. </p>
  200. <p class="- topic/p ">Scanning the hardware for cameras takes time. When the runtime finds at least one camera,
  201. the hardware is not scanned again for the lifetime of the player instance. However, if
  202. the runtime doesn't find any cameras, it will scan each time <codeph class="+ topic/ph pr-d/codeph ">getCamera</codeph> is called.
  203. This is helpful if the camera is present but is disabled; if your SWF file provides a
  204. Try Again button that calls <codeph class="+ topic/ph pr-d/codeph ">getCamera</codeph>, Flash Player can find the camera without the
  205. user having to restart the SWF file.</p>
  206. </apiDesc><example conref="examples\Camera_getCameraExample.as" class="- topic/example "> In the following example, after the user allows access to the camera, the attached
  207. camera is used to capture video images. Information about the video stream, such as
  208. the current frames per second, is also displayed.
  209. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> method returns a reference to a camera object, or returns null if
  210. no camera is available or installed. The if statement checks whether the camera was found and whether
  211. the user allowed access to the camera. If the user denied access, the <codeph class="+ topic/ph pr-d/codeph ">muted</codeph>
  212. property is set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>.</p>
  213. <p class="- topic/p ">Usually, when the <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> method is invoked, a dialog box appears and prompts the
  214. user to allow or deny Flash Player access to the camera. However, if the user denied access
  215. and selected the <codeph class="+ topic/ph pr-d/codeph ">Remember</codeph> option, the dialog box does not appear and nothing displays.
  216. To make sure the user has the option to allow access to the camera, the <codeph class="+ topic/ph pr-d/codeph ">myTextField</codeph> text field
  217. instructs the user to click the text field to invoke the Flash Player Settings dialog box.</p>
  218. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method calls <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings()</codeph> method, which
  219. displays the <codeph class="+ topic/ph pr-d/codeph ">PRIVACY</codeph> panel of the Settings dialog box. If the user allows access,
  220. the <codeph class="+ topic/ph pr-d/codeph ">StatusEvent.STATUS</codeph> event is dispatched and the value of the event's <codeph class="+ topic/ph pr-d/codeph ">code</codeph>
  221. property is set to <codeph class="+ topic/ph pr-d/codeph ">Camera.Unmuted</codeph>. (The camera object's <codeph class="+ topic/ph pr-d/codeph ">mute</codeph> property is also
  222. set to <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.)</p>
  223. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">statusHandler()</codeph> method, added to listen to the status change of the user's setting,
  224. invokes the <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> method, if the user allows access. The <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph>
  225. method instantiates a video object with the captured stream's width and height. To display the
  226. camera's captured video, the reference to the video stream is attached to the video object, and the video
  227. object is added to the display list.</p>
  228. <p class="- topic/p ">A Timer object also is started. Every second, a Timer object's timer event is dispatched and the
  229. <codeph class="+ topic/ph pr-d/codeph ">timerHandler()</codeph> method is invoked. The <codeph class="+ topic/ph pr-d/codeph ">timerHandler()</codeph> method is displayed and updates
  230. a number of properties of the Camera object. </p>
  231. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> For this example, the only property that changes
  232. is the <codeph class="+ topic/ph pr-d/codeph ">currentFPS</codeph> property.</p>
  233. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  234. package {
  235. import flash.display.Sprite;
  236. import flash.media.Camera;
  237. import flash.media.Video;
  238. import flash.text.TextField;
  239. import flash.text.TextFieldAutoSize;
  240. import flash.utils.Timer;
  241. import flash.events.TimerEvent;
  242. import flash.events.StatusEvent;
  243. import flash.events.MouseEvent;
  244. import flash.system.SecurityPanel;
  245. import flash.system.Security;
  246. public class Camera_getCameraExample extends Sprite {
  247. private var myTextField:TextField;
  248. private var cam:Camera;
  249. private var t:Timer = new Timer(1000);
  250. public function Camera_getCameraExample() {
  251. myTextField = new TextField();
  252. myTextField.x = 10;
  253. myTextField.y = 10;
  254. myTextField.background = true;
  255. myTextField.selectable = false;
  256. myTextField.autoSize = TextFieldAutoSize.LEFT;
  257. if (Camera.isSupported)
  258. {
  259. cam = Camera.getCamera();
  260. if (!cam) {
  261. myTextField.text = "No camera is installed.";
  262. } else if (cam.muted) {
  263. myTextField.text = "To enable the use of the camera,\n"
  264. + "please click on this text field.\n"
  265. + "When the Flash Player Settings dialog appears,\n"
  266. + "make sure to select the Allow radio button\n"
  267. + "to grant access to your camera.";
  268. myTextField.addEventListener(MouseEvent.CLICK, clickHandler);
  269. }else {
  270. myTextField.text = "Connecting";
  271. connectCamera();
  272. }
  273. addChild(myTextField);
  274. t.addEventListener(TimerEvent.TIMER, timerHandler);
  275. }else {
  276. myTextField.text = "The Camera class is not supported on this device.";
  277. }
  278. }
  279. private function clickHandler(e:MouseEvent):void {
  280. Security.showSettings(SecurityPanel.PRIVACY);
  281. cam.addEventListener(StatusEvent.STATUS, statusHandler);
  282. myTextField.removeEventListener(MouseEvent.CLICK, clickHandler);
  283. }
  284. private function statusHandler(event:StatusEvent):void {
  285. if (event.code == "Camera.Unmuted") {
  286. connectCamera();
  287. cam.removeEventListener(StatusEvent.STATUS, statusHandler);
  288. }
  289. }
  290. private function connectCamera():void {
  291. var vid:Video = new Video(cam.width, cam.height);
  292. vid.x = 10;
  293. vid.y = 10;
  294. vid.attachCamera(cam);
  295. addChild(vid);
  296. t.start();
  297. }
  298. private function timerHandler(event:TimerEvent):void {
  299. myTextField.y = cam.height + 20;
  300. myTextField.text = "";
  301. myTextField.appendText("bandwidth: " + cam.bandwidth + "\n");
  302. myTextField.appendText("currentFPS: " + Math.round(cam.currentFPS) + "\n");
  303. myTextField.appendText("fps: " + cam.fps + "\n");
  304. myTextField.appendText("keyFrameInterval: " + cam.keyFrameInterval + "\n");
  305. }
  306. }
  307. }
  308. </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 ">Dispatched when a camera reports its status.
  309. Before accessing a camera, Flash Player displays a Privacy dialog box to let users
  310. allow or deny access to their camera. If the value of the <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">"Camera.muted"</codeph>,
  311. the user has refused to allow the SWF file access to the user's camera.
  312. If the value of the <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">"Camera.Unmuted"</codeph>,
  313. the user has allowed the SWF file access to the user's camera.
  314. </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">Dispatched when a camera reports its status.</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 ">
  315. Specifies which video frames are transmitted in full (called keyframes)
  316. instead of being interpolated by the video compression algorithm.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">A value that specifies which video frames are transmitted in full
  317. (as keyframes) instead of being interpolated by the video compression algorithm.
  318. A value of 1 means that every frame is a keyframe, a value of 3 means that every third frame
  319. is a keyframe, and so on. Acceptable values are 1 through 48.
  320. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  321. Specifies which video frames are transmitted in full (called <i class="+ topic/ph hi-d/i ">keyframes</i>)
  322. instead of being interpolated by the video compression algorithm. This method
  323. is applicable only if you are transmitting video using Flash Media Server.
  324. <p class="- topic/p ">The Flash Video compression algorithm compresses video by transmitting
  325. only what has changed since the last frame of the video; these portions are
  326. considered to be interpolated frames. Frames of a video can be interpolated according
  327. to the contents of the previous frame. A keyframe, however, is a video frame that
  328. is complete; it is not interpolated from prior frames.</p>
  329. <p class="- topic/p ">To determine how to set a value for the <codeph class="+ topic/ph pr-d/codeph ">keyFrameInterval</codeph> parameter,
  330. consider both bandwidth use and video playback accessibility. For example,
  331. specifying a higher value for <codeph class="+ topic/ph pr-d/codeph ">keyFrameInterval</codeph> (sending keyframes less frequently)
  332. reduces bandwidth use.
  333. However, this may increase the amount of time required to position the playhead
  334. at a particular point in the video; more prior video frames may have to be interpolated
  335. before the video can resume.</p>
  336. <p class="- topic/p ">Conversely, specifying a lower value for <codeph class="+ topic/ph pr-d/codeph ">keyFrameInterval</codeph>
  337. (sending keyframes more frequently) increases bandwidth use because entire video frames
  338. are transmitted more often, but may decrease the amount of time required to seek a
  339. particular video frame within a recorded video.</p>
  340. </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 ">
  341. Specifies whether to use a compressed video stream for a local view of the 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></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 ">Specifies whether to use a compressed video stream (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>)
  342. or an uncompressed stream (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>) for a local view of what the camera
  343. is receiving.
  344. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  345. Specifies whether to use a compressed video stream for a local view of the camera.
  346. This method is applicable only if you are transmitting video using Flash Media Server;
  347. setting <codeph class="+ topic/ph pr-d/codeph ">compress</codeph> to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> lets you see more precisely how the video
  348. will appear to users when they view it in real time.
  349. <p class="- topic/p ">Although a compressed stream is useful for testing purposes, such as previewing video
  350. quality settings, it has a significant processing cost, because the local view is not
  351. simply compressed; it is compressed, edited for transmission as it would be over a live
  352. connection, and then decompressed for local viewing.</p>
  353. <p class="- topic/p ">To set the amount of compression used when you set <codeph class="+ topic/ph pr-d/codeph ">compress</codeph> to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>,
  354. use <codeph class="+ topic/ph pr-d/codeph ">Camera.setQuality()</codeph>.</p>
  355. </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 ">
  356. Sets the camera capture mode to the native mode that best meets the specified requirements.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  357. </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 ">The requested capture width, in pixels. The default value is 160.
  358. </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 ">The requested capture height, in pixels. The default value is 120.
  359. </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 ">The requested rate at which the camera should capture data, in frames per second.
  360. The default value is 15.
  361. </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 ">Specifies whether to manipulate the width, height, and frame rate if
  362. the camera does not have a native mode that meets the specified requirements.
  363. The default value is <codeph class="+ topic/ph pr-d/codeph ">true</codeph>, which means that maintaining capture size
  364. is favored; using this parameter selects the mode that most closely matches
  365. <codeph class="+ topic/ph pr-d/codeph ">width</codeph> and <codeph class="+ topic/ph pr-d/codeph ">height</codeph> values, even if doing so adversely affects
  366. performance by reducing the frame rate. To maximize frame rate at the expense
  367. of camera height and width, pass <codeph class="+ topic/ph pr-d/codeph ">false</codeph> for the <codeph class="+ topic/ph pr-d/codeph ">favorArea</codeph> parameter.
  368. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  369. Sets the camera capture mode to the native mode that best meets the specified requirements.
  370. If the camera does not have a native mode that matches all the parameters you pass,
  371. Flash Player selects a capture mode that most closely synthesizes the requested mode.
  372. This manipulation may involve cropping the image and dropping frames.
  373. <p class="- topic/p ">By default, Flash Player drops frames as needed to maintain image size. To minimize the number
  374. of dropped frames, even if this means reducing the size of the image, pass <codeph class="+ topic/ph pr-d/codeph ">false</codeph>
  375. for the <codeph class="+ topic/ph pr-d/codeph ">favorArea</codeph> parameter.</p>
  376. <p class="- topic/p ">When choosing a native mode, Flash Player tries to maintain the requested aspect ratio
  377. whenever possible. For example, if you issue the command <codeph class="+ topic/ph pr-d/codeph ">myCam.setMode(400, 400, 30)</codeph>,
  378. and the maximum width and height values available on the camera are 320 and 288, Flash Player sets
  379. both the width and height at 288; by setting these properties to the same value, Flash Player
  380. maintains the 1:1 aspect ratio you requested.</p>
  381. <p class="- topic/p ">To determine the values assigned to these properties after Flash Player selects the mode
  382. that most closely matches your requested values, use the <codeph class="+ topic/ph pr-d/codeph ">width</codeph>, <codeph class="+ topic/ph pr-d/codeph ">height</codeph>,
  383. and <codeph class="+ topic/ph pr-d/codeph ">fps</codeph> properties.</p>
  384. <p class="- topic/p ">
  385. If you are using Flash Media Server, you can also capture single frames or create time-lapse
  386. photography. For more information, see <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachCamera()</codeph>.
  387. </p>
  388. </apiDesc><example conref="examples\Camera_setModeExample.as" class="- topic/example "> In the following example, when a user clicks on the Stage, the video
  389. is resized and the frames per second capture rate is set to a new value.
  390. <p class="- topic/p ">The Stage is set so it does not scale. The <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> method
  391. returns a reference to a camera object, or returns null if no camera is available or installed.
  392. If a camera exists, the <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> method is called.
  393. The <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> method instantiates a video object. To
  394. display the camera's captured video, the reference to the video stream is attached
  395. to the video object, and the video object is added to the display list. An event listener
  396. also is set for a <codeph class="+ topic/ph pr-d/codeph ">MouseEvent.CLICK</codeph> event. After the user clicks on the Stage,
  397. the <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method is invoked. The method checks the width of the
  398. captured video and sets the camera capture mode's width, height, and the frame per second
  399. request rate. In order for these setting to take effect, the video object must be removed
  400. and re-created. The video's width and height also must be set to the camera object's width
  401. and height.</p>
  402. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  403. package {
  404. import flash.display.Sprite;
  405. import flash.media.Camera;
  406. import flash.media.Video;
  407. import flash.events.MouseEvent;
  408. import flash.display.StageScaleMode;
  409. public class Camera_setModeExample extends Sprite {
  410. private var cam:Camera;
  411. private var vid:Video;
  412. public function Camera_setModeExample() {
  413. stage.scaleMode = StageScaleMode.NO_SCALE;
  414. cam = Camera.getCamera();
  415. if (!cam) {
  416. trace("No camera is installed.");
  417. }else {
  418. connectCamera();
  419. }
  420. }
  421. private function connectCamera():void {
  422. vid = new Video();
  423. vid.width = cam.width;
  424. vid.height = cam.height;
  425. vid.attachCamera(cam);
  426. addChild(vid);
  427. stage.addEventListener(MouseEvent.CLICK, clickHandler);
  428. }
  429. private function clickHandler(e:MouseEvent):void {
  430. switch (cam.width) {
  431. case 160:
  432. cam.setMode(320, 240, 10);
  433. break;
  434. case 320:
  435. cam.setMode(640, 480, 5);
  436. break;
  437. default:
  438. cam.setMode(160, 120, 15);
  439. break;
  440. }
  441. removeChild(vid);
  442. connectCamera();
  443. }
  444. }
  445. }
  446. </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 ">
  447. Specifies how much motion is required to dispatch the activity event.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  448. </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 ">Specifies the amount of motion required to dispatch the
  449. <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event. Acceptable values range from 0 to 100. The default value is 50.
  450. </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 ">Specifies how many milliseconds must elapse without activity
  451. before Flash Player considers activity to have stopped and dispatches the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event.
  452. The default value is 2000 milliseconds (2 seconds).
  453. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  454. Specifies how much motion is required to dispatch the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event.
  455. Optionally sets the number of milliseconds that must elapse without activity before
  456. Flash Player considers motion to have stopped and dispatches the event.
  457. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note: </b>Video can be displayed regardless of the value of the
  458. <codeph class="+ topic/ph pr-d/codeph ">motionLevel</codeph> parameter. This parameter determines only when and under
  459. what circumstances the event is dispatched—not whether video is actually being
  460. captured or displayed.</p>
  461. <p class="- topic/p ">
  462. To prevent the camera from detecting motion at all, pass a value of 100 for the
  463. <codeph class="+ topic/ph pr-d/codeph ">motionLevel</codeph> parameter; the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event is never dispatched.
  464. (You would probably use this value only for testing purposes—for example, to
  465. temporarily disable any handlers that would normally be triggered when the event is dispatched.)
  466. </p>
  467. <p class="- topic/p ">
  468. To determine the amount of motion the camera is currently detecting, use the
  469. <codeph class="+ topic/ph pr-d/codeph ">activityLevel</codeph> property.
  470. Motion sensitivity values correspond directly to activity values.
  471. Complete lack of motion is an activity value of 0. Constant motion is an activity value of 100.
  472. Your activity value is less than your motion sensitivity value when you're not moving;
  473. when you are moving, activity values frequently exceed your motion sensitivity value.
  474. </p>
  475. <p class="- topic/p ">
  476. This method is similar in purpose to the <codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> method;
  477. both methods are used to specify when the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event
  478. should be dispatched. However, these methods have a significantly different impact
  479. on publishing streams:
  480. </p>
  481. <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> is designed to optimize bandwidth.
  482. When an audio stream is considered silent, no audio data is sent. Instead, a single message
  483. is sent, indicating that silence has started. </li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">Camera.setMotionLevel()</codeph> is designed to detect motion and does not affect
  484. bandwidth usage. Even if a video stream does not detect motion, video is still sent.</li></ul>
  485. </apiDesc><example conref="examples\Camera_setMotionLevelExample.as" class="- topic/example "> In the following example, the user's camera is used as a monitor or
  486. a surveillance camera. The camera detects motion and a text field shows
  487. the activity level. (The example can be extended to sound an alarm or
  488. send a message through a web service to other applications.)
  489. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> method returns a reference to a camera object,
  490. or returns null if no camera is available or installed. The if statement checks whether a camera
  491. is available, and invokes the <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> method when it is available.
  492. The <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> method instantiates a video object with the captured stream's
  493. width and height. To display the camera's captured video, the reference to the
  494. video stream is attached to the video object, and the video object is added to the display list.
  495. (Usually, when the <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> method is invoked, a dialog box appears and
  496. prompts the user to allow or deny Flash Player access to the camera. However, if the
  497. user denied access and selected the <codeph class="+ topic/ph pr-d/codeph ">Remember</codeph> option, the dialog box does not appear
  498. and nothing is displayed. To make sure the user has the option to allow access to the camera, use the
  499. <codeph class="+ topic/ph pr-d/codeph ">system.Security.showSettings()</codeph> method to invoke the Flash Player
  500. Settings dialog box.)</p>
  501. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">setMotionLevel()</codeph> method sets the level of activity (amount of motion), before
  502. the activity event is invoked, to five, for minimal motion. The time between when the camera stops
  503. detecting motion and when the activity event is invoked, is set to 1 second (1000 millisecond). After 1 second
  504. passes without activity or the level of activity reaches five, the <codeph class="+ topic/ph pr-d/codeph ">ActivityEvent.ACTIVITY</codeph>
  505. event is dispatched and the <codeph class="+ topic/ph pr-d/codeph ">activityHandler()</codeph> method is invoked. If the event
  506. was triggered by the level of activity, the <codeph class="+ topic/ph pr-d/codeph ">activating</codeph> property is set to
  507. <codeph class="+ topic/ph pr-d/codeph ">true</codeph> and a Timer object is started. Every second, a Timer object’s timer event
  508. is dispatched and the <codeph class="+ topic/ph pr-d/codeph ">timerHandler()</codeph> method is invoked, which displays the current
  509. level of activity. (Although a level of five or larger triggers the timer, the displayed
  510. current level of activity might be a smaller number.)</p>
  511. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  512. package {
  513. import flash.display.Sprite;
  514. import flash.media.Camera;
  515. import flash.media.Video;
  516. import flash.text.TextField;
  517. import flash.text.TextFieldAutoSize;
  518. import flash.utils.Timer;
  519. import flash.events.TimerEvent;
  520. import flash.events.ActivityEvent;
  521. public class Camera_setMotionLevelExample extends Sprite {
  522. private var myTextField:TextField;
  523. private var cam:Camera;
  524. private var t:Timer = new Timer(1000);
  525. public function Camera_setMotionLevelExample() {
  526. myTextField = new TextField();
  527. myTextField.background = true;
  528. myTextField.selectable = false;
  529. myTextField.autoSize = TextFieldAutoSize.LEFT;
  530. cam = Camera.getCamera();
  531. if (!cam) {
  532. myTextField.text = "No camera is installed.";
  533. }else {
  534. myTextField.text = "Waiting to connect.";
  535. connectCamera();
  536. }
  537. addChild(myTextField);
  538. t.addEventListener(TimerEvent.TIMER, timerHandler);
  539. }
  540. private function connectCamera():void {
  541. var vid:Video = new Video(cam.width, cam.height);
  542. vid.x = 10;
  543. vid.y = 10;
  544. vid.attachCamera(cam);
  545. addChild(vid);
  546. cam.setMotionLevel(5, 1000);
  547. cam.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
  548. }
  549. private function activityHandler(e:ActivityEvent):void {
  550. if (e.activating == true) {
  551. t.start();
  552. } else {
  553. myTextField.text = "Everything is quiet.";
  554. t.stop();
  555. }
  556. }
  557. private function timerHandler(event:TimerEvent):void {
  558. myTextField.x = 10;
  559. myTextField.y = cam.height + 20;
  560. myTextField.text = "There is some activity. Level: " + cam.activityLevel;
  561. }
  562. }
  563. }
  564. </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 ">
  565. Sets the maximum amount of bandwidth per second or the required picture quality
  566. of the current outgoing video feed.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  567. </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 ">Specifies the maximum amount of bandwidth that the current outgoing video
  568. feed can use, in bytes per second. To specify that Flash Player video can use as much bandwidth
  569. as needed to maintain the value of <codeph class="+ topic/ph pr-d/codeph ">quality</codeph>, pass 0 for
  570. <codeph class="+ topic/ph pr-d/codeph ">bandwidth</codeph>. The default value is 16384.
  571. </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 ">An integer that specifies the required level of picture quality,
  572. as determined by the amount of compression being applied to each video frame.
  573. Acceptable values range from 1 (lowest quality, maximum compression) to 100 (highest
  574. quality, no compression). To specify that picture quality can vary as needed to avoid
  575. exceeding bandwidth, pass 0 for <codeph class="+ topic/ph pr-d/codeph ">quality</codeph>.
  576. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  577. Sets the maximum amount of bandwidth per second or the required picture quality
  578. of the current outgoing video feed. This method is generally applicable only if
  579. you are transmitting video using Flash Media Server.
  580. <p class="- topic/p ">Use this method to specify which element of the outgoing video feed is more
  581. important to your application—bandwidth use or picture quality.</p>
  582. <ul class="- topic/ul "><li class="- topic/li ">To indicate that bandwidth use takes precedence, pass a value for <codeph class="+ topic/ph pr-d/codeph ">bandwidth</codeph>
  583. and 0 for <codeph class="+ topic/ph pr-d/codeph ">quality</codeph>. Flash Player transmits video at the highest quality
  584. possible within the specified bandwidth. If necessary, Flash Player reduces picture
  585. quality to avoid exceeding the specified bandwidth. In general, as motion increases,
  586. quality decreases.</li><li class="- topic/li ">To indicate that quality takes precedence, pass 0 for <codeph class="+ topic/ph pr-d/codeph ">bandwidth</codeph>
  587. and a numeric value for <codeph class="+ topic/ph pr-d/codeph ">quality</codeph>. Flash Player uses as much bandwidth
  588. as required to maintain the specified quality. If necessary, Flash Player reduces the frame
  589. rate to maintain picture quality. In general, as motion increases, bandwidth use also
  590. increases.</li><li class="- topic/li ">To specify that both bandwidth and quality are equally important, pass numeric
  591. values for both parameters. Flash Player transmits video that achieves the specified quality
  592. and that doesn't exceed the specified bandwidth. If necessary, Flash Player reduces the
  593. frame rate to maintain picture quality without exceeding the specified bandwidth.</li></ul>
  594. </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 ">
  595. The amount of motion the camera is detecting.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  596. </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 ">
  597. The amount of motion the camera is detecting. Values range from 0 (no motion is being detected) to
  598. 100 (a large amount of motion is being detected). The value of this property can help you determine if you need to pass a setting
  599. to the <codeph class="+ topic/ph pr-d/codeph ">setMotionLevel()</codeph> method.
  600. <p class="- topic/p ">If the camera is available but is not yet being used because the
  601. <codeph class="+ topic/ph pr-d/codeph ">Video.attachCamera()</codeph> method has not been called, this property
  602. is set to -1.</p>
  603. <p class="- topic/p ">If you are streaming only uncompressed local video, this property is set only if you have assigned a function to the event
  604. handler. Otherwise, it is undefined.</p>
  605. </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 ">
  606. The maximum amount of bandwidth the current outgoing video feed can use, in bytes.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  607. </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 ">
  608. The maximum amount of bandwidth the current outgoing video feed can use, in bytes.
  609. A value of 0 means the feed can use as much bandwidth as needed to maintain the desired frame quality.
  610. <p class="- topic/p ">To set this property, use the <codeph class="+ topic/ph pr-d/codeph ">setQuality()</codeph> method.</p>
  611. </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 ">
  612. The rate at which the camera is capturing data, in frames per second.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  613. </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 ">
  614. The rate at which the camera is capturing data, in frames per second.
  615. This property cannot be set; however, you can use the <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> method
  616. to set a related property—<codeph class="+ topic/ph pr-d/codeph ">fps</codeph>—which specifies the maximum
  617. frame rate at which you would like the camera to capture data.
  618. </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 ">
  619. The maximum rate at which the camera can capture data, in frames per second.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  620. </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 ">
  621. The maximum rate at which the camera can capture data, in frames per second.
  622. The maximum rate possible depends on the capabilities of the camera; this frame rate may not be achieved.
  623. <ul class="- topic/ul "><li class="- topic/li ">To set a desired value for this property, use the <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> method.</li><li class="- topic/li ">To determine the rate at which the camera is currently capturing data, use the <codeph class="+ topic/ph pr-d/codeph ">currentFPS</codeph> property.</li></ul>
  624. </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 ">
  625. The current capture height, in pixels.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  626. </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 ">
  627. The current capture height, in pixels. To set a value for this property,
  628. use the <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> method.
  629. </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 ">
  630. A zero-based integer that specifies the index of the camera, as reflected in
  631. the array returned by the names property.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  632. </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 ">
  633. A zero-based integer that specifies the index of the camera, as reflected in
  634. the array returned by the <codeph class="+ topic/ph pr-d/codeph ">names</codeph> property.
  635. </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 ">
  636. The isSupported property is set to true if the
  637. Camera class is supported on the current platform, otherwise it is
  638. set to 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 ">
  639. The <codeph class="+ topic/ph pr-d/codeph ">isSupported</codeph> property is set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the
  640. Camera class is supported on the current platform, otherwise it is
  641. set to <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
  642. </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 ">
  643. The number of video frames transmitted in full (called keyframes)
  644. instead of being interpolated by the video compression algorithm.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">
  645. The number of video frames transmitted in full (called <i class="+ topic/ph hi-d/i ">keyframes</i>)
  646. instead of being interpolated by the video compression algorithm.
  647. The default value is 15, which means that every 15th frame is a keyframe.
  648. A value of 1 means that every frame is a keyframe. The allowed values are
  649. 1 through 48.
  650. </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 ">
  651. Indicates whether a local view of what the camera is capturing is compressed
  652. and decompressed (true), as it would be for live transmission using
  653. Flash Media Server, or uncompressed (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 ">
  654. Indicates whether a local view of what the camera is capturing is compressed
  655. and decompressed (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>), as it would be for live transmission using
  656. Flash Media Server, or uncompressed (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>). The default value is
  657. <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
  658. <p class="- topic/p ">
  659. Although a compressed stream is useful for testing, such as when previewing
  660. video quality settings, it has a significant processing cost. The local view
  661. is compressed, edited for transmission as it would be over a live connection,
  662. and then decompressed for local viewing.
  663. </p>
  664. <p class="- topic/p ">To set this value, use <codeph class="+ topic/ph pr-d/codeph ">Camera.setLoopback()</codeph>. To set the amount of
  665. compression used when this property is true, use <codeph class="+ topic/ph pr-d/codeph ">Camera.setQuality()</codeph>.</p>
  666. </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 ">
  667. The amount of motion required to invoke the activity event.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  668. </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 ">
  669. The amount of motion required to invoke the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event. Acceptable values range from 0 to 100.
  670. The default value is 50.
  671. <p class="- topic/p ">Video can be displayed regardless of the value of the <codeph class="+ topic/ph pr-d/codeph ">motionLevel</codeph> property. For more information, see <codeph class="+ topic/ph pr-d/codeph ">
  672. setMotionLevel()</codeph>.</p>
  673. </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 ">
  674. The number of milliseconds between the time the camera stops detecting motion and the time the activity event is invoked.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  675. </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 ">
  676. The number of milliseconds between the time the camera stops detecting motion and the time the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event is invoked. The
  677. default value is 2000 (2 seconds).
  678. <p class="- topic/p ">To set this value, use <codeph class="+ topic/ph pr-d/codeph ">setMotionLevel()</codeph>. </p>
  679. </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 ">
  680. A Boolean value indicating whether the user has denied access to the camera
  681. (true) or allowed access (false) in the Flash Player Privacy dialog box.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  682. </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 ">
  683. A Boolean value indicating whether the user has denied access to the camera
  684. (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>) or allowed access (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>) in the Flash Player Privacy dialog box.
  685. When this value changes, the <codeph class="+ topic/ph pr-d/codeph ">status</codeph>event is dispatched.
  686. </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 ">
  687. The name of the current camera, as returned by the camera hardware.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  688. </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 ">
  689. The name of the current camera, as returned by the camera hardware.
  690. </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 ">
  691. An array of strings indicating the names of all available cameras
  692. without displaying the Flash Player Privacy dialog box.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  693. </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 ">
  694. An array of strings indicating the names of all available cameras
  695. without displaying the Flash Player Privacy dialog box. This array behaves in the
  696. same way as any other ActionScript array, implicitly providing the zero-based
  697. index of each camera and the number of cameras on the system (by means of
  698. <codeph class="+ topic/ph pr-d/codeph ">names.length</codeph>). For more information, see the <codeph class="+ topic/ph pr-d/codeph ">names</codeph> Array class entry.
  699. <p class="- topic/p ">Calling the <codeph class="+ topic/ph pr-d/codeph ">names</codeph> property requires an extensive examination of the hardware.
  700. In most cases, you can just use the default camera.</p>
  701. <p class="- topic/p ">On Android, only one camera is supported, even if the device has more than one camera devices. The
  702. name of the camera is always, "Default."</p>
  703. </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 ">
  704. The required level of picture quality, as determined by the amount of compression being applied to each video
  705. frame.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  706. </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 ">
  707. The required level of picture quality, as determined by the amount of compression being applied to each video
  708. frame. Acceptable quality values range from 1 (lowest quality, maximum compression) to 100 (highest quality, no compression). The
  709. default value is 0, which means that picture quality can vary as needed to avoid exceeding available bandwidth.
  710. <p class="- topic/p ">To set this property, use the <codeph class="+ topic/ph pr-d/codeph ">setQuality()</codeph> method.</p>
  711. </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 ">
  712. The current capture width, in pixels.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  713. </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 ">
  714. The current capture width, in pixels. To set a desired value for this property,
  715. use the <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> method.
  716. </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 ">
  717. The SoundTransform class contains properties for volume and panning.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  718. </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 ">
  719. The SoundTransform class contains properties for volume and panning.
  720. </apiDesc><example conref="examples\SoundTransformExample.as" class="- topic/example "> The following example loads and plays an MP3 file. As the MP3 file plays,
  721. move the mouse or other user input device; the
  722. volume and panning change as you move the user input device over the Stage.
  723. To run this example, place a file named MySound.mp3 in the same directory as your SWF file.
  724. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  725. package {
  726. import flash.display.Sprite;
  727. import flash.display.StageAlign;
  728. import flash.display.StageScaleMode;
  729. import flash.events.*;
  730. import flash.media.Sound;
  731. import flash.media.SoundChannel;
  732. import flash.media.SoundTransform;
  733. import flash.net.URLRequest;
  734. import flash.utils.Timer;
  735. public class SoundTransformExample extends Sprite {
  736. private var url:String = "MySound.mp3";
  737. private var soundFactory:Sound;
  738. private var channel:SoundChannel;
  739. private var positionTimer:Timer;
  740. public function SoundTransformExample() {
  741. stage.align = StageAlign.TOP_LEFT;
  742. stage.scaleMode = StageScaleMode.NO_SCALE;
  743. var request:URLRequest = new URLRequest(url);
  744. soundFactory = new Sound();
  745. soundFactory.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
  746. soundFactory.load(request);
  747. channel = soundFactory.play();
  748. stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
  749. }
  750. private function ioErrorHandler(event:Event):void {
  751. trace("ioErrorHandler: " + event);
  752. }
  753. private function setPan(pan:Number):void {
  754. trace("setPan: " + pan.toFixed(2));
  755. var transform:SoundTransform = channel.soundTransform;
  756. transform.pan = pan;
  757. channel.soundTransform = transform;
  758. }
  759. private function setVolume(volume:Number):void {
  760. trace("setVolume: " + volume.toFixed(2));
  761. var transform:SoundTransform = channel.soundTransform;
  762. transform.volume = volume;
  763. channel.soundTransform = transform;
  764. }
  765. private function mouseMoveHandler(event:MouseEvent):void {
  766. var halfStage:uint = Math.floor(stage.stageWidth / 2);
  767. var xPos:uint = event.stageX;
  768. var yPos:uint = event.stageY;
  769. var value:Number;
  770. var pan:Number;
  771. if (xPos &gt; halfStage) {
  772. value = xPos / halfStage;
  773. pan = value - 1;
  774. } else if (xPos &lt; halfStage) {
  775. value = (xPos - halfStage) / halfStage;
  776. pan = value;
  777. } else {
  778. pan = 0;
  779. }
  780. var volume:Number = 1 - (yPos / stage.stageHeight);
  781. setVolume(volume);
  782. setPan(pan);
  783. }
  784. }
  785. }
  786. </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 ">
  787. Creates a SoundTransform object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  788. </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 ">The volume, ranging from 0 (silent) to 1 (full volume).
  789. </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 ">The left-to-right panning of the sound, ranging from -1 (full pan left)
  790. to 1 (full pan right). A value of 0 represents no panning (center).
  791. </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  792. Creates a SoundTransform object.
  793. </apiDesc><example conref="examples\SoundTransform_constructorExample.as" class="- topic/example "> In the following example, the sound plays only from the
  794. right channel, and the volume is set to 50 percent.
  795. <p class="- topic/p ">In the constructor, the sound is loaded and is assigned to a sound channel
  796. (<codeph class="+ topic/ph pr-d/codeph ">channel</codeph>). A SoundTranform object (<codeph class="+ topic/ph pr-d/codeph ">transform</codeph>) is also
  797. created. Its first argument sets the volume at 50 percent (the range is 0.0
  798. to 1.0). Its second argument sets the panning. In this example, panning is set to 1.0, which means
  799. the sound comes from the right speaker only. In order for these settings to
  800. take effect, the <codeph class="+ topic/ph pr-d/codeph ">transform</codeph> SoundTranform object is
  801. assigned to the sound channel's <codeph class="+ topic/ph pr-d/codeph ">souundTransform</codeph> property.</p>
  802. <p class="- topic/p "> <b class="+ topic/ph hi-d/b ">Note:</b> There is
  803. limited error handling written for this example.</p>
  804. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  805. package {
  806. import flash.display.Sprite;
  807. import flash.net.URLRequest;
  808. import flash.media.Sound;
  809. import flash.media.SoundChannel;
  810. import flash.media.SoundTransform;
  811. import flash.events.IOErrorEvent;
  812. public class SoundTransform_constructorExample extends Sprite
  813. {
  814. public function SoundTransform_constructorExample() {
  815. var mySound:Sound = new Sound();
  816. var url:URLRequest = new URLRequest("mySound.mp3");
  817. var channel:SoundChannel;
  818. var transform:SoundTransform = new SoundTransform(0.5, 1.0);
  819. mySound.load(url);
  820. channel = mySound.play();
  821. channel.soundTransform = transform;
  822. mySound.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
  823. }
  824. private function errorHandler(errorEvent:IOErrorEvent):void {
  825. trace("The sound could not be loaded: " + errorEvent.text);
  826. }
  827. }
  828. }
  829. </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 ">
  830. A value, from 0 (none) to 1 (all), specifying how much of the left input is played in the
  831. left speaker.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  832. </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 ">
  833. A value, from 0 (none) to 1 (all), specifying how much of the left input is played in the
  834. left speaker.
  835. </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 ">
  836. A value, from 0 (none) to 1 (all), specifying how much of the left input is played in the
  837. right speaker.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  838. </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 ">
  839. A value, from 0 (none) to 1 (all), specifying how much of the left input is played in the
  840. right speaker.
  841. </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 ">
  842. The left-to-right panning of the sound, ranging from -1 (full pan left)
  843. to 1 (full pan right).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  844. </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 ">
  845. The left-to-right panning of the sound, ranging from -1 (full pan left)
  846. to 1 (full pan right). A value of 0 represents no panning (balanced center between
  847. right and left).
  848. </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 ">
  849. A value, from 0 (none) to 1 (all), specifying how much of the right input is played in the
  850. left speaker.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  851. </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 ">
  852. A value, from 0 (none) to 1 (all), specifying how much of the right input is played in the
  853. left speaker.
  854. </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 ">
  855. A value, from 0 (none) to 1 (all), specifying how much of the right input is played in the
  856. right speaker.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  857. </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 ">
  858. A value, from 0 (none) to 1 (all), specifying how much of the right input is played in the
  859. right speaker.
  860. </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 ">
  861. The volume, ranging from 0 (silent) to 1 (full volume).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  862. </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 ">
  863. The volume, ranging from 0 (silent) to 1 (full volume).
  864. </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 ">
  865. This class defines an enumeration that indicates whether stage video is currently available.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">An enumeration that indicates whether stage video is currently available.
  866. </apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  867. This class defines an enumeration that indicates whether stage video is currently available.
  868. </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 ">
  869. Stage video is currently available.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Stage video is currently available.
  870. </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  871. Stage video is currently available.
  872. </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 ">
  873. Stage video is not currently available.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Stage video is not currently available.
  874. </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  875. Stage video is not currently available.
  876. </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 ">
  877. The StageWebView class displays HTML content in a stage view port.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  878. The StageWebView class displays HTML content in a stage view port.
  879. <p class="- topic/p ">The StageWebView class provides a simple means to display HTML content on
  880. devices where the HTMLLoader class is not supported. The class provides no
  881. interaction between ActionScript and the HTML content except through
  882. the methods and properties of the StageWebView class itself. There is, for example,
  883. no way to pass values or call functions between ActionScript and JavaScript.</p>
  884. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> This feature is supported
  885. on all desktop operating systems and mobile devices, but is not supported on AIR for TV devices. You can test
  886. for support at run time using the <codeph class="+ topic/ph pr-d/codeph ">StageWebView.isSupported</codeph> property. See
  887. <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
  888. AIR Profile Support</xref> for more information regarding API support across multiple profiles.</p>
  889. <p class="- topic/p ">On devices in the mobile and extended mobile profiles, the StageWebView class uses
  890. the system web control provided by the device operating system. Thus, the available
  891. features and rendering appearance may vary from device to device. On desktop computers (in the
  892. desktop and extended desktop profiles), the StageWebView class uses the internal AIR
  893. WebKit engine. The features available and rendering appearance are the same as those of the
  894. HTMLLoader class (without the close integration and script bridging between ActionScript and
  895. JavaScript provided by an HTMLLoader instance). Test the <codeph class="+ topic/ph pr-d/codeph ">isSupported</codeph> property
  896. of the StageWebView class to determine whether the class is supported on the current device.</p>
  897. <p class="- topic/p ">The StageWebView class is NOT a display object and cannot be added to the Flash display list.
  898. Instead you display a StageWebView object by attaching it directly to a stage using the
  899. <codeph class="+ topic/ph pr-d/codeph ">stage</codeph> property. The StageWebView instance attached to a stage is displayed on top
  900. of any Flash display objects. You control the size and position of the rendering area with the
  901. <codeph class="+ topic/ph pr-d/codeph ">viewPort</codeph> property. There is no way to control the depth ordering of different
  902. StageWebView objects. Overlapping two instances is not recommended.</p>
  903. <p class="- topic/p ">When the content within the StageWebView object has focus, the StageWebView object has the first
  904. opportunity to handle keyboard input. The stage to which the StageWebView object is attached
  905. dispatches any keyboard input that is not handled. The normal event capture/bubble cycle does not
  906. apply here since the StageWebView instance is not part of the display list.</p>
  907. <p class="- topic/p ">In Android 3.0+, an application must enable hardware acceleration in the Android manifestAdditions
  908. element of the AIR application descriptor to display plug-in content in a StageWebView object.</p>
  909. </apiDesc><example conref="examples\StageWebViewExample.1.as" class="- topic/example "> The following example sets up a StageWebView object to fill the stage. The example
  910. loads a web site with the <codeph class="+ topic/ph pr-d/codeph ">loadURL()</codeph> method and uses the device Back and Search
  911. softkeys for history navigation.
  912. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  913. package {
  914. import flash.display.MovieClip;
  915. import flash.media.StageWebView;
  916. import flash.geom.Rectangle;
  917. import flash.events.KeyboardEvent;
  918. import flash.ui.Keyboard;
  919. import flash.desktop.NativeApplication;
  920. public class StageWebViewExample extends MovieClip{
  921. private var webView:StageWebView = new StageWebView();
  922. public function StageWebViewExample()
  923. {
  924. webView.stage = this.stage;
  925. webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight );
  926. webView.loadURL( "http://www.example.com" );
  927. stage.addEventListener( KeyboardEvent.KEY_DOWN, onKey );
  928. }
  929. private function onKey( event:KeyboardEvent ):void
  930. {
  931. if( event.keyCode == Keyboard.BACK &amp;&amp; webView.isHistoryBackEnabled )
  932. {
  933. trace("Back.");
  934. webView.historyBack();
  935. event.preventDefault();
  936. }
  937. if( event.keyCode == Keyboard.SEARCH &amp;&amp; webView.isHistoryForwardEnabled )
  938. {
  939. trace("Forward.");
  940. webView.historyForward();
  941. }
  942. }
  943. }
  944. }
  945. </codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="../../flash/html/HTMLLoader.html" class="- topic/link "><linktext class="- topic/linktext ">HTMLLoader class</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: AIR on Android: 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 Support</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 ">Enabling Flash Player and other plug-ins in a StageWebView object</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 ">
  946. Dispatched when the StageWebView relinquishes focus.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  947. Dispatched when the StageWebView relinquishes focus.
  948. </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 ">
  949. Dispatched when this StageWebView object receives focus.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  950. Dispatched when this StageWebView object receives focus.
  951. </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 ">
  952. Signals that an error has occurred.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  953. Signals that an error has occurred.
  954. </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 ">
  955. Signals that the last load operation requested by loadString() or
  956. loadURL() method has completed.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">Signals that the last load operation requested by loadString() or
  957. load() method has completed.
  958. </apiTipText></apiTipTexts></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  959. Signals that the last load operation requested by <codeph class="+ topic/ph pr-d/codeph ">loadString()</codeph> or
  960. <codeph class="+ topic/ph pr-d/codeph ">loadURL()</codeph> method has completed.
  961. </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 ">
  962. Signals that the location property of the StageWebView object is about to change.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">Signals that the location property of the StageWebView object is about to change.
  963. </apiTipText></apiTipTexts></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  964. Signals that the <codeph class="+ topic/ph pr-d/codeph ">location</codeph> property of the StageWebView object is about to change.
  965. <p class="- topic/p ">A locationChanging event is only dispatched when the location change is initiated through
  966. HTML content or code running inside the StageWebView object,such as when a user clicks a link.
  967. By default, the new location is displayed in this
  968. StageWebView object. You can call the <codeph class="+ topic/ph pr-d/codeph ">preventDefault()</codeph> method of the event
  969. object to cancel the default behavior. For example, you could use the <codeph class="+ topic/ph pr-d/codeph ">flash.net.navigateToURL()</codeph>
  970. function to open the page in the system browser based on the <codeph class="+ topic/ph pr-d/codeph ">location</codeph>
  971. property of the event object</p>
  972. <p class="- topic/p ">A locationChanging event is not dispatched when you change the location with the following methods:</p>
  973. <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>
  974. </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 ">
  975. Signals that the location property of the StageWebView object has changed.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">Signals that the location property of the StageWebView object has changed.
  976. </apiTipText></apiTipTexts></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  977. Signals that the <codeph class="+ topic/ph pr-d/codeph ">location</codeph> property of the StageWebView object has changed.
  978. <p class="- topic/p ">The event cannot be canceled.</p>
  979. </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 ">
  980. Creates a StageWebView object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  981. Creates a StageWebView object.
  982. <p class="- topic/p ">The object is invisible until it is attached to a stage and until the <codeph class="+ topic/ph pr-d/codeph ">viewPort</codeph>
  983. is set.</p>
  984. </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 ">
  985. Assigns focus to the content within this StageWebView object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">specifies whether the first or last focusable object
  986. in the displayed content should receive focus.
  987. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  988. Assigns focus to the content within this StageWebView object.
  989. <p class="- topic/p ">Direction values are defined in FocusDirection class and include:
  990. "bottom", "none", and "top".</p>
  991. </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 ">
  992. Disposes of this StageWebView object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  993. Disposes of this StageWebView object.
  994. <p class="- topic/p ">Calling <codeph class="+ topic/ph pr-d/codeph ">dispose()</codeph> is optional. If you do not maintain a reference to this
  995. StageWebView instance it will be eligible for garbage collection. Calling <codeph class="+ topic/ph pr-d/codeph ">dispose()</codeph>
  996. can make garbage collection occur sooner, or at a more convenient time.</p>
  997. </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 ">
  998. Draws the StageWebView's view port to a bitmap.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 "> The bitmap's width or height is different from view port's width or height.
  999. </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 ">The bitmap is null.
  1000. </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 ">The BitmapData object on which to draw the visible portion of the StageWebView's view port.
  1001. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1002. Draws the StageWebView's view port to a bitmap.
  1003. <p class="- topic/p ">Capture the bitmap and set the stage to <codeph class="+ topic/ph pr-d/codeph ">null</codeph> for displaying the content above the StageWebView object. </p>
  1004. </apiDesc><example conref="examples\StageWebView.bitmapcapture.as" class="- topic/example "> The following example displays two labels: google and facebook.
  1005. Clicking on the label captures the corresponding web page and displays it as a snapshot on the stage.
  1006. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  1007. package
  1008. {
  1009. import flash.display.Bitmap;
  1010. import flash.display.BitmapData;
  1011. import flash.display.Sprite;
  1012. import flash.events.*;
  1013. import flash.geom.Rectangle;
  1014. import flash.media.StageWebView;
  1015. import flash.net.*;
  1016. import flash.text.TextField;
  1017. public class stagewebview1 extends Sprite
  1018. {
  1019. public var webView:StageWebView = new StageWebView();
  1020. public var textGoogle:TextField=new TextField();
  1021. public var textFacebook:TextField=new TextField();
  1022. public function stagewebview()
  1023. {
  1024. textGoogle.htmlText="&lt;b&gt;Google&lt;/b&gt;";
  1025. textGoogle.x=300;
  1026. textGoogle.y=-80;
  1027. addChild(textGoogle);
  1028. textFacebook.htmlText="&lt;b&gt;Facebook&lt;/b&gt;";
  1029. textFacebook.x=0;
  1030. textFacebook.y=-80;
  1031. addChild(textFacebook);
  1032. textGoogle.addEventListener(MouseEvent.CLICK,goGoogle);
  1033. textFacebook.addEventListener(MouseEvent.CLICK,goFaceBook);
  1034. webView.stage = this.stage;
  1035. webView.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
  1036. }
  1037. public function goGoogle(e:Event):void
  1038. {
  1039. webView.loadURL("http://www.google.com");
  1040. webView.stage = null;
  1041. webView.addEventListener(Event.COMPLETE,handleLoad);
  1042. }
  1043. public function goFaceBook(e:Event):void
  1044. {
  1045. webView.loadURL("http://www.facebook.com");
  1046. webView.stage = null;
  1047. webView.addEventListener(Event.COMPLETE,handleLoad);
  1048. }
  1049. public function handleLoad(e:Event):void
  1050. {
  1051. var bitmapData:BitmapData = new BitmapData(webView.viewPort.width, webView.viewPort.height);
  1052. webView.drawViewPortToBitmapData(bitmapData);
  1053. var webViewBitmap:Bitmap=new Bitmap(bitmapData);
  1054. addChild(webViewBitmap);
  1055. }
  1056. }
  1057. }
  1058. </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 ">
  1059. Navigates to the previous page in the browsing history.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1060. Navigates to the previous page in the browsing history.
  1061. </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 ">
  1062. Navigates to the next page in the browsing history.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1063. Navigates to the next page in the browsing history.
  1064. </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 ">
  1065. Loads and displays the specified HTML string.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">the string of HTML or XHTML content to display.
  1066. </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 ">The MIME type of the content, either "text/html" or "application/xhtml+xml".
  1067. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1068. Loads and displays the specified HTML string.
  1069. <p class="- topic/p ">When the <codeph class="+ topic/ph pr-d/codeph ">loadString()</codeph> method is used, the <codeph class="+ topic/ph pr-d/codeph ">location</codeph>
  1070. is reported as "about:blank." Only standard URI schemes can be used in URLs within
  1071. the HTML string. The AIR URI schemes, "app:" and "app-storage:" are not allowed.</p>
  1072. <p class="- topic/p ">The HTML content cannot load local resources, such as image files. XMLHttpRequests
  1073. are not allowed.</p>
  1074. <p class="- topic/p ">Only the "text/html" and "application/xhtml+xml" MIME types are supported.</p>
  1075. </apiDesc><example conref="examples\StageWebView.loadString.1.as" class="- topic/example "> The following example sets up a StageWebView object to fill the stage. The example
  1076. loads an HTML page with the <codeph class="+ topic/ph pr-d/codeph ">loadString()</codeph> method.
  1077. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  1078. var webView:StageWebView = new StageWebView();
  1079. webView.stage = this.stage;
  1080. webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight );
  1081. var htmlString:String = "&lt;!DOCTYPE HTML&gt;" +
  1082. "&lt;html&gt;" +
  1083. "&lt;body&gt;" +
  1084. "&lt;h1&gt;Example&lt;/h1&gt;" +
  1085. "&lt;p&gt;King Phillip cut open five green snakes.&lt;/p&gt;" +
  1086. "&lt;/body&gt;" +
  1087. "&lt;/html&gt;";
  1088. webView.loadString( htmlString, "text/html" );
  1089. </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 ">
  1090. Loads the page at the specified 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 ">
  1091. Loads the page at the specified URL.
  1092. <p class="- topic/p ">The URL can use the following URI schemes: http:, https:, file:, data:, and javascript:.
  1093. Content loaded with the file: scheme can load other local resources.</p>
  1094. </apiDesc><example conref="examples\StageWebView.loadURL.1.as" class="- topic/example "> The following example sets up a StageWebView object to fill the stage. The example
  1095. loads a web site with the <codeph class="+ topic/ph pr-d/codeph ">loadURL()</codeph> method.
  1096. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> On Android, you must specify the INTERNET permission in your AIR application
  1097. descriptor to load remote URLs.</p>
  1098. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  1099. var webView:StageWebView = new StageWebView();
  1100. webView.stage = this.stage;
  1101. webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight );
  1102. webView.loadURL( "http://www.example.com" );
  1103. </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 ">
  1104. Reloads the current page.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1105. Reloads the current page.
  1106. </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 ">
  1107. Halts the current load operation.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1108. Halts the current load operation.
  1109. </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 ">
  1110. Reports whether there is a previous page in the browsing history.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1111. Reports whether there is a previous page in the browsing history.
  1112. </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 ">
  1113. Reports whether there is a next page in the browsing history.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1114. Reports whether there is a next page in the browsing history.
  1115. </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 ">
  1116. Reports whether the StageWebView class is supported on the current device.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1117. Reports whether the StageWebView class is supported on the current device.
  1118. </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 ">
  1119. The URL of the current 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><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- 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 ">
  1120. The URL of the current location.
  1121. </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 ">
  1122. The stage on which this StageWebView object is displayed.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1123. The stage on which this StageWebView object is displayed.
  1124. <p class="- topic/p ">Set <codeph class="+ topic/ph pr-d/codeph ">stage</codeph> to <codeph class="+ topic/ph pr-d/codeph ">null</codeph> to hide this StageWebView object.</p>
  1125. </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 ">
  1126. The HTML title value.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1127. The HTML title value.
  1128. </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 ">
  1129. The area on the stage in which the StageWebView object is displayed.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">The Rectangle value is not valid.
  1130. </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 ">
  1131. The area on the stage in which the StageWebView object is displayed.
  1132. </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 ">
  1133. This class defines an enumeration that describes possible levels of video decoding.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">An enumeration that describes possible levels of video decoding.
  1134. </apiTipText></apiTipTexts><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1135. This class defines an enumeration that describes possible levels of video decoding.
  1136. </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 ">
  1137. Indicates hardware-accelerated (GPU) video decoding.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Indicates hardware-accelerated (GPU) video decoding.
  1138. </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1139. Indicates hardware-accelerated (GPU) video decoding.
  1140. </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 ">
  1141. Indicates software video decoding.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Indicates software video decoding.
  1142. </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1143. Indicates software video decoding.
  1144. </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 ">
  1145. Video decoding is not supported.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">Video is not supported.
  1146. </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1147. Video decoding is not supported.
  1148. </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 ">
  1149. The MediaPromise class represents the promise to deliver a media object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1150. The MediaPromise class represents the promise to deliver a media object.
  1151. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">data</codeph> property of a MediaEvent object is a MediaPromise
  1152. instance. You can use the MediaPromise methods to access the promised media
  1153. object. Supported media formats include still images and video.</p>
  1154. <p class="- topic/p ">You cannot create a MediaPromise object. Calling <codeph class="+ topic/ph pr-d/codeph ">new MediaPromise()</codeph>
  1155. generates a run-time error.</p>
  1156. </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 ">
  1157. A MediaPromise object dispatches a complete event when all data has been read.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1158. A MediaPromise object dispatches a <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> event when all data has been read.
  1159. The event indicates that there is no more data available in the underlying stream.
  1160. <p class="- topic/p ">A <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> event is not dispatched by a synchronous data source.</p>
  1161. </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 ">
  1162. A MediaPromise object dispatches progress events as the data becomes available.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1163. A MediaPromise object dispatches <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> events as the data becomes available.
  1164. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">bytesTotal</codeph> property of all progress events except the last has the value 0.
  1165. If all the data is available immediately, no <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> events may be dispatched.
  1166. No <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> events are dispatched by synchronous data sources.</p>
  1167. </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 ">
  1168. A MediaPromise object dispatches an ioError event when an error is encountered while reading
  1169. the underlying data stream.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1170. A MediaPromise object dispatches an <codeph class="+ topic/ph pr-d/codeph ">ioError</codeph> event when an error is encountered while reading
  1171. the underlying data stream. No more data can be read after this event is dispatched.
  1172. </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 ">
  1173. A MediaPromise object dispatches a close event when the underlying data stream has closed.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1174. A MediaPromise object dispatches a <codeph class="+ topic/ph pr-d/codeph ">close</codeph> event when the underlying data stream has closed.
  1175. </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 ">
  1176. Closes the data source.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1177. Closes the data source.
  1178. </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 ">
  1179. Opens the underlying data source and returns the IDataInput instance allowing you to read it.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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.
  1180. </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 ">
  1181. Opens the underlying data source and returns the IDataInput instance allowing you to read it.
  1182. <p class="- topic/p ">If the underlying data source is asynchronous, then the MediaPromise object dispatches
  1183. <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> and <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> events to indicate whether data is available
  1184. to be read. If the data source is synchronous, all data is available immediately and these
  1185. events are not dispatched.</p>
  1186. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> You can load a MediaPromise object using the <codeph class="+ topic/ph pr-d/codeph ">loadFilePromise()</codeph>
  1187. method of the Loader class instead of reading the data manually.</p>
  1188. </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 ">
  1189. Used by the runtime to report errors.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">the error vent to dispatch.
  1190. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1191. Used by the runtime to report errors.
  1192. <p class="- topic/p ">Application code should not call this method.</p>
  1193. </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 ">
  1194. The File instance representing the media object, if one exists.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1195. The File instance representing the media object, if one exists.
  1196. <p class="- topic/p ">This property references a File object if the underlying data source is file-based and the
  1197. file is accessible to your application.
  1198. Otherwise, the property is <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.</p>
  1199. </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 ">
  1200. Reports whether the underlying data source is asynchronous or synchronous.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1201. Reports whether the underlying data source is asynchronous or synchronous.
  1202. <p class="- topic/p "/>
  1203. </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 ">
  1204. The general type of media, either image or 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="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 ">
  1205. The general type of media, either image or video.
  1206. <p class="- topic/p ">The constants in the MediaType class define possible values of this property:</p>
  1207. <ul class="- topic/ul "><li class="- topic/li ">MediaType.IMAGE</li><li class="- topic/li ">MediaType.VIDEO</li></ul>
  1208. </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 ">
  1209. The file name of the media object, if one exists.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1210. The file name of the media object, if one exists.
  1211. <p class="- topic/p ">A file name is available if the underlying data source is file-based and the
  1212. file is accessible to your application.
  1213. Otherwise, the property is <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.</p>
  1214. </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 ">
  1215. The SoundLoaderContext class provides security checks for files that load 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><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 ">
  1216. The SoundLoaderContext class provides security checks for files that load sound.
  1217. SoundLoaderContext objects are passed as an argument to the constructor and the
  1218. <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> method of the Sound class.
  1219. <p class="- topic/p ">When you use this class, consider the following security model: </p>
  1220. <ul class="- topic/ul "><li class="- topic/li ">Loading and playing a sound is not allowed if the calling file is in a network sandbox
  1221. and the sound file to be loaded is local.</li><li class="- topic/li ">By default, loading and playing a sound is not allowed if the calling is local and
  1222. tries to load and play a remote sound. A user must grant explicit permission to allow this.</li><li class="- topic/li ">Certain operations dealing with sound are restricted. The data in a loaded sound cannot
  1223. be accessed by a file in a different domain unless you implement a URL policy file.
  1224. Sound-related APIs that fall under this restriction are the <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> property and the
  1225. <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.computeSpectrum()</codeph>, <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.bufferTime</codeph>,
  1226. and <codeph class="+ topic/ph pr-d/codeph ">SoundTransform()</codeph> methods.</li></ul>
  1227. <p class="- topic/p ">However, in Adobe AIR, content in the <codeph class="+ topic/ph pr-d/codeph ">application</codeph> security sandbox (content
  1228. installed with the AIR application) are not restricted by these security limitations.</p>
  1229. <p class="- topic/p ">For more information related to security, see the Flash Player Developer Center Topic:
  1230. <xref href="http://www.adobe.com/go/devnet_security_en" scope="external" class="- topic/xref ">Security</xref>.</p>
  1231. </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 ">
  1232. Creates a new sound loader context object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">The number of seconds to preload a streaming sound into a buffer
  1233. before the sound starts to stream.
  1234. </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 ">Specifies whether the existence of a URL policy file
  1235. should be checked upon loading the object (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>) or not.
  1236. </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1237. Creates a new sound loader context object.
  1238. </apiDesc><example conref="examples\SoundLoaderContextExample.as" class="- topic/example "> In the following example, the buffer for the sound that will be loaded
  1239. is set to three seconds.
  1240. <p class="- topic/p ">The first parameter of a SoundLoaderContext object (<codeph class="+ topic/ph pr-d/codeph ">context</codeph>) is used to increase
  1241. the default buffer value of one second to three seconds. (The value is in milliseconds.)
  1242. If the second parameter of the SoundLoaderContext object is set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>,
  1243. Flash Player will check for a cross-domain policy file upon loading the object. Here it is
  1244. set to the default value <codeph class="+ topic/ph pr-d/codeph ">false</codeph>, so no policy file will be checked.
  1245. The <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> method of the sound object will use the context setting to make sure
  1246. it will take three seconds to preload the streaming sound into a buffer before the sound starts
  1247. to stream. The <codeph class="+ topic/ph pr-d/codeph ">URLRequest</codeph> object determines the location of the file, which is a
  1248. podcast from Adobe. If an <codeph class="+ topic/ph pr-d/codeph ">IOErrorEvent.IO_ERROR</codeph> error occurs during the loading
  1249. of the sound file, the <codeph class="+ topic/ph pr-d/codeph ">errorHandler()</codeph> method is invoked.</p>
  1250. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  1251. package {
  1252. import flash.display.Sprite;
  1253. import flash.net.URLRequest;
  1254. import flash.media.Sound;
  1255. import flash.media.SoundLoaderContext;
  1256. import flash.events.IOErrorEvent;
  1257. public class SoundLoaderContextExample extends Sprite {
  1258. public function SoundLoaderContextExample() {
  1259. var snd:Sound = new Sound();
  1260. var req:URLRequest = new URLRequest("http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3");
  1261. var context:SoundLoaderContext = new SoundLoaderContext(3000, false);
  1262. snd.load(req, context);
  1263. snd.play();
  1264. snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
  1265. }
  1266. private function errorHandler(errorEvent:IOErrorEvent):void {
  1267. trace("The sound could not be loaded: " + errorEvent.text);
  1268. }
  1269. }
  1270. }
  1271. </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 ">
  1272. The number of milliseconds to preload a streaming sound into a buffer
  1273. before the sound starts to stream.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">
  1274. The number of milliseconds to preload a streaming sound into a buffer
  1275. before the sound starts to stream.
  1276. <p class="- topic/p ">Note that you cannot override the value of <codeph class="+ topic/ph pr-d/codeph ">SoundLoaderContext.bufferTime</codeph>
  1277. by setting the global <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.bufferTime</codeph> property.
  1278. <ph class="- topic/ph ">The <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.bufferTime</codeph> property affects the buffer time
  1279. for embedded streaming sounds in a SWF file and is independent of dynamically created
  1280. Sound objects (that is, Sound objects created in ActionScript).</ph></p>
  1281. </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 ">
  1282. Specifies whether the application should try to download a URL policy file from the
  1283. loaded sound's server before beginning to load the 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 "><internal>: please review at same time: checkPolicyFile property in LoaderContext, NetStream
  1284. </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 ">
  1285. Specifies whether the application should try to download a URL policy file from the
  1286. loaded sound's server before beginning to load the sound. This property applies to
  1287. sound that is loaded from outside
  1288. the calling file's own domain using the <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> method.
  1289. <p class="- topic/p ">Set this property to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> when you load a sound from outside the
  1290. calling file's own domain and code in the calling file needs low-level access to
  1291. the sound's data. Examples of low-level access to a sound's data
  1292. include referencing the <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> property to get an
  1293. ID3Info object or calling the <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.computeSpectrum()</codeph> method to get
  1294. sound samples from the loaded sound. If you try to access sound data without
  1295. setting the <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> property to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> at loading time,
  1296. you may get a SecurityError exception because the required policy file has not been downloaded.</p>
  1297. <p class="- topic/p ">If you don't need low-level access to the sound data that you are loading, avoid setting
  1298. <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>. Checking for a policy file consumes
  1299. network bandwidth
  1300. and might delay the start of your download, so it should only be done when necessary.</p>
  1301. <p class="- topic/p ">When you call <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> with <codeph class="+ topic/ph pr-d/codeph ">SoundLoaderContext.checkPolicyFile</codeph> set
  1302. to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>, Flash Player or AIR must
  1303. either successfully download a relevant URL policy file or determine that no such policy file
  1304. exists before it begins downloading the specified sound.
  1305. <ph class="- topic/ph ">Flash Player or</ph> AIR performs the following
  1306. actions, in this order, to verify the existence of a policy file:</p>
  1307. <ul class="- topic/ul "><li class="- topic/li ">Flash Player or AIR considers policy files that have already been downloaded.</li><li class="- topic/li ">Flash Player or AIR tries to download any pending policy files specified in calls to
  1308. <codeph class="+ topic/ph pr-d/codeph ">Security.loadPolicyFile()</codeph>.</li><li class="- topic/li ">Flash Player or AIR tries to download a
  1309. policy file from the default location that corresponds to the sound's URL, which is
  1310. <codeph class="+ topic/ph pr-d/codeph ">/crossdomain.xml</codeph> on the same server as <codeph class="+ topic/ph pr-d/codeph ">URLRequest.url</codeph>.
  1311. (The sound's URL is specified in the <codeph class="+ topic/ph pr-d/codeph ">url</codeph> property of the URLRequest object
  1312. passed to <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> or the Sound() constructor function.)</li></ul>
  1313. <p class="- topic/p ">In all cases, Flash Player or AIR
  1314. requires that an appropriate policy file exist on the sound's server, that it provide access
  1315. to the sound file at <codeph class="+ topic/ph pr-d/codeph ">URLRequest.url</codeph> by virtue of the policy file's location, and
  1316. that it allow the domain of the calling file to access the sound, through one or more
  1317. <codeph class="+ topic/ph pr-d/codeph ">&lt;allow-access-from&gt;</codeph> tags.
  1318. </p>
  1319. <p class="- topic/p ">If you set <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>,
  1320. Flash Player or AIR waits until the policy file is verified
  1321. before loading the sound. You should wait to perform
  1322. any low-level operations on the sound data, such as calling <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> or
  1323. <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.computeSpectrum()</codeph>, until <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> and <codeph class="+ topic/ph pr-d/codeph ">complete</codeph>
  1324. events are dispatched from the Sound object.
  1325. </p>
  1326. <p class="- topic/p ">If you set <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> but no appropriate policy file is found,
  1327. you will not receive an error until you perform an operation that requires
  1328. a policy file, and then Flash Player or AIR throws a
  1329. <codeph class="+ topic/ph pr-d/codeph ">SecurityError</codeph> exception. After you receive a <codeph class="+ topic/ph pr-d/codeph ">complete</codeph>
  1330. event, you can test whether a relevant policy file was found by getting the value
  1331. of <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> within a <codeph class="+ topic/ph pr-d/codeph ">try</codeph> block and seeing if a
  1332. <codeph class="+ topic/ph pr-d/codeph ">SecurityError</codeph> is thrown.</p>
  1333. <p class="- topic/p ">Be careful with <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> if you are downloading sound from a URL that
  1334. uses server-side HTTP redirects. Flash Player or AIR tries to retrieve policy files that
  1335. correspond to the <codeph class="+ topic/ph pr-d/codeph ">url</codeph> property of the URLRequest object
  1336. passed to <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph>. If the final
  1337. sound file comes from a different URL because of HTTP redirects, then the initially downloaded
  1338. policy files might not be applicable to the sound's final URL, which is the URL that matters
  1339. in security decisions.</p>
  1340. <p class="- topic/p ">If you find yourself in this situation, here is one possible solution.
  1341. After you receive a <codeph class="+ topic/ph pr-d/codeph ">progress</codeph> or <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> event, you can examine the value of
  1342. the <codeph class="+ topic/ph pr-d/codeph ">Sound.url</codeph> property, which contains the sound's final URL.
  1343. Then call the <codeph class="+ topic/ph pr-d/codeph ">Security.loadPolicyFile()</codeph> method
  1344. with a policy file URL that you calculate based on the sound's final URL. Finally, poll the value
  1345. of <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> until no exception is thrown.</p>
  1346. <p class="- topic/p ">This does not apply to content in the AIR application sandbox.
  1347. Content in the application sandbox always has programatic access to sound content, regardless
  1348. of its origin.</p>
  1349. <p class="- topic/p ">For more information related to security, see the Flash Player Developer Center Topic:
  1350. <xref href="http://www.adobe.com/go/devnet_security_en" scope="external" class="- topic/xref ">Security</xref>.</p>
  1351. </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 ">
  1352. The SoundChannel class controls a sound in an application.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  1353. </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 ">
  1354. The SoundChannel class controls a sound in an application. Every sound
  1355. is assigned to a sound channel, and the application can have multiple
  1356. sound channels that are mixed together. The SoundChannel class contains a <codeph class="+ topic/ph pr-d/codeph ">stop()</codeph> method,
  1357. properties for monitoring the amplitude (volume) of the channel, and a property for assigning a
  1358. SoundTransform object to the channel.
  1359. </apiDesc><example conref="examples\SoundChannelExample.as" class="- topic/example "> The following example loads an MP3 file, plays it, and displays
  1360. information about sound events that take place as the MP3 file is loaded and played. A Timer
  1361. object provides updated information about the position of the playhead every 50 milliseconds.
  1362. To run this example, place a file named MySound.mp3 in the same directory as your SWF file.
  1363. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  1364. package {
  1365. import flash.display.Sprite;
  1366. import flash.events.*;
  1367. import flash.media.Sound;
  1368. import flash.media.SoundChannel;
  1369. import flash.net.URLRequest;
  1370. import flash.utils.Timer;
  1371. public class SoundChannelExample extends Sprite {
  1372. private var url:String = "MySound.mp3";
  1373. private var soundFactory:Sound;
  1374. private var channel:SoundChannel;
  1375. private var positionTimer:Timer;
  1376. public function SoundChannelExample() {
  1377. var request:URLRequest = new URLRequest(url);
  1378. soundFactory = new Sound();
  1379. soundFactory.addEventListener(Event.COMPLETE, completeHandler);
  1380. soundFactory.addEventListener(Event.ID3, id3Handler);
  1381. soundFactory.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
  1382. soundFactory.addEventListener(ProgressEvent.PROGRESS, progressHandler);
  1383. soundFactory.load(request);
  1384. channel = soundFactory.play();
  1385. channel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
  1386. positionTimer = new Timer(50);
  1387. positionTimer.addEventListener(TimerEvent.TIMER, positionTimerHandler);
  1388. positionTimer.start();
  1389. }
  1390. private function positionTimerHandler(event:TimerEvent):void {
  1391. trace("positionTimerHandler: " + channel.position.toFixed(2));
  1392. }
  1393. private function completeHandler(event:Event):void {
  1394. trace("completeHandler: " + event);
  1395. }
  1396. private function id3Handler(event:Event):void {
  1397. trace("id3Handler: " + event);
  1398. }
  1399. private function ioErrorHandler(event:Event):void {
  1400. trace("ioErrorHandler: " + event);
  1401. positionTimer.stop();
  1402. }
  1403. private function progressHandler(event:ProgressEvent):void {
  1404. trace("progressHandler: " + event);
  1405. }
  1406. private function soundCompleteHandler(event:Event):void {
  1407. trace("soundCompleteHandler: " + event);
  1408. positionTimer.stop();
  1409. }
  1410. }
  1411. }
  1412. </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 ">
  1413. Dispatched when a sound has finished playing.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">
  1414. Dispatched when a sound has finished playing.
  1415. </apiDesc><example conref="examples\SoundChannel_event_soundCompleteExample.as" class="- topic/example "> In the following example, the user selects songs from a playlist,
  1416. and then selects Play to play the song in the order selected.
  1417. <p class="- topic/p ">In the constructor, a text field is defined that holds the song list
  1418. and a line for the selection to play. (Usually, buttons are
  1419. used for play and list boxes for a song list.) A text format object is
  1420. defined that changes the format of the song lines to italic after they are
  1421. selected. When a user selects the text field, the <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph>
  1422. method is invoked.</p>
  1423. <p class="- topic/p ">In the <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method, the <codeph class="+ topic/ph pr-d/codeph ">getLineIndexAtPoint()</codeph>
  1424. method of the text field object returns the index of the line that the user selected. Using
  1425. the line index, the <codeph class="+ topic/ph pr-d/codeph ">getLineText()</codeph> method gets the content of the text.
  1426. The if statement checks whether the user selected to play a song or add a song to the
  1427. play list. If a user selected to play and a song has been selected, then the event
  1428. listener for mouse click is removed and the <codeph class="+ topic/ph pr-d/codeph ">playNext()</codeph> method is called to
  1429. begin playing the songs. If the user selected a song title, the content of the
  1430. line is added to the <codeph class="+ topic/ph pr-d/codeph ">songList</codeph> array and the format of the line is set to italic.</p>
  1431. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">playNext()</codeph> method iterates through the array list to load
  1432. and play each song. The song is also assigned to a sound channel. An event listener
  1433. for the sound channel is added to respond when the song finishes playing and the
  1434. <codeph class="+ topic/ph pr-d/codeph ">Event.SOUND_COMPLETE</codeph> event is dispatched. The <codeph class="+ topic/ph pr-d/codeph ">soundCompleteHandler()</codeph>
  1435. method then invokes the <codeph class="+ topic/ph pr-d/codeph ">playNext()</codeph> method to play the next song. This process
  1436. continues until all the songs listed in the array finish playing.</p>
  1437. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  1438. package {
  1439. import flash.display.Sprite;
  1440. import flash.media.Sound;
  1441. import flash.media.SoundChannel;
  1442. import flash.text.TextField;
  1443. import flash.text.TextFieldAutoSize;
  1444. import flash.events.MouseEvent;
  1445. import flash.text.TextFormat;
  1446. import flash.net.URLRequest;
  1447. import flash.events.Event;
  1448. import flash.events.IOErrorEvent;
  1449. public class SoundChannel_event_soundCompleteExample extends Sprite {
  1450. private var channel:SoundChannel = new SoundChannel();
  1451. private var songList:Array = new Array();
  1452. private var listTextField:TextField = new TextField();
  1453. private var songFormat:TextFormat = new TextFormat();
  1454. private var arrayIndex:int = 0;
  1455. private var songSelected:Boolean = false;
  1456. public function SoundChannel_event_soundCompleteExample() {
  1457. listTextField.autoSize = TextFieldAutoSize.LEFT;
  1458. listTextField.border = true
  1459. listTextField.background = true;
  1460. listTextField.text = "Song1.mp3\n" + "Song2.mp3\n"
  1461. + "Song3.mp3\n" + "Song4.mp3\n" + "PLAY";
  1462. songFormat.italic = true;
  1463. listTextField.addEventListener(MouseEvent.CLICK, clickHandler);
  1464. addChild(listTextField);
  1465. }
  1466. private function clickHandler(e:MouseEvent):void {
  1467. var index:int = listTextField.getLineIndexAtPoint(e.localX, e.localY);
  1468. var line:String = listTextField.getLineText(index);
  1469. var firstIndex:uint = listTextField.getLineOffset(index);
  1470. var playLine:uint = listTextField.numLines - 1;
  1471. if((index == playLine) &amp;&amp; (songSelected == true)) {
  1472. listTextField.removeEventListener(MouseEvent.CLICK, clickHandler);
  1473. playNext();
  1474. } else if (index != playLine) {
  1475. songList.push(line.substr(0, (line.length - 1)));
  1476. listTextField.setTextFormat(songFormat, firstIndex,
  1477. (firstIndex + listTextField.getLineLength(index)));
  1478. songSelected = true;
  1479. }
  1480. }
  1481. private function playNext():void {
  1482. if(arrayIndex &lt; songList.length) {
  1483. var snd:Sound = new Sound();
  1484. snd.load(new URLRequest(songList[arrayIndex]));
  1485. channel = snd.play();
  1486. channel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
  1487. arrayIndex++;
  1488. } else {
  1489. songSelected = false;
  1490. while(arrayIndex &gt; 0) {
  1491. songList.pop();
  1492. arrayIndex--;
  1493. }
  1494. }
  1495. }
  1496. private function soundCompleteHandler(e:Event):void {
  1497. playNext();
  1498. }
  1499. private function errorHandler(errorEvent:IOErrorEvent):void {
  1500. trace(errorEvent.text);
  1501. }
  1502. }
  1503. }
  1504. </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 ">
  1505. Stops the sound playing in the channel.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  1506. </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 ">
  1507. Stops the sound playing in the channel.
  1508. </apiDesc><example conref="examples\SoundChannel_stopExample.as" class="- topic/example "> In the following example, the user can pause and replay a sound file.
  1509. <p class="- topic/p ">In the constructor, the sound file is loaded. (This example assumes that the file is
  1510. in the same directory as the SWF file.) A text field is used as a button for the user
  1511. to play or pause the sound. When the user selects the <codeph class="+ topic/ph pr-d/codeph ">button</codeph>
  1512. text field, the <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method is invoked.</p>
  1513. <p class="- topic/p ">In the <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method, the first time the user selects
  1514. the text field, the sound is set to play and is assigned to a sound channel. Next, when
  1515. the user selects the text field to pause, the sound stops playing. The sound channel's
  1516. <codeph class="+ topic/ph pr-d/codeph ">position</codeph> property records the position of the sound at the
  1517. time it was stopped. This property is used to resume the sound starting at that position, after
  1518. the user selects the text field to start playing again. Each time the
  1519. <codeph class="+ topic/ph pr-d/codeph ">Sound.play()</codeph> method is called, a new SoundChannel object is created and
  1520. assigned to the <codeph class="+ topic/ph pr-d/codeph ">channel</codeph> variable. The Sound object must be
  1521. assigned to a SoundChannel object in order to use the sound channel's
  1522. <codeph class="+ topic/ph pr-d/codeph ">stop()</codeph> method to pause the sound.</p>
  1523. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  1524. package {
  1525. import flash.display.Sprite;
  1526. import flash.media.Sound;
  1527. import flash.media.SoundChannel;
  1528. import flash.net.URLLoader;
  1529. import flash.net.URLRequest;
  1530. import flash.text.TextField;
  1531. import flash.events.MouseEvent;
  1532. import flash.text.TextFieldAutoSize;
  1533. public class SoundChannel_stopExample extends Sprite {
  1534. private var snd:Sound = new Sound();
  1535. private var channel:SoundChannel = new SoundChannel();
  1536. private var button:TextField = new TextField();
  1537. public function SoundChannel_stopExample() {
  1538. var req:URLRequest = new URLRequest("MySound.mp3");
  1539. snd.load(req);
  1540. button.x = 10;
  1541. button.y = 10;
  1542. button.text = "PLAY";
  1543. button.border = true;
  1544. button.background = true;
  1545. button.selectable = false;
  1546. button.autoSize = TextFieldAutoSize.CENTER;
  1547. button.addEventListener(MouseEvent.CLICK, clickHandler);
  1548. this.addChild(button);
  1549. }
  1550. private function clickHandler(e:MouseEvent):void {
  1551. var pausePosition:int = channel.position;
  1552. if(button.text == "PLAY") {
  1553. channel = snd.play(pausePosition);
  1554. button.text = "PAUSE";
  1555. }
  1556. else {
  1557. channel.stop();
  1558. button.text = "PLAY";
  1559. }
  1560. }
  1561. }
  1562. }
  1563. </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 ">
  1564. The current amplitude (volume) of the left channel, from 0 (silent) to 1 (full amplitude).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  1565. </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 ">
  1566. The current amplitude (volume) of the left channel, from 0 (silent) to 1 (full amplitude).
  1567. </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 ">
  1568. When the sound is playing, the position property indicates in milliseconds the current point
  1569. that is being played in the sound 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="Flash" 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 ">
  1570. When the sound is playing, the <codeph class="+ topic/ph pr-d/codeph ">position</codeph> property indicates in milliseconds the current point
  1571. that is being played in the sound file. When the sound is stopped or paused, the
  1572. <codeph class="+ topic/ph pr-d/codeph ">position</codeph> property indicates the last point that was played in the sound file.
  1573. <p class="- topic/p ">A common use case is to save the value of the <codeph class="+ topic/ph pr-d/codeph ">position</codeph> property when the
  1574. sound is stopped. You can resume the sound later by restarting it from that saved position.
  1575. </p>
  1576. <p class="- topic/p ">If the sound is looped, <codeph class="+ topic/ph pr-d/codeph ">position</codeph> is reset to 0 at the beginning of each loop.</p>
  1577. </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 ">
  1578. The current amplitude (volume) of the right channel, from 0 (silent) to 1 (full amplitude).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  1579. </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 ">
  1580. The current amplitude (volume) of the right channel, from 0 (silent) to 1 (full amplitude).
  1581. </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 ">
  1582. The SoundTransform object assigned to the sound channel.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  1583. </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 ">
  1584. The SoundTransform object assigned to the sound channel. A SoundTransform object
  1585. includes properties for setting volume, panning, left speaker assignment, and right
  1586. speaker assignment.
  1587. </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 ">
  1588. The SoundMixer class contains static properties and methods for global sound control
  1589. in the application.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">
  1590. The SoundMixer class contains static properties and methods for global sound control
  1591. in the application. The SoundMixer class controls embedded and streaming sounds in the application.
  1592. it does not control dynamically created sounds (that is, sounds generated in response
  1593. to a Sound object dispatching a <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> event).
  1594. </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 ">
  1595. Determines whether any sounds are not accessible due to security restrictions.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  1596. </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 ">The string representation of the boolean.
  1597. </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1598. Determines whether any sounds are not accessible due to security restrictions. For example,
  1599. a sound loaded from a domain other than that of the content calling this method is not accessible if
  1600. the server for the sound has no URL policy file that grants access to
  1601. the domain of that domain. The sound can still be loaded and played, but low-level
  1602. operations, such as getting ID3 metadata for the sound, cannot be performed on
  1603. inaccessible sounds.
  1604. <p class="- topic/p ">For AIR application content in the application security sandbox, calling this method always
  1605. returns <codeph class="+ topic/ph pr-d/codeph ">false</codeph>. All sounds, including those loaded from other domains, are accessible
  1606. to content in the application security sandbox.</p>
  1607. </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 ">
  1608. Takes a snapshot of the current sound wave and places it into the specified ByteArray object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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.
  1609. </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 ">A ByteArray object that holds the values associated with the sound.
  1610. If any sounds are not available due to security restrictions
  1611. (<codeph class="+ topic/ph pr-d/codeph ">areSoundsInaccessible == true</codeph>), the <codeph class="+ topic/ph pr-d/codeph ">outputArray</codeph> object
  1612. is left unchanged. If all sounds are stopped, the <codeph class="+ topic/ph pr-d/codeph ">outputArray</codeph> object is
  1613. filled with zeros.
  1614. </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 ">A Boolean value indicating whether a Fourier transformation is performed
  1615. on the sound data first. Setting this parameter to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> causes the method to return a
  1616. frequency spectrum instead of the raw sound wave. In the frequency spectrum, low frequencies
  1617. are represented on the left and high frequencies are on the right.
  1618. </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 ">The resolution of the sound samples.
  1619. If you set the <codeph class="+ topic/ph pr-d/codeph ">stretchFactor</codeph> value to 0, data is sampled at 44.1 KHz;
  1620. with a value of 1, data is sampled at 22.05 KHz; with a value of 2, data is sampled 11.025 KHz;
  1621. and so on.
  1622. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1623. Takes a snapshot of the current sound wave and places it into the specified ByteArray object.
  1624. The values are formatted as normalized floating-point values, in the range -1.0 to 1.0.
  1625. The ByteArray object passed to the <codeph class="+ topic/ph pr-d/codeph ">outputArray</codeph> parameter is overwritten with the new values.
  1626. The size of the ByteArray object created is fixed to 512 floating-point values, where the
  1627. first 256 values represent the left channel, and the second 256 values represent
  1628. the right channel.
  1629. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> This method is subject to local file security restrictions and
  1630. restrictions on cross-domain loading. If you are working with local files or sounds loaded from a server in a
  1631. different domain than the calling content, you might need to address sandbox restrictions
  1632. through a cross-domain policy file. For more information, see the Sound class description.
  1633. In addition, this method cannot be used to extract data from RTMP streams, even when
  1634. it is called by content that reside in the same domain as the RTMP server.</p>
  1635. <p class="- topic/p ">This method is supported over RTMP in Flash Player 9.0.115.0
  1636. and later and in Adobe AIR. You can control access to streams on
  1637. Flash Media Server in a server-side script. For more information, see the <codeph class="+ topic/ph pr-d/codeph ">Client.audioSampleAccess</codeph>
  1638. and <codeph class="+ topic/ph pr-d/codeph ">Client.videoSampleAccess</codeph> properties in <xref href="http://www.adobe.com/go/documentation" scope="external" class="- topic/xref "><i class="+ topic/ph hi-d/i ">
  1639. Server-Side ActionScript Language Reference for Adobe Flash Media Server</i></xref>.</p>
  1640. </apiDesc><example conref="examples\SoundMixer_computeSpectrumExample.as" class="- topic/example "> In the following example, the <codeph class="+ topic/ph pr-d/codeph ">computeSpectrum()</codeph> method is
  1641. used to produce a graphic representation of the sound wave data.
  1642. <p class="- topic/p ">In the constructor, a sound file is loaded and set to play. (There is no error handling
  1643. in this example and it is assumed that the sound file is in the same directory as the SWF file.)
  1644. The example listens for the <codeph class="+ topic/ph pr-d/codeph ">Event.ENTER_FRAME</codeph> event while the sound plays, repeatedly
  1645. triggering the <codeph class="+ topic/ph pr-d/codeph ">onEnterFrame()</codeph> method to draw a graph of the sound data values.
  1646. When the sound finishes playing the <codeph class="+ topic/ph pr-d/codeph ">onPlaybackComplete()</codeph> method stops the drawing process
  1647. by removing the listener for the <codeph class="+ topic/ph pr-d/codeph ">Event.ENTER_FRAME</codeph> event.</p>
  1648. <p class="- topic/p ">In the <codeph class="+ topic/ph pr-d/codeph ">onEnterFrame()</codeph> method, the <codeph class="+ topic/ph pr-d/codeph ">computeSpectrum()</codeph> method stores the raw
  1649. sound in the <codeph class="+ topic/ph pr-d/codeph ">bytes</codeph> byte array object. The data is sampled at 44.1 KHz.
  1650. The byte array containing 512 bytes of data, each of which contains a floating-point value
  1651. between -1 and 1. The first 256 values represent the left channel, and the second 256 values
  1652. represent the right channel. The first for loop, reads the first 256 data values (the left stereo channel)
  1653. and draws a line from each point to the next using the <codeph class="+ topic/ph pr-d/codeph ">Graphics.lineTo()</codeph> method. (The vector
  1654. graphic display of the sound wave is written directly on to the class's sprite object.) The sound bytes
  1655. are read as 32-bit floating-point number from the byte stream and multiplied by the plot height to allow
  1656. for the vertical range of the graph. The width is set to twice the width of the channel length. The
  1657. second for loop reads the next set of 256 values (the right stereo channel), and plots the lines in
  1658. reverse order. The <codeph class="+ topic/ph pr-d/codeph ">g.lineTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT);</codeph> and <codeph class="+ topic/ph pr-d/codeph ">g.lineTo(0, PLOT_HEIGHT);</codeph>
  1659. methods draw the baseline for the waves. The resulting waveform plot produces a mirror-image effect.</p>
  1660. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  1661. package {
  1662. import flash.display.Sprite;
  1663. import flash.display.Graphics;
  1664. import flash.events.Event;
  1665. import flash.media.Sound;
  1666. import flash.media.SoundChannel;
  1667. import flash.media.SoundMixer;
  1668. import flash.net.URLRequest;
  1669. import flash.utils.ByteArray;
  1670. import flash.text.TextField;
  1671. public class SoundMixer_computeSpectrumExample extends Sprite {
  1672. public function SoundMixer_computeSpectrumExample() {
  1673. var snd:Sound = new Sound();
  1674. var req:URLRequest = new URLRequest("Song1.mp3");
  1675. snd.load(req);
  1676. var channel:SoundChannel;
  1677. channel = snd.play();
  1678. addEventListener(Event.ENTER_FRAME, onEnterFrame);
  1679. channel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
  1680. }
  1681. private function onEnterFrame(event:Event):void {
  1682. var bytes:ByteArray = new ByteArray();
  1683. const PLOT_HEIGHT:int = 200;
  1684. const CHANNEL_LENGTH:int = 256;
  1685. SoundMixer.computeSpectrum(bytes, false, 0);
  1686. var g:Graphics = this.graphics;
  1687. g.clear();
  1688. g.lineStyle(0, 0x6600CC);
  1689. g.beginFill(0x6600CC);
  1690. g.moveTo(0, PLOT_HEIGHT);
  1691. var n:Number = 0;
  1692. for (var i:int = 0; i &lt; CHANNEL_LENGTH; i++) {
  1693. n = (bytes.readFloat() * PLOT_HEIGHT);
  1694. g.lineTo(i * 2, PLOT_HEIGHT - n);
  1695. }
  1696. g.lineTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT);
  1697. g.endFill();
  1698. g.lineStyle(0, 0xCC0066);
  1699. g.beginFill(0xCC0066, 0.5);
  1700. g.moveTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT);
  1701. for (i = CHANNEL_LENGTH; i &gt; 0; i--) {
  1702. n = (bytes.readFloat() * PLOT_HEIGHT);
  1703. g.lineTo(i * 2, PLOT_HEIGHT - n);
  1704. }
  1705. g.lineTo(0, PLOT_HEIGHT);
  1706. g.endFill();
  1707. }
  1708. private function onPlaybackComplete(event:Event):void {
  1709. removeEventListener(Event.ENTER_FRAME, onEnterFrame);
  1710. }
  1711. }
  1712. }
  1713. </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 ">
  1714. Stops all sounds currently playing.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">
  1715. Stops all sounds currently playing.
  1716. <p class="- topic/p ">&gt;In Flash Professional, this method does not stop the playhead.
  1717. Sounds set to stream will resume playing as the playhead moves over the frames in which they
  1718. are located.</p>
  1719. <p class="- topic/p ">When using this property, consider the following security model:</p>
  1720. <ul class="- topic/ul "><li class="- topic/li "> By default, calling the <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.stopAll()</codeph> method stops
  1721. only sounds in the same security sandbox as the object that is calling the method.
  1722. Any sounds whose playback was not started from the same sandbox as the calling object
  1723. are not stopped.</li><li class="- topic/li ">When you load the sound, using the <codeph class="+ topic/ph pr-d/codeph ">load()</codeph> method of the Sound class, you can
  1724. specify a <codeph class="+ topic/ph pr-d/codeph ">context</codeph> parameter, which is a SoundLoaderContext object. If you set the
  1725. <codeph class="+ topic/ph pr-d/codeph ">checkPolicyFile</codeph> property of the SoundLoaderContext object to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>,
  1726. <ph class="- topic/ph ">Flash Player or</ph> Adobe AIR
  1727. checks for a cross-domain policy file on the server from which the sound is loaded. If the server has a
  1728. cross-domain policy file, and the file permits the domain of the calling content, then the file can stop the loaded
  1729. sound by using the <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.stopAll()</codeph> method; otherwise it cannot.</li></ul>
  1730. <p class="- topic/p ">However, in Adobe AIR, content in the <codeph class="+ topic/ph pr-d/codeph ">application</codeph> security sandbox (content
  1731. installed with the AIR application) are not restricted by these security limitations.</p>
  1732. <p class="- topic/p ">For more information related to security, see the Flash Player Developer Center Topic:
  1733. <xref href="http://www.adobe.com/go/devnet_security_en" scope="external" class="- topic/xref ">Security</xref>.</p>
  1734. </apiDesc><example conref="examples\SoundMixer_stopAllExample.as" class="- topic/example "> In the following example, the <codeph class="+ topic/ph pr-d/codeph ">stopAll()</codeph> method is used to mute two
  1735. sounds that are playing at the same time.
  1736. <p class="- topic/p ">In the constructor, two different sound files are loaded and set to play. The first sound is
  1737. loaded locally and is assigned to a sound channel. (It is assumed that the file is
  1738. in the same directory as the SWF file.) The second file is loaded and streamed from the Adobe
  1739. site. In order to use the <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.stopAll()</codeph> method, all sound must be accessible.
  1740. (A SoundLoaderContext object can be used to check for the cross-domain policy file.) Each sound
  1741. also has an event listener that is invoked if an IO error occurred while loading the sound file.
  1742. A <codeph class="+ topic/ph pr-d/codeph ">muteButton</codeph> text field is also created. It listens for a click event, which
  1743. will invoke the <codeph class="+ topic/ph pr-d/codeph ">muteButtonClickHandler()</codeph> method.</p>
  1744. <p class="- topic/p ">In the <codeph class="+ topic/ph pr-d/codeph ">muteButtonClickHandler()</codeph> method, if the text field content is "MUTE,"
  1745. the <codeph class="+ topic/ph pr-d/codeph ">areSoundsInaccessible()</codeph> method checks if the sound mixer has access to the files.
  1746. If the files are accessible, the <codeph class="+ topic/ph pr-d/codeph ">stopAll()</codeph> method stops the sounds. By selecting the
  1747. text field again, the first sound begins playing and the text field's content changes to
  1748. "MUTE" again. This time, the <codeph class="+ topic/ph pr-d/codeph ">stopAll()</codeph> method mutes the one sound that is running.
  1749. Note that sound channel <codeph class="+ topic/ph pr-d/codeph ">stop()</codeph> method can also be used to stop a specific sound
  1750. assigned to the channel. (To use the channel functionally, the sound needs to be reassigned
  1751. to the channel each time the <codeph class="+ topic/ph pr-d/codeph ">play()</codeph> method is invoked.)</p>
  1752. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  1753. package {
  1754. import flash.display.Sprite;
  1755. import flash.net.URLRequest;
  1756. import flash.media.Sound;
  1757. import flash.media.SoundLoaderContext;
  1758. import flash.media.SoundChannel;
  1759. import flash.media.SoundMixer;
  1760. import flash.text.TextField;
  1761. import flash.text.TextFieldAutoSize;
  1762. import flash.events.MouseEvent;
  1763. import flash.events.IOErrorEvent;
  1764. public class SoundMixer_stopAllExample extends Sprite {
  1765. private var firstSound:Sound = new Sound();
  1766. private var secondSound:Sound = new Sound();
  1767. private var muteButton:TextField = new TextField();
  1768. private var channel1:SoundChannel = new SoundChannel();
  1769. public function SoundMixer_stopAllExample() {
  1770. firstSound.load(new URLRequest("mySound.mp3"));
  1771. secondSound.load(new URLRequest("http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3"));
  1772. firstSound.addEventListener(IOErrorEvent.IO_ERROR, firstSoundErrorHandler);
  1773. secondSound.addEventListener(IOErrorEvent.IO_ERROR, secondSoundErrorHandler);
  1774. channel1 = firstSound.play();
  1775. secondSound.play();
  1776. muteButton.autoSize = TextFieldAutoSize.LEFT;
  1777. muteButton.border = true;
  1778. muteButton.background = true;
  1779. muteButton.text = "MUTE";
  1780. muteButton.addEventListener(MouseEvent.CLICK, muteButtonClickHandler);
  1781. this.addChild(muteButton);
  1782. }
  1783. private function muteButtonClickHandler(event:MouseEvent):void {
  1784. if(muteButton.text == "MUTE") {
  1785. if(SoundMixer.areSoundsInaccessible() == false) {
  1786. SoundMixer.stopAll();
  1787. muteButton.text = "click to play only one of sound.";
  1788. }
  1789. else {
  1790. muteButton.text = "The sounds are not accessible.";
  1791. }
  1792. }
  1793. else {
  1794. firstSound.play();
  1795. muteButton.text = "MUTE";
  1796. }
  1797. }
  1798. private function firstSoundErrorHandler(errorEvent:IOErrorEvent):void {
  1799. trace(errorEvent.text);
  1800. }
  1801. private function secondSoundErrorHandler(errorEvent:IOErrorEvent):void {
  1802. trace(errorEvent.text);
  1803. }
  1804. }
  1805. }
  1806. </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 ">
  1807. The number of seconds to preload an embedded streaming sound into a buffer before it starts
  1808. to stream.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  1809. </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 ">
  1810. The number of seconds to preload an embedded streaming sound into a buffer before it starts
  1811. to stream. The data in a loaded sound, including its buffer time,
  1812. cannot be accessed by a SWF file that is in a different domain
  1813. unless you implement a cross-domain policy file.
  1814. For more information about security and sound, see the Sound class description.
  1815. <ph class="- topic/ph ">The data in a loaded sound, including its buffer time,
  1816. cannot be accessed by code in a file that is in a different domain
  1817. unless you implement a cross-domain policy file. However, in the application sandbox
  1818. in an AIR application, code can access data in sound files from any source.
  1819. For more information about security and sound, see the Sound class description.</ph>
  1820. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.bufferTime</codeph> property only affects the buffer time
  1821. for embedded streaming sounds in a SWF and is independent of dynamically created
  1822. Sound objects (that is, Sound objects created in ActionScript).
  1823. The value of <codeph class="+ topic/ph pr-d/codeph ">SoundMixer.bufferTime</codeph> cannot override
  1824. or set the default of the buffer time specified in the SoundLoaderContext object
  1825. that is passed to the <codeph class="+ topic/ph pr-d/codeph ">Sound.load()</codeph> method.</p>
  1826. </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 ">
  1827. The SoundTransform object that controls global sound properties.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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>
  1828. </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 ">
  1829. The SoundTransform object that controls global sound properties. A SoundTransform object
  1830. includes properties for setting volume, panning, left speaker assignment, and right
  1831. speaker assignment. The SoundTransform object used in this property provides final sound settings
  1832. that are applied to all sounds after any individual sound settings are applied.
  1833. </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 ">
  1834. The CameraUI class allows you to capture a still image or video using the default camera application on a device.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1835. The CameraUI class allows you to capture a still image or video using the default camera application on a device.
  1836. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">launch()</codeph> method requests that the device open the default camera application.
  1837. The captured image or video is available in the MediaEvent object dispatched for the complete event.
  1838. Since the default camera application can save the image or video in a variety of formats, there
  1839. is no guarantee that returned media object can be loaded and displayed by the AIR runtime. </p>
  1840. <p class="- topic/p ">On some platforms, the media object returned by the camera is accessible as a file-based media promise. On others,
  1841. the media promise is not file-based and the <codeph class="+ topic/ph pr-d/codeph ">file</codeph> and <codeph class="+ topic/ph pr-d/codeph ">relativePath</codeph>
  1842. properties of the MediaPromise object are <codeph class="+ topic/ph pr-d/codeph ">null</codeph>. Do not use these properties in
  1843. code that is used on more than one platform.</p>
  1844. <p class="- topic/p ">On some platforms, the media object is automatically stored in the device media library. On those
  1845. platforms on which images and video are not automatically stored by the default camera application, you can use the
  1846. CameraRoll <codeph class="+ topic/ph pr-d/codeph ">addBitmapData()</codeph> function to store the media object.</p>
  1847. <p class="- topic/p ">On Android, the default camera application does not open if the external storage card is not available
  1848. (such as when the user has mounted the card as a USB mass storage device). In addition, the AIR application
  1849. that launches the camera loses focus. If the device runs low on resources, the AIR application can be
  1850. terminated by the operating system before the media capture is complete.</p>
  1851. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> This feature is supported
  1852. on mobile devices, but it is not supported on desktop operating systems or AIR for TV devices. You can test
  1853. for support at run time using the <codeph class="+ topic/ph pr-d/codeph ">CameraUI.isSupported</codeph> property. See
  1854. <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
  1855. AIR Profile Support</xref> for more information regarding API support across multiple profiles.</p>
  1856. </apiDesc><example conref="examples\CameraUIExample.Still.1.as" class="- topic/example "> The following example uses the CameraUI class to launch the default camera
  1857. application on the device. When a picture is taken by the user, the example places the
  1858. image on the display list.
  1859. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  1860. package {
  1861. import flash.desktop.NativeApplication;
  1862. import flash.display.Loader;
  1863. import flash.display.MovieClip;
  1864. import flash.display.StageAlign;
  1865. import flash.display.StageScaleMode;
  1866. import flash.events.ErrorEvent;
  1867. import flash.events.Event;
  1868. import flash.events.IOErrorEvent;
  1869. import flash.events.MediaEvent;
  1870. import flash.media.CameraUI;
  1871. import flash.media.MediaPromise;
  1872. import flash.media.MediaType;
  1873. public class CameraUIStillImage extends MovieClip{
  1874. private var deviceCameraApp:CameraUI = new CameraUI();
  1875. private var imageLoader:Loader;
  1876. public function CameraUIStillImage() {
  1877. this.stage.align = StageAlign.TOP_LEFT;
  1878. this.stage.scaleMode = StageScaleMode.NO_SCALE;
  1879. if( CameraUI.isSupported )
  1880. {
  1881. trace( "Initializing camera..." );
  1882. deviceCameraApp.addEventListener( MediaEvent.COMPLETE, imageCaptured );
  1883. deviceCameraApp.addEventListener( Event.CANCEL, captureCanceled );
  1884. deviceCameraApp.addEventListener( ErrorEvent.ERROR, cameraError );
  1885. deviceCameraApp.launch( MediaType.IMAGE );
  1886. }
  1887. else
  1888. {
  1889. trace( "Camera interface is not supported.");
  1890. }
  1891. }
  1892. private function imageCaptured( event:MediaEvent ):void
  1893. {
  1894. trace( "Media captured..." );
  1895. var imagePromise:MediaPromise = event.data;
  1896. if( imagePromise.isAsync )
  1897. {
  1898. trace( "Asynchronous media promise." );
  1899. imageLoader = new Loader();
  1900. imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, asyncImageLoaded );
  1901. imageLoader.addEventListener( IOErrorEvent.IO_ERROR, cameraError );
  1902. imageLoader.loadFilePromise( imagePromise );
  1903. }
  1904. else
  1905. {
  1906. trace( "Synchronous media promise." );
  1907. imageLoader.loadFilePromise( imagePromise );
  1908. showMedia( imageLoader );
  1909. }
  1910. }
  1911. private function captureCanceled( event:Event ):void
  1912. {
  1913. trace( "Media capture canceled." );
  1914. NativeApplication.nativeApplication.exit();
  1915. }
  1916. private function asyncImageLoaded( event:Event ):void
  1917. {
  1918. trace( "Media loaded in memory." );
  1919. showMedia( imageLoader );
  1920. }
  1921. private function showMedia( loader:Loader ):void
  1922. {
  1923. this.addChild( loader );
  1924. }
  1925. private function cameraError( error:ErrorEvent ):void
  1926. {
  1927. trace( "Error:" + error.text );
  1928. NativeApplication.nativeApplication.exit();
  1929. }
  1930. }
  1931. }
  1932. </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, and the Camera</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 ">
  1933. The cancel event is dispatched when the user closes the Camera UI without
  1934. saving a picture or 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="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 ">
  1935. The <codeph class="+ topic/ph pr-d/codeph ">cancel</codeph> event is dispatched when the user closes the Camera UI without
  1936. saving a picture or video.
  1937. </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 ">
  1938. The error event is dispatched when the default camera cannot be opened.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1939. The <codeph class="+ topic/ph pr-d/codeph ">error</codeph> event is dispatched when the default camera cannot be opened.
  1940. </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 ">
  1941. The complete event is dispatched when the user either captures a still picture or
  1942. video in the Camera UI.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1943. The <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> event is dispatched when the user either captures a still picture or
  1944. video in the Camera UI.
  1945. </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 ">
  1946. Creates a CameraUI object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1947. Creates a CameraUI object.
  1948. </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 ">
  1949. Launches the default camera application on the device.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">The type of media object to capture. The valid values for this parameter
  1950. are defined in the MediaType class:
  1951. <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>
  1952. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  1953. Launches the default camera application on the device.
  1954. <p class="- topic/p ">You can capture either still images or video with this class. Video capture uses the
  1955. "Quality Low" camcorder profile on the device.</p>
  1956. <p class="- topic/p ">When the <codeph class="+ topic/ph pr-d/codeph ">launch()</codeph> method is called, the default camera application on
  1957. the device is invoked. The AIR application loses focus and waits for the user to
  1958. capture a still image or to finish capturing video. Once the desired media is captured by the user,
  1959. the AIR application regains focus and this CameraUI object dispatches a <codeph class="+ topic/ph pr-d/codeph ">complete</codeph>
  1960. event. If the user cancels the operation, this CameraUI object dispatches a <codeph class="+ topic/ph pr-d/codeph ">cancel</codeph>
  1961. event instead.</p>
  1962. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> It is possible for the AIR application to be shut down by the Android operating
  1963. system while it is in the background waiting for the user to capture an image or video. If this happens,
  1964. the user must restart the application. The AIR application does not dispatch a media event for the
  1965. previous image capture.</p>
  1966. <p class="- topic/p ">You can access the captured media file using the <codeph class="+ topic/ph pr-d/codeph ">data</codeph> property of the
  1967. MediaEvent object dispatched for the <codeph class="+ topic/ph pr-d/codeph ">complete</codeph> event. This property is an instance
  1968. of the MediaPromise class, which you can load into your application using the
  1969. <codeph class="+ topic/ph pr-d/codeph ">loadFilePromise()</codeph> method of the Loader class. Note that the device camera can
  1970. save captured media in a variety of formats. Video is particularly problematic in this regard.
  1971. It might not be possible to display the captured media in AIR.</p>
  1972. </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 ">Dispatched when a media object is captured.
  1973. </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">Dispatched when a media object is captured.</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 ">Dispatched when the user exits from the native camera without capturing a media object.
  1974. </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">Dispatched when the user exits from the native camera without capturing a media object.</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 ">Dispatched if the default camera application is already in use.
  1975. </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">Dispatched if the default camera application is already in use.</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 ">Dispatched if the AIR application is in the background when it calls this function.
  1976. </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">Dispatched if the AIR application is in the background when it calls this function.</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 ">
  1977. Reports whether the CameraUI class is supported on the current device.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1978. Reports whether the CameraUI class is supported on the current device.
  1979. </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 ">
  1980. The SoundCodec class is an enumeration of constant values used in setting the codec property
  1981. of the Microphone class.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">
  1982. The SoundCodec class is an enumeration of constant values used in setting the <codeph class="+ topic/ph pr-d/codeph ">codec</codeph> property
  1983. of the <codeph class="+ topic/ph pr-d/codeph ">Microphone</codeph> class.
  1984. </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 ">
  1985. Specifies that the Nellymoser codec be used for compressing audio.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">
  1986. Specifies that the Nellymoser codec be used for compressing audio.
  1987. This constant is the default value of the <codeph class="+ topic/ph pr-d/codeph ">Microphone.codec</codeph> property.
  1988. </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 ">
  1989. Specifies that the Speex codec be used for compressing audio.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">
  1990. Specifies that the Speex codec be used for compressing audio.
  1991. </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 ">
  1992. The CameraRoll class allows you to access image data in the system media library or "camera roll."
  1993. AIR profile support: This feature is supported
  1994. on mobile devices, but it is not supported on desktop operating systems or AIR for TV devices.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  1995. The CameraRoll class allows you to access image data in the system media library or "camera roll."
  1996. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> This feature is supported
  1997. on mobile devices, but it is not supported on desktop operating systems or AIR for TV devices. See
  1998. <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
  1999. AIR Profile Support</xref> for more information regarding API support across multiple profiles.</p>
  2000. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.addBitmapData()</codeph> method adds an image to the device's dedicated media library. To check at run time whether your
  2001. application supports the <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.addBitmapData()</codeph> method, check the <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.supportsAddBitmapData</codeph> property.</p>
  2002. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.browseForImage()</codeph> method opens an image-choosing dialog that allows a user to choose an image in the
  2003. media library. When the user selects an image, the CameraRoll object dispatches a <codeph class="+ topic/ph pr-d/codeph ">select</codeph> event. Use the MediaEvent object
  2004. dispatched for this event to access the chosen image. To check at run time whether your
  2005. application supports the <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.browseForImage()</codeph> method, check the <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.supportsBrowseForImage</codeph> property.</p>
  2006. </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 ">
  2007. Dispatched when a user cancels a browse-for-image operation without selecting an image.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  2008. Dispatched when a user cancels a browse-for-image operation without selecting an image.
  2009. </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 ">
  2010. Dispatched when a user selects an image from the device media library.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  2011. Dispatched when a user selects an image from the device media library.
  2012. <p class="- topic/p ">The MediaEvent object dispatched for this event provides access to the chosen media.</p>
  2013. </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 ">
  2014. The error event is dispatched when an error occurs.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  2015. The <codeph class="+ topic/ph pr-d/codeph ">error</codeph> event is dispatched when an error occurs.
  2016. <p class="- topic/p ">Sources of errors include:</p>
  2017. <ul class="- topic/ul "><li class="- topic/li ">An image browser cannot be opened.</li><li class="- topic/li ">An image browser is already in use.</li><li class="- topic/li ">The AIR application attempts to browse for an image while in the background.</li><li class="- topic/li ">An image cannot be added to the media library.</li><li class="- topic/li ">A method is called that is not supported on the device.</li></ul>
  2018. </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 ">
  2019. Signals that an addBitmapData() operation completed successfully.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  2020. Signals that an addBitmapData() operation completed successfully.
  2021. </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 ">
  2022. Creates a CameraRoll object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  2023. Creates a CameraRoll object.
  2024. <p class="- topic/p ">There is only a single media library supported by ActionScript. All CameraRoll objects
  2025. save to the same image repository.</p>
  2026. </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 ">
  2027. Adds an image to the device camera roll.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">a BitmapData object containing the image to send to the camera roll.
  2028. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  2029. Adds an image to the device camera roll.
  2030. <p class="- topic/p ">To check at run time whether your application supports the <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.addBitmapData()</codeph> method,
  2031. check the <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.supportsAddBitmapData</codeph> property.</p>
  2032. </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 ">
  2033. Opens an image browser dialog to allow the user to select an existing image from the device camera roll.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  2034. Opens an image browser dialog to allow the user to select an existing image from the device camera roll.
  2035. <p class="- topic/p ">When the user selects an image, this CameraRoll instance dispatches a <codeph class="+ topic/ph pr-d/codeph ">select</codeph> event containing a MediaEvent
  2036. object. Use the <codeph class="+ topic/ph pr-d/codeph ">data</codeph> property of the MediaEvent object to load the image. The <codeph class="+ topic/ph pr-d/codeph ">data</codeph> property
  2037. is a MediaPromise object, which you can load using the <codeph class="+ topic/ph pr-d/codeph ">loadFilePromise()</codeph> method of the Loader class.</p>
  2038. <p class="- topic/p ">To check at run time whether your application supports the <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.browseForImage()</codeph> method,
  2039. check the <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.supportsBrowseForImage</codeph> property.</p>
  2040. </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
  2041. {
  2042. import flash.media.CameraRoll;
  2043. import flash.media.MediaPromise;
  2044. import flash.media.MediaType;
  2045. import flash.events.MediaEvent;
  2046. import flash.events.Event;
  2047. import flash.display.Loader;
  2048. import flash.display.Sprite;
  2049. import flash.events.IOErrorEvent;
  2050. import flash.display.StageAlign;
  2051. import flash.display.StageScaleMode;
  2052. public class CameraRollTest extends Sprite{
  2053. private var mediaSource:CameraRoll = new CameraRoll();
  2054. public function CameraRollTest() {
  2055. this.stage.align = StageAlign.TOP_LEFT;
  2056. this.stage.scaleMode = StageScaleMode.NO_SCALE;
  2057. if( CameraRoll.supportsBrowseForImage )
  2058. {
  2059. log( "Browsing for image..." );
  2060. mediaSource.addEventListener( MediaEvent.SELECT, imageSelected );
  2061. mediaSource.addEventListener( Event.CANCEL, browseCanceled );
  2062. mediaSource.browseForImage();
  2063. }
  2064. else
  2065. {
  2066. log( "Browsing in camera roll is not supported.");
  2067. }
  2068. }
  2069. private var imageLoader:Loader;
  2070. private function imageSelected( event:MediaEvent ):void
  2071. {
  2072. log( "Image selected..." );
  2073. var imagePromise:MediaPromise = event.data;
  2074. imageLoader = new Loader();
  2075. if( imagePromise.isAsync )
  2076. {
  2077. log( "Asynchronous media promise." );
  2078. imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, imageLoaded );
  2079. imageLoader.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, imageLoadFailed );
  2080. imageLoader.loadFilePromise( imagePromise );
  2081. }
  2082. else
  2083. {
  2084. log( "Synchronous media promise." );
  2085. imageLoader.loadFilePromise( imagePromise );
  2086. this.addChild( imageLoader );
  2087. }
  2088. }
  2089. private function browseCanceled( event:Event ):void
  2090. {
  2091. log( "Image browse canceled." );
  2092. }
  2093. private function imageLoaded( event:Event ):void
  2094. {
  2095. log( "Image loaded asynchronously." );
  2096. this.addChild( imageLoader );
  2097. }
  2098. private function imageLoadFailed( event:Event ):void
  2099. {
  2100. log( "Image load failed." );
  2101. }
  2102. private function log( text:String ):void
  2103. {
  2104. trace( text );
  2105. }
  2106. }
  2107. }
  2108. </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 ">Dispatched when the user chooses an image.
  2109. </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">Dispatched when the user chooses an image.</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 ">Dispatched when a user cancels the browse operation.
  2110. </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">Dispatched when a user cancels the browse operation.</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 ">Dispatched if the default image browser application is already in use.
  2111. </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">Dispatched if the default image browser application is already in use.</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 ">Dispatched if the AIR application is in the background when it calls this function.
  2112. </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">Dispatched if the AIR application is in the background when it calls this function.</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 ">
  2113. Whether the CameraRoll.addBitmapData() method is supported.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  2114. Whether the <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.addBitmapData()</codeph> method is supported. Currently, the feature
  2115. is only supported in AIR applications on mobile devices.
  2116. </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 ">
  2117. Reports whether the CameraRoll.browseForImage() method is supported.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">Reports whether the CameraRoll browseForImage() method is supported.
  2118. </apiTipText></apiTipTexts></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  2119. Reports whether the <codeph class="+ topic/ph pr-d/codeph ">CameraRoll.browseForImage()</codeph> method is supported. Currently, the feature
  2120. is only supported in AIR applications on mobile devices.
  2121. </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 ">
  2122. Use the Microphone class to monitor or capture audio from a 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
  2123. </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 ">
  2124. Use the Microphone class to monitor or capture audio from a microphone.
  2125. <p class="- topic/p ">
  2126. To get a reference to a Microphone instance, use the <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph> method
  2127. or the <codeph class="+ topic/ph pr-d/codeph ">Microphone.getEnhancedMicrophone()</codeph> method. An enhanced microphone instance can
  2128. perform acoustic echo cancellation. Use acoustic echo cancellation to create real-time audio/video applications
  2129. that don't require headsets.
  2130. </p>
  2131. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Create a real-time chat application</b></p>
  2132. <p class="- topic/p ">To create a real-time chat application, capture audio and send it to Flash Media Server.
  2133. Use the NetConnection and NetStream classes to send the audio stream to Flash Media Server.
  2134. Flash Media Server can broadcast the audio to other clients.
  2135. To create a chat application that doesn't require headsets, use acoustic echo
  2136. cancellation. Acoustic echo cancellation prevents the feedback loop that occurs when audio enters a microphone,
  2137. travels out the speakers, and enters the microphone again. To use acoustic echo cancellation, call
  2138. the <codeph class="+ topic/ph pr-d/codeph ">Microphone.getEnhancedMicrophone()</codeph> method to get a reference to a Microphone instance.
  2139. Set <codeph class="+ topic/ph pr-d/codeph ">Microphone.enhancedOptions</codeph> to an instance of the <codeph class="+ topic/ph pr-d/codeph ">MicrophoneEnhancedOptions</codeph> class to
  2140. configure settings.</p>
  2141. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Play microphone audio locally</b></p>
  2142. <p class="- topic/p ">Call the Microphone <codeph class="+ topic/ph pr-d/codeph ">setLoopback()</codeph> method to route the microphone audio directly to
  2143. the local computer or device audio output. Uncontrolled audio feedback is an inherent danger and is likely
  2144. to occur whenever the audio output can be picked up by the microphone input. The
  2145. <codeph class="+ topic/ph pr-d/codeph ">setUseEchoSuppression()</codeph> method can reduce, but not eliminate, the risk of feedback
  2146. amplification.</p>
  2147. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Capture microphone audio for local recording or processing</b></p>
  2148. <p class="- topic/p ">To capture microphone audio, listen for the <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> events dispatched by a
  2149. Microphone instance. The SampleDataEvent object dispatched for this event contains the audio data.</p>
  2150. <p class="- topic/p ">For information about capturing video, see the Camera class.</p>
  2151. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Runtime microphone support</b></p>
  2152. <p class="- topic/p ">The Microphone class is not supported in Flash Player running in a mobile browser.</p>
  2153. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> The Microphone class is supported
  2154. on desktop operating systems, but it is not supported on all mobile devices.
  2155. It is not supported on AIR for TV devices. See
  2156. <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
  2157. AIR Profile Support</xref> for more information regarding API support across multiple profiles.</p>
  2158. <p class="- topic/p ">You can test for support at run time using the <codeph class="+ topic/ph pr-d/codeph ">Microphone.isSupported</codeph> property.
  2159. Note that for AIR for TV devices, <codeph class="+ topic/ph pr-d/codeph ">Microphone.isSupported</codeph> is <codeph class="+ topic/ph pr-d/codeph ">true</codeph> but
  2160. <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph> always returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.</p>
  2161. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Privacy controls</b></p>
  2162. <p class="- topic/p ">
  2163. Flash Player displays a Privacy dialog
  2164. box that lets the user choose whether to allow or deny access to
  2165. the microphone. Your application window size must be at least 215 x 138
  2166. pixels, the minimum size required to display the dialog box, or access is denied automatically.
  2167. </p>
  2168. <p class="- topic/p ">Content running in the AIR application sandbox does not need permission to access the microphone
  2169. and no dialog is displayed. AIR content running outside the application sandbox does require permission
  2170. and the Privacy dialog is displayed.</p>
  2171. </apiDesc><example conref="examples\MicrophoneExample.as" class="- topic/example "> The following example captures sound using echo suppression from a microphone after the
  2172. user allows access to their computer's microphone.
  2173. The <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings()</codeph> method displays the Flash Player dialog box, which requests
  2174. permission to access the user's microphone. The call to <codeph class="+ topic/ph pr-d/codeph ">setLoopBack(true)</codeph> reroutes
  2175. input to the local speaker, so you can hear the sound while you run the example.
  2176. <p class="- topic/p ">Two listeners listen for <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> and
  2177. <codeph class="+ topic/ph pr-d/codeph ">status</codeph> events. The <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event is dispatched at the
  2178. start and end (if any) of the session and is captured by the <codeph class="+ topic/ph pr-d/codeph ">activityHandler()</codeph>
  2179. method, which traces information on the event. The <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event is dispatched if
  2180. the attached microphone object reports any status information; it is captured and traced using
  2181. the <codeph class="+ topic/ph pr-d/codeph ">statusHandler()</codeph> method.</p>
  2182. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> A microphone must be attached to your computer for this example
  2183. to work correctly.</p>
  2184. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  2185. package {
  2186. import flash.display.Sprite;
  2187. import flash.events.*;
  2188. import flash.media.Microphone;
  2189. import flash.system.Security;
  2190. public class MicrophoneExample extends Sprite {
  2191. public function MicrophoneExample() {
  2192. var mic:Microphone = Microphone.getMicrophone();
  2193. Security.showSettings("2");
  2194. mic.setLoopBack(true);
  2195. if (mic != null) {
  2196. mic.setUseEchoSuppression(true);
  2197. mic.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
  2198. mic.addEventListener(StatusEvent.STATUS, statusHandler);
  2199. }
  2200. }
  2201. private function activityHandler(event:ActivityEvent):void {
  2202. trace("activityHandler: " + event);
  2203. }
  2204. private function statusHandler(event:StatusEvent):void {
  2205. trace("statusHandler: " + event);
  2206. }
  2207. }
  2208. }
  2209. </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: Implementing Acoustic Echo Suppression in Flash/Flex applications</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: Voice Notes for 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, and the Microphone</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 ">
  2210. Dispatched when a microphone reports its status.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">
  2211. Dispatched when a microphone reports its status.
  2212. If the value of the <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">"Microphone.Muted"</codeph>,
  2213. the user has refused to allow the SWF file access to the microphone.
  2214. If the value of the <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">"Microphone.Unmuted"</codeph>,
  2215. the user has allowed the SWF file access to the microphone.
  2216. <p class="- topic/p ">Status events are not dispatched in Adobe AIR applications; access to the microphone
  2217. cannot be changed dynamically. On most platforms, AIR applications can always access the microphone.
  2218. On Android, an application must specify the Android RECORD_AUDIO permission in the application
  2219. descriptor. Otherwise, Android denies access to the microphone altogether.</p>
  2220. </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 ">
  2221. Dispatched when the microphone has sound data in the buffer.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">
  2222. Dispatched when the microphone has sound data in the buffer.
  2223. <p class="- topic/p ">
  2224. The <codeph class="+ topic/ph pr-d/codeph ">Microphone.rate</codeph> property determines the number of samples generated
  2225. per second. The number of samples per event is a factor of the number of samples
  2226. per second and the latency between event calls.
  2227. </p>
  2228. </apiDesc><example conref="examples\Microphone.sampleDataEvent.1.as" class="- topic/example "> The following example captures 4 seconds of audio samples from the default microphone
  2229. and then plays the audio back. Be sure that there is a microphone attached. The the <codeph class="+ topic/ph pr-d/codeph ">micSampleDataHandler()</codeph>
  2230. is the event listener for the <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> event of the Microphone object. The <codeph class="+ topic/ph pr-d/codeph ">micSampleDataHandler()</codeph>
  2231. method gets the samples as they become available and appends their values to a ByteArray object. A Timer
  2232. object is set for 4 seconds. The Timer removes the <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> event of the Microphone object event listener,
  2233. creates a Sound object, and adds a <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph> event listener for the Sound object. The <codeph class="+ topic/ph pr-d/codeph ">sampleData</codeph>
  2234. event listener for the Sound object, the <codeph class="+ topic/ph pr-d/codeph ">playbackSampleHandler()</codeph> method, provides audio samples
  2235. for the Sound object to play. These audio samples are retrieved from the ByteArray object that stored the
  2236. Microphone samples. The samples are written to the Sound object twice since the Microphone samples are
  2237. recorded in monaural sound and the Sound object requests stereo pairs of samples. The <codeph class="+ topic/ph pr-d/codeph ">rate</codeph>
  2238. property of the Microphone object is set to 44, to match the 44-kHz sample rate used by Sound objects.
  2239. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  2240. const DELAY_LENGTH:int = 4000;
  2241. var mic:Microphone = Microphone.getMicrophone();
  2242. mic.setSilenceLevel(0, DELAY_LENGTH);
  2243. mic.gain = 100;
  2244. mic.rate = 44;
  2245. mic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);
  2246. var timer:Timer = new Timer(DELAY_LENGTH);
  2247. timer.addEventListener(TimerEvent.TIMER, timerHandler);
  2248. timer.start();
  2249. var soundBytes:ByteArray = new ByteArray();
  2250. function micSampleDataHandler(event:SampleDataEvent):void
  2251. {
  2252. while(event.data.bytesAvailable)
  2253. {
  2254. var sample:Number = event.data.readFloat();
  2255. soundBytes.writeFloat(sample);
  2256. }
  2257. }
  2258. function timerHandler(event:TimerEvent):void
  2259. {
  2260. mic.removeEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);
  2261. timer.stop();
  2262. soundBytes.position = 0;
  2263. var sound:Sound = new Sound();
  2264. sound.addEventListener(SampleDataEvent.SAMPLE_DATA, playbackSampleHandler);
  2265. sound.play();
  2266. }
  2267. function playbackSampleHandler(event:SampleDataEvent):void
  2268. {
  2269. for (var i:int = 0; i &lt; 8192 &amp;&amp; soundBytes.bytesAvailable &gt; 0; i++)
  2270. {
  2271. var sample:Number = soundBytes.readFloat();
  2272. event.data.writeFloat(sample);
  2273. event.data.writeFloat(sample);
  2274. }
  2275. }
  2276. </codeblock></example><example conref="examples\MicrophoneExample.as" class="- topic/example "> The following example captures sound using echo suppression from a microphone after the
  2277. user allows access to their computer's microphone.
  2278. The <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings()</codeph> method displays the Flash Player dialog box, which requests
  2279. permission to access the user's microphone. The call to <codeph class="+ topic/ph pr-d/codeph ">setLoopBack(true)</codeph> reroutes
  2280. input to the local speaker, so you can hear the sound while you run the example.
  2281. <p class="- topic/p ">Two listeners listen for <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> and
  2282. <codeph class="+ topic/ph pr-d/codeph ">status</codeph> events. The <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event is dispatched at the
  2283. start and end (if any) of the session and is captured by the <codeph class="+ topic/ph pr-d/codeph ">activityHandler()</codeph>
  2284. method, which traces information on the event. The <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event is dispatched if
  2285. the attached microphone object reports any status information; it is captured and traced using
  2286. the <codeph class="+ topic/ph pr-d/codeph ">statusHandler()</codeph> method.</p>
  2287. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> A microphone must be attached to your computer for this example
  2288. to work correctly.</p>
  2289. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  2290. package {
  2291. import flash.display.Sprite;
  2292. import flash.events.*;
  2293. import flash.media.Microphone;
  2294. import flash.system.Security;
  2295. public class MicrophoneExample extends Sprite {
  2296. public function MicrophoneExample() {
  2297. var mic:Microphone = Microphone.getMicrophone();
  2298. Security.showSettings("2");
  2299. mic.setLoopBack(true);
  2300. if (mic != null) {
  2301. mic.setUseEchoSuppression(true);
  2302. mic.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
  2303. mic.addEventListener(StatusEvent.STATUS, statusHandler);
  2304. }
  2305. }
  2306. private function activityHandler(event:ActivityEvent):void {
  2307. trace("activityHandler: " + event);
  2308. }
  2309. private function statusHandler(event:StatusEvent):void {
  2310. trace("statusHandler: " + event);
  2311. }
  2312. }
  2313. }
  2314. </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 ">
  2315. Dispatched when a microphone starts or stops recording due to detected silence.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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 ">
  2316. Dispatched when a microphone starts or stops recording due to detected silence.
  2317. <p class="- topic/p ">
  2318. To specify the amount of sound required to trigger this event
  2319. with an <codeph class="+ topic/ph pr-d/codeph ">activating</codeph> property of <codeph class="+ topic/ph pr-d/codeph ">true</codeph>,
  2320. or the amount of time that must elapse without sound to
  2321. trigger this event with an <codeph class="+ topic/ph pr-d/codeph ">activating</codeph> property of
  2322. <codeph class="+ topic/ph pr-d/codeph ">false</codeph>, use <codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph>.
  2323. </p>
  2324. <p class="- topic/p ">For a Microphone object to dispatch activity events, the application must be monitoring
  2325. the input, either by calling <codeph class="+ topic/ph pr-d/codeph ">setLoopback( true )</codeph>, by listening for
  2326. sampleData events, or by attaching the microphone to a NetStream object.</p>
  2327. </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 ">
  2328. Returns a reference to an enhanced Microphone object that can
  2329. perform acoustic echo cancellation.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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 ">A reference to a Microphone object for capturing audio. If enhanced audio fails to initialize, returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.
  2330. </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 ">The index value of the microphone.
  2331. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  2332. Returns a reference to an enhanced Microphone object that can
  2333. perform acoustic echo cancellation. Use acoustic echo cancellation to create audio/video chat applications
  2334. that don't require headsets.
  2335. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">index</codeph> parameter for the <codeph class="+ topic/ph pr-d/codeph ">Microphone.getEnhancedMicrophone()</codeph> method and the <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph>
  2336. method work the same way.</p>
  2337. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Important:</b> At any given time you can have only a single instance of enhanced microphone device.
  2338. All other Microphone instances stop providing audio data and receive a <codeph class="+ topic/ph pr-d/codeph ">StatusEvent</codeph> with the
  2339. <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property <codeph class="+ topic/ph pr-d/codeph ">Microphone.Unavailable</codeph>. When enhanced audio fails to initialize,
  2340. calls to this method return <codeph class="+ topic/ph pr-d/codeph ">null</codeph>, setting a value for <codeph class="+ topic/ph pr-d/codeph ">Microphone.enhancedOptions</codeph> has no effect,
  2341. and all existing Microphone instances function as before.</p>
  2342. <p class="- topic/p ">To configure an enhanced Microphone object, set the <codeph class="+ topic/ph pr-d/codeph ">Microphone.enhancedOptions</codeph> property. The following
  2343. code uses an enhanced Microphone object and full-duplex acoustic echo cancellation in a local test:</p>
  2344. <pre xml:space="preserve" class="- topic/pre ">
  2345. var mic:Microphone = Microphone.getEnhancedMicrophone();
  2346. var options:MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions();
  2347. options.mode = MicrophoneEnhancedMode.FULL_DUPLEX;
  2348. mic.enhancedOptions = options;
  2349. mic.setLoopBack(true);
  2350. </pre>
  2351. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">setUseEchoSuppression()</codeph> method is ignored when using acoustic echo cancellation.
  2352. </p>
  2353. <p class="- topic/p ">
  2354. When a SWF file tries to access the object returned by <codeph class="+ topic/ph pr-d/codeph ">Microphone.getEnhancedMicrophone()</codeph>
  2355. —for example, when you call <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachAudio()</codeph>—
  2356. Flash Player displays a Privacy dialog box that lets the user choose whether to
  2357. allow or deny access to the microphone. (Make sure your Stage size is at least
  2358. 215 x 138 pixels; this is the minimum size Flash Player requires to display the dialog box.)
  2359. </p>
  2360. </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 ">
  2361. Returns a reference to a Microphone object for capturing audio.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  2362. </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 ">A reference to a Microphone object for capturing audio.
  2363. </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 ">The index value of the microphone.
  2364. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  2365. Returns a reference to a Microphone object for capturing audio.
  2366. To begin capturing the audio, you must attach the Microphone
  2367. object to a NetStream object (see <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachAudio()</codeph>).
  2368. <p class="- topic/p ">
  2369. Multiple calls to <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph> reference the same microphone.
  2370. Thus, if your code contains the lines <codeph class="+ topic/ph pr-d/codeph ">mic1 = Microphone.getMicrophone()</codeph>
  2371. and
  2372. <codeph class="+ topic/ph pr-d/codeph ">mic2 = Microphone.getMicrophone()</codeph>
  2373. , both <codeph class="+ topic/ph pr-d/codeph ">mic1</codeph> and <codeph class="+ topic/ph pr-d/codeph ">mic2</codeph>
  2374. reference the same (default) microphone.</p>
  2375. <p class="- topic/p ">
  2376. In general, you should not pass a value for <codeph class="+ topic/ph pr-d/codeph ">index</codeph>. Simply call
  2377. <codeph class="+ topic/ph pr-d/codeph ">air.Microphone.getMicrophone()</codeph>
  2378. to return a reference to the default microphone.
  2379. Using the Microphone Settings section in the Flash Player settings panel, the user can specify the default
  2380. microphone the application should use. (The user access the Flash Player settings panel by right-clicking
  2381. Flash Player content running in a web browser.) If you pass a value for <codeph class="+ topic/ph pr-d/codeph ">index</codeph>, you can
  2382. reference a microphone other than the one the user chooses. You can use <codeph class="+ topic/ph pr-d/codeph ">index</codeph> in
  2383. rare cases—for example, if your application is capturing audio from two microphones
  2384. at the same time. Content running in Adobe AIR also uses the Flash Player setting for the default
  2385. microphone.</p>
  2386. <p class="- topic/p ">
  2387. Use the <codeph class="+ topic/ph pr-d/codeph ">Microphone.index</codeph> property to get the index value of the current
  2388. Microphone object. You can then pass this value to other methods of the
  2389. Microphone class.
  2390. </p>
  2391. <p class="- topic/p ">
  2392. When a SWF file tries to access the object returned by <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph>
  2393. —for example, when you call <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachAudio()</codeph>—
  2394. Flash Player displays a Privacy dialog box that lets the user choose whether to
  2395. allow or deny access to the microphone. (Make sure your Stage size is at least
  2396. 215 x 138 pixels; this is the minimum size Flash Player requires to display the dialog box.)
  2397. </p>
  2398. <p class="- topic/p ">
  2399. When the user responds to this dialog box, a <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event is dispatched
  2400. that indicates the user's response. You can also check the <codeph class="+ topic/ph pr-d/codeph ">Microphone.muted</codeph>
  2401. property to determine if the user has allowed or denied access to the microphone.
  2402. </p>
  2403. <p class="- topic/p ">
  2404. If <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph> returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>, either the microphone is in use
  2405. by another application, or there are no microphones installed on the system. To determine
  2406. whether any microphones are installed, use <codeph class="+ topic/ph pr-d/codeph ">Microphones.names.length</codeph>. To display
  2407. the Flash Player Microphone Settings panel, which lets the user choose the microphone to be
  2408. referenced by <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone</codeph>, use <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings()</codeph>.
  2409. </p>
  2410. </apiDesc><example conref="examples\Microphone_getMicrophone.as" class="- topic/example "> The following example shows how you can request access to the user's microphone using the static Microphone.getMicrophone() method and listening for the status event.
  2411. Example provided by
  2412. <xref href="http://actionscriptexamples.com/2008/12/04/detecting-the-microphone-in-flash-using-actionscript-30/" scope="_mmexternal" class="- topic/xref ">ActionScriptExamples.com</xref>.
  2413. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  2414. var mic:Microphone = Microphone.getMicrophone();
  2415. mic.setLoopBack();
  2416. mic.addEventListener(StatusEvent.STATUS, mic_status);
  2417. var tf:TextField = new TextField();
  2418. tf.autoSize = TextFieldAutoSize.LEFT;
  2419. tf.text = "Detecting microphone...";
  2420. addChild(tf);
  2421. function mic_status(evt:StatusEvent):void {
  2422. tf.text = "Microphone is muted?: " + mic.muted;
  2423. switch (evt.code) {
  2424. case "Microphone.Unmuted":
  2425. tf.appendText("\n" + "Microphone access was allowed.");
  2426. break;
  2427. case "Microphone.Muted":
  2428. tf.appendText("\n" + "Microphone access was denied.");
  2429. break;
  2430. }
  2431. }
  2432. </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 ">Dispatched when a microphone reports its status.
  2433. If the value of the <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">"Microphone.Muted"</codeph>,
  2434. the user has refused to allow the SWF file access to the user's microphone.
  2435. If the value of the <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">"Microphone.Unmuted"</codeph>,
  2436. the user has allowed the SWF file access to the user's microphone.
  2437. </apiDesc></adobeApiEventDetail><shortdesc class="- topic/shortdesc ">Dispatched when a microphone reports its status.</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 ">
  2438. Routes audio captured by a microphone to the local speakers.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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.
  2439. </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 ">
  2440. Routes audio captured by a microphone to the local speakers.
  2441. </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 ">
  2442. Sets the minimum input level that should be considered sound and (optionally) the amount
  2443. of silent time signifying that silence has actually begun.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  2444. </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 ">The amount of sound required to activate the microphone
  2445. and dispatch the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event. Acceptable values range from 0 to 100.
  2446. </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 ">The number of milliseconds that must elapse without
  2447. activity before Flash Player or Adobe AIR considers sound to have stopped and dispatches the
  2448. <codeph class="+ topic/ph pr-d/codeph ">dispatch</codeph> event. The default value is 2000 (2 seconds).
  2449. (<b class="+ topic/ph hi-d/b ">Note</b>: The default value shown
  2450. in the signature, -1, is an internal value that indicates to Flash Player or Adobe AIR to use 2000.)
  2451. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  2452. Sets the minimum input level that should be considered sound and (optionally) the amount
  2453. of silent time signifying that silence has actually begun.
  2454. <ul class="- topic/ul "><li class="- topic/li ">To prevent the microphone from detecting sound at all, pass a value of 100 for
  2455. <codeph class="+ topic/ph pr-d/codeph ">silenceLevel</codeph>; the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event is never dispatched. </li><li class="- topic/li ">To determine the amount of sound the microphone is currently detecting, use <codeph class="+ topic/ph pr-d/codeph ">Microphone.activityLevel</codeph>. </li></ul>
  2456. <p class="- topic/p ">Speex includes voice activity detection (VAD) and automatically reduces bandwidth when no voice is detected.
  2457. When using the Speex codec, Adobe recommends that you set the silence level to 0.</p>
  2458. <p class="- topic/p ">Activity detection is the ability to detect when audio levels suggest that a person is talking.
  2459. When someone is not talking, bandwidth can be saved because there is no need to send the associated
  2460. audio stream. This information can also be used for visual feedback so that users know
  2461. they (or others) are silent.</p>
  2462. <p class="- topic/p ">Silence values correspond directly to activity values. Complete silence is an activity value of 0.
  2463. Constant loud noise (as loud as can be registered based on the current gain setting) is an activity value
  2464. of 100. After gain is appropriately adjusted, your activity value is less than your silence value when
  2465. you're not talking; when you are talking, the activity value exceeds your silence value.</p>
  2466. <p class="- topic/p ">This method is similar to <codeph class="+ topic/ph pr-d/codeph ">Camera.setMotionLevel()</codeph>; both methods are used to
  2467. specify when the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event is dispatched. However, these methods have
  2468. a significantly different impact on publishing streams:</p>
  2469. <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">Camera.setMotionLevel()</codeph> is designed to detect motion and does not affect bandwidth
  2470. usage. Even if a video stream does not detect motion, video is still sent.</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> is designed to optimize bandwidth. When an audio
  2471. stream is considered silent, no audio data is sent. Instead, a single message is sent, indicating
  2472. that silence has started. </li></ul>
  2473. </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 ">
  2474. Specifies whether to use the echo suppression feature of the audio 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="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
  2475. </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 ">A Boolean value indicating whether to use echo suppression
  2476. (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>) or not (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>).
  2477. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  2478. Specifies whether to use the echo suppression feature of the audio codec. The default value is
  2479. <codeph class="+ topic/ph pr-d/codeph ">false</codeph> unless the user has selected Reduce Echo in the Flash Player Microphone
  2480. Settings panel.
  2481. <p class="- topic/p ">Echo suppression is an effort to reduce the effects of audio feedback, which is caused when
  2482. sound going out the speaker is picked up by the microphone on the same system. (This is different
  2483. from acoustic echo cancellation, which completely removes the feedback. The <codeph class="+ topic/ph pr-d/codeph ">setUseEchoSuppression()</codeph> method
  2484. is ignored when you call the <codeph class="+ topic/ph pr-d/codeph ">getEnhancedMicrophone()</codeph> method to use acoustic echo cancellation.)</p>
  2485. <p class="- topic/p ">Generally, echo suppression is advisable when the sound being captured is played through
  2486. speakers — instead of a headset —. If your SWF file allows users to specify the
  2487. sound output device, you may want to call <codeph class="+ topic/ph pr-d/codeph ">Microphone.setUseEchoSuppression(true)</codeph>
  2488. if they indicate they are using speakers and will be using the microphone as well. </p>
  2489. <p class="- topic/p ">Users can also adjust these settings in the Flash Player Microphone Settings panel.</p>
  2490. </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 ">
  2491. The amount of sound the microphone is detecting.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  2492. </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 ">
  2493. The amount of sound the microphone is detecting. Values range from
  2494. 0 (no sound is detected) to 100 (very loud sound is detected). The value of this property can
  2495. help you determine a good value to pass to the <codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> method.
  2496. <p class="- topic/p ">If the microphone <codeph class="+ topic/ph pr-d/codeph ">muted</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">true</codeph>, the value of this property is always -1.</p>
  2497. </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 ">
  2498. The codec to use for compressing audio.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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
  2499. </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 ">
  2500. The codec to use for compressing audio. Available codecs are Nellymoser (the default) and Speex. The enumeration class <codeph class="+ topic/ph pr-d/codeph ">SoundCodec</codeph> contains
  2501. the various values that are valid for the <codeph class="+ topic/ph pr-d/codeph ">codec</codeph> property.
  2502. <p class="- topic/p ">If you use the Nellymoser codec, you can set the sample rate using <codeph class="+ topic/ph pr-d/codeph ">Microphone.rate()</codeph>.
  2503. If you use the Speex codec, the sample rate is set to 16 kHz.</p>
  2504. <p class="- topic/p ">Speex includes voice activity detection (VAD) and automatically reduces bandwidth when no voice is detected.
  2505. When using the Speex codec, Adobe recommends that you set the silence level to 0. To set the silence level, use the
  2506. <codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> method.</p>
  2507. </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 ">
  2508. Enable Speex voice activity detection.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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,
  2509. </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 ">
  2510. Enable Speex voice activity detection.
  2511. </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 ">
  2512. The encoded speech quality when using the Speex 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><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Microphone, audio, sound,
  2513. </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 ">
  2514. The encoded speech quality when using the Speex codec. Possible values are from 0 to 10. The default value is 6.
  2515. Higher numbers represent higher quality but require more bandwidth, as shown in the following table. The bit rate values that are listed
  2516. represent net bit rates and do not include packetization overhead.
  2517. <p class="- topic/p ">
  2518. <adobetable class="innertable"><tgroup cols="2" class="- topic/tgroup "><thead class="- topic/thead "><row class="- topic/row "><entry class="- topic/entry ">Quality value</entry><entry class="- topic/entry ">Required bit rate (kilobits per second)</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>
  2519. </p>
  2520. </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 ">
  2521. Controls enhanced microphone options.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="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 ">
  2522. Controls enhanced microphone options. For more information, see
  2523. <codeph class="+ topic/ph pr-d/codeph ">MicrophoneEnhancedOptions</codeph> class. This property is ignored for non-enhanced Microphone instances.
  2524. </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 ">
  2525. Number of Speex speech frames transmitted in a packet (message).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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,
  2526. </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 ">
  2527. Number of Speex speech frames transmitted in a packet (message).
  2528. Each frame is 20 ms long. The default value is two frames per packet.
  2529. <p class="- topic/p ">The more Speex frames in a message, the lower the bandwidth required but the longer the delay in sending the
  2530. message. Fewer Speex frames increases bandwidth required but reduces delay.</p>
  2531. </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 ">
  2532. The amount by which the microphone boosts the signal.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  2533. </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 ">
  2534. The amount by which the microphone boosts the signal. Valid values are 0 to 100. The default value is 50.
  2535. </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 ">
  2536. The index of the microphone, as reflected in the array returned by
  2537. 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
  2538. </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 ">
  2539. The index of the microphone, as reflected in the array returned by
  2540. <codeph class="+ topic/ph pr-d/codeph ">Microphone.names</codeph>.
  2541. </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 ">
  2542. The isSupported property is set to true if the
  2543. Microphone class is supported on the current platform, otherwise it is
  2544. set to 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 ">
  2545. The <codeph class="+ topic/ph pr-d/codeph ">isSupported</codeph> property is set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if the
  2546. Microphone class is supported on the current platform, otherwise it is
  2547. set to <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
  2548. </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 ">
  2549. Specifies whether the user has denied access to the microphone (true)
  2550. or allowed access (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
  2551. </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 ">
  2552. Specifies whether the user has denied access to the microphone (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>)
  2553. or allowed access (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>). When this value changes,
  2554. a <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event is dispatched.
  2555. For more information, see <codeph class="+ topic/ph pr-d/codeph ">Microphone.getMicrophone()</codeph>.
  2556. </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 ">
  2557. The name of the current sound capture device, as returned by the sound capture hardware.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  2558. </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 ">
  2559. The name of the current sound capture device, as returned by the sound capture hardware.
  2560. </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 ">
  2561. An array of strings containing the names of all available sound capture devices.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  2562. </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 ">
  2563. An array of strings containing the names of all available sound capture devices.
  2564. The names are returned without
  2565. having to display the Flash Player Privacy Settings panel to the user. This array
  2566. provides the zero-based index of each sound capture device and the
  2567. number of sound capture devices on the system, through the <codeph class="+ topic/ph pr-d/codeph ">Microphone.names.length</codeph> property.
  2568. For more information, see the Array class entry.
  2569. <p class="- topic/p ">Calling <codeph class="+ topic/ph pr-d/codeph ">Microphone.names</codeph> requires an extensive examination of the hardware, and it
  2570. may take several seconds to build the array. In most cases, you can just use the default microphone.</p>
  2571. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> To determine the name of the current microphone,
  2572. use the <codeph class="+ topic/ph pr-d/codeph ">name</codeph> property.</p>
  2573. </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 ">
  2574. Maximum attenuation of the noise in dB (negative number) used for Speex encoder.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><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,
  2575. </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 ">
  2576. Maximum attenuation of the noise in dB (negative number) used for Speex encoder. If enabled, noise suppression is applied to sound captured from Microphone before
  2577. Speex compression. Set to 0 to disable noise suppression. Noise suppression is enabled by default with maximum attenuation of -30 dB. Ignored when Nellymoser
  2578. codec is selected.
  2579. </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 ">
  2580. The rate at which the microphone is capturing sound, in 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
  2581. </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 ">
  2582. The rate at which the microphone is capturing sound, in kHz. Acceptable values are 5, 8, 11, 22, and 44. The default value is 8
  2583. kHz if your sound capture device supports this value. Otherwise, the default value is the next available capture level above 8 kHz
  2584. that your sound capture device supports, usually 11 kHz.
  2585. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> The actual rate differs slightly from the <codeph class="+ topic/ph pr-d/codeph ">rate</codeph> value, as noted
  2586. in the following table:</p>
  2587. <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> value</entry><entry class="- topic/entry ">Actual frequency</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>
  2588. </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 ">
  2589. The amount of sound required to activate the microphone and dispatch
  2590. the activity event.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  2591. </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 ">
  2592. The amount of sound required to activate the microphone and dispatch
  2593. the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event. The default value is 10.
  2594. </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 ">
  2595. The number of milliseconds between the time the microphone stops
  2596. detecting sound and the time the activity event is dispatched.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  2597. </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 ">
  2598. The number of milliseconds between the time the microphone stops
  2599. detecting sound and the time the <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event is dispatched. The default
  2600. value is 2000 (2 seconds).
  2601. <p class="- topic/p ">To set this value, use the <codeph class="+ topic/ph pr-d/codeph ">Microphone.setSilenceLevel()</codeph> method.</p>
  2602. </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 ">
  2603. Controls the sound of this microphone object when it is in loopback 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="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><internal>Document this better with examples.
  2604. </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 ">
  2605. Controls the sound of this microphone object when it is in loopback mode.
  2606. </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 ">
  2607. Set to true if echo suppression is enabled; false otherwise.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><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
  2608. </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 ">
  2609. Set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> if echo suppression is enabled; <codeph class="+ topic/ph pr-d/codeph ">false</codeph> otherwise. The default value is
  2610. <codeph class="+ topic/ph pr-d/codeph ">false</codeph> unless the user has selected Reduce Echo in the Flash Player Microphone Settings panel.
  2611. </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 ">
  2612. The StageVideo object uses the device's hardware acceleration capabilities, if available, to display
  2613. live or recorded video in an application.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  2614. The StageVideo object uses the device's hardware acceleration capabilities, if available, to display
  2615. live or recorded video in an application. Hardware acceleration capabilities are available on most devices.
  2616. The StageVideo object supports the same video formats as the Video object.
  2617. See the flash.net.NetStream class for more information about these formats.
  2618. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> In AIR 2.5, this feature is supported
  2619. only on devices that run AIR for TV. See
  2620. <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
  2621. AIR Profile Support</xref> for more information regarding API support across multiple profiles.
  2622. </p>
  2623. <p class="- topic/p ">The video displayed by the StageVideo object always appears in a rectangular area on the stage
  2624. behind all Flash display list objects. Therefore, the StageVideo object takes advantage of hardware acceleration
  2625. while supporting the most common case for displaying video: a rectangular display area overlaid with
  2626. video controls.</p>
  2627. <p class="- topic/p ">The benefits to using a StageVideo object instead of the Video object are:</p>
  2628. <p class="- topic/p "><ul class="- topic/ul "><li class="- topic/li ">Optimal video playback performance because of using hardware acceleration.</li><li class="- topic/li ">Decreased processor and power usage.</li><li class="- topic/li ">Flexibility and creativity for development of content, such as video controls,
  2629. that appears in front of the StageVideo object.</li></ul></p>
  2630. <p class="- topic/p ">Because the StageVideo object uses device hardware capabilities, a StageVideo object is subject to the following constraints
  2631. compared to a Video object:</p>
  2632. <p class="- topic/p "><ul class="- topic/ul "><li class="- topic/li ">The video display area can only be a rectangle. You cannot use more advanced display areas, such as
  2633. elliptical or irregular shapes.</li><li class="- topic/li ">You cannot rotate a StageVideo object.</li><li class="- topic/li ">You cannot bitmap cache a StageVideo object,</li><li class="- topic/li ">You cannot use BitmapData to access the video data.</li><li class="- topic/li ">You cannot embed the video in the SWF file. You can use a StageVideo object only with the NetStream object.</li><li class="- topic/li ">You cannot apply filters, blend modes, or alpha values to a StageVideo object.</li><li class="- topic/li ">You cannot apply color transforms, 3D transforms, or matrix transforms to a StageVideo object.</li><li class="- topic/li ">You cannot apply a mask or scale9Grid to a StageVideo object.</li><li class="- topic/li ">Blend modes that you apply to display objects that are in front of a StageVideo object do not apply to the StageVideo object.</li><li class="- topic/li ">You can place a StageVideo object only on full pixel boundaries.</li><li class="- topic/li ">For each SWF file, Flash Player limits the number of StageVideo objects that can concurrently display
  2634. videos to four. However, the actual limit can be lower, depending on device hardware resources.
  2635. On AIR for TV devices, only one StageVideo object at a time can display a video.</li><li class="- topic/li ">The video timing is not synchronized with the timing of Flash content that the runtime displays.</li><li class="- topic/li ">Though the video presentation is the best available for the given device hardware, it is not 100% "pixel identical" across devices.
  2636. Slight variations can occur due to driver and hardware differences.</li><li class="- topic/li ">A few devices do not support all required color spaces. For example, some devices do not support BT.709, the H.264 standard. In such
  2637. cases you can use BT.601 for fast display.</li><li class="- topic/li ">You cannot use stage video with WMODE settings such as <codeph class="+ topic/ph pr-d/codeph ">normal</codeph>, <codeph class="+ topic/ph pr-d/codeph ">opaque</codeph>, or <codeph class="+ topic/ph pr-d/codeph ">transparent</codeph>.
  2638. Stage video supports only <codeph class="+ topic/ph pr-d/codeph ">WMODE=direct</codeph> when not in full screen mode. WMODE has no effect in Safari 4 or higher, IE 9 or higher,
  2639. or in AIR for TV.</li></ul></p>
  2640. <p class="- topic/p ">The following steps summarize how to use a StageVideo object to play a video:</p>
  2641. <p class="- topic/p "><ol class="- topic/ol "><li class="- topic/li ">Listen for the StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY event to find out when the
  2642. Stage.stageVideos vector has changed. (Not supported for AIR 2.5 for TV.) </li><li class="- topic/li ">If the StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY event reports that stage video is available,
  2643. use the <codeph class="+ topic/ph pr-d/codeph ">Stage.stageVideos</codeph> Vector object within the event handler to access a StageVideo object.
  2644. In AIR 2.5 for TV, access <codeph class="+ topic/ph pr-d/codeph ">Stage.stageVideos</codeph> after the first SWF frame has rendered.
  2645. <b class="+ topic/ph hi-d/b ">Note:</b> You cannot create a StageVideo object.</li><li class="- topic/li ">Attach a NetStream object using <codeph class="+ topic/ph pr-d/codeph ">StageVideo.attachNetStream()</codeph>.</li><li class="- topic/li ">Play the video using <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph>.</li><li class="- topic/li ">Listen for the <codeph class="+ topic/ph pr-d/codeph ">StageVideoEvent.RENDER_STATE</codeph> event on the StageVideo object to determine the status of playing the video.
  2646. Receipt of this event also indicates that the width and height properties of the video have been initialized or changed. </li><li class="- topic/li ">Listen for the <codeph class="+ topic/ph pr-d/codeph ">VideoEvent.RENDER_STATE</codeph> event on the Video object. This event provides the same statuses as
  2647. StageVideoEvent.RENDER_STATE, so you can also use it to determine whether GPU acceleration is available. Receipt of this event
  2648. also indicates that the width and height properties of the video have been initialized or changed. (Not supported for AIR 2.5 for TV.)</li></ol></p>
  2649. <p class="- topic/p ">If a <codeph class="+ topic/ph pr-d/codeph ">StageVideoEvent.RENDER_STATE</codeph> event indicates that the video cannot be played,
  2650. you can revert to using a Video object instead of a StageVideo object. This event is
  2651. dispatched after the video has been attached to a NetStream object and is playing. Also, depending on the platform,
  2652. any change in the playing status can result in dispatching the event.
  2653. Handle the <codeph class="+ topic/ph pr-d/codeph ">StageVideoEvent.RENDER_STATE</codeph> event to ensure that the application plays the video
  2654. or gracefully does not play the video.
  2655. </p>
  2656. <p class="- topic/p ">If a running video goes into full screen mode from a WMODE that does not support stage video, stage video can become available.
  2657. Likewise, if the user exits full screen mode, stage video can become unavailable. In these cases, the Stage.stageVideos vector changes.
  2658. To receive notification of this change, listen to the StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABITY event. <b class="+ topic/ph hi-d/b ">NOTE:</b> This notification
  2659. is not available in AIR 2.5 for TV.</p>
  2660. </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 ">Using the StageVideo class for hardware-accelerated rendering</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 ">
  2661. Dispatched by the StageVideo object when the render state of the StageVideo object changes.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">
  2662. Dispatched by the StageVideo object when the render state of the StageVideo object changes.
  2663. </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 ">
  2664. Specifies a video stream to be displayed within the boundaries of the StageVideo object in the application.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-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 ">A NetStream object. To drop the connection to the StageVideo object, pass
  2665. <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.
  2666. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  2667. Specifies a video stream to be displayed within the boundaries of the StageVideo object in the application.
  2668. The video stream is either a video file played with NetStream.play(), or <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.
  2669. A video file can be stored on the local file
  2670. system or on Flash Media Server. If the value of the <codeph class="+ topic/ph pr-d/codeph ">netStream</codeph> argument is <codeph class="+ topic/ph pr-d/codeph ">null</codeph>,
  2671. the video is no longer played in the StageVideo object.
  2672. <p class="- topic/p ">Before calling <codeph class="+ topic/ph pr-d/codeph ">attachNetStream()</codeph> a second time,
  2673. call the currently attached NetStream object's <codeph class="+ topic/ph pr-d/codeph ">close()</codeph> method.
  2674. Calling <codeph class="+ topic/ph pr-d/codeph ">close()</codeph>
  2675. releases all the resources, including hardware decoders, involved with playing the video.
  2676. Then you can call <codeph class="+ topic/ph pr-d/codeph ">attachNetStream()</codeph>
  2677. with either another NetStream object or <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.</p>
  2678. <p class="- topic/p ">
  2679. You do not need to use this method if a video file contains only audio; the audio
  2680. portion of a video file is played automatically
  2681. when you call <codeph class="+ topic/ph pr-d/codeph ">NetStream.play()</codeph>. To control the audio
  2682. associated with a video file, use the <codeph class="+ topic/ph pr-d/codeph ">soundTransform</codeph> property
  2683. of the NetStream object that plays the video file.
  2684. </p>
  2685. </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</ap