/frameworks/projects/playerglobal/bundles/en_US/docs/flash.media.xml
XML | 3292 lines | 2671 code | 603 blank | 18 comment | 0 complexity | 398e875f47a89b5b98f6be69ec66f0de MD5 | raw file
Possible License(s): Apache-2.0
Large files files are truncated, but you can click here to view the full file
- <?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 ">
- <!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
- 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 ">
- The ID3Info class contains properties that reflect ID3 metadata. You can get additional
- metadata for MP3 files by accessing the <codeph class="+ topic/ph pr-d/codeph ">id3</codeph>
- property of the Sound class; for example, <codeph class="+ topic/ph pr-d/codeph ">mySound.id3.TIME</codeph>.
- For more information, see the entry for <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> and
- the ID3 tag definitions at <xref href="http://www.id3.org" class="- topic/xref ">http://www.id3.org</xref>.
- </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 ">
- 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 ">
- The name of the album; corresponds to the ID3 2.0 tag TALB.
- </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:artist" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">artist</apiName><shortdesc class="- topic/shortdesc ">
- 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 ">
- The name of the artist; corresponds to the ID3 2.0 tag TPE1.
- </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:comment" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">comment</apiName><shortdesc class="- topic/shortdesc ">
- 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 ">
- A comment about the recording; corresponds to the ID3 2.0 tag COMM.
- </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:genre" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">genre</apiName><shortdesc class="- topic/shortdesc ">
- 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 ">
- The genre of the song; corresponds to the ID3 2.0 tag TCON.
- </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:songName" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">songName</apiName><shortdesc class="- topic/shortdesc ">
- 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 ">
- The name of the song; corresponds to the ID3 2.0 tag TIT2.
- </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:track" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">track</apiName><shortdesc class="- topic/shortdesc ">
- 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 ">
- The track number; corresponds to the ID3 2.0 tag TRCK.
- </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:year" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">year</apiName><shortdesc class="- topic/shortdesc ">
- 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 ">
- The year of the recording; corresponds to the ID3 2.0 tag TYER.
- </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:MediaType" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">MediaType</apiName><shortdesc class="- topic/shortdesc ">
- 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 ">
- The MediaType class enumerates the general types of media that can be returned by a camera.
-
- <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
- of the CameraUI class. MediaType values are also used in the <codeph class="+ topic/ph pr-d/codeph ">mediaType</codeph> property
- of the MediaPromise class.</p>
-
- </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#CameraUI/launch()" class="- topic/link "><linktext class="- topic/linktext ">CameraUI.launch()</linktext></link><link href="" invalidHref="flash.media.MediaPromise.mediaType.xml" class="- topic/link "><linktext class="- topic/linktext ">MediaPromise.mediaType</linktext></link></related-links><apiValue id="flash.media:MediaType:IMAGE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">IMAGE</apiName><shortdesc class="- topic/shortdesc ">
- 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 ">
- A single image.
-
- </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 ">
- 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 ">
- A video.
-
- </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 ">
- 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 ">
- Forces a rescan of the microphones and cameras on the system.
-
- </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 ">
- 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
- </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 ">
- Use the Camera class to capture video from the client system's camera.
- Use the Video class to monitor the video locally.
- Use the NetConnection and NetStream classes to transmit the video to Flash Media Server.
- Flash Media Server can send the video stream to other servers and broadcast it to other clients running Flash Player.
-
- <p class="- topic/p ">A Camera instance captures video in landscape aspect ratio. On devices that can change the screen orientation,
- such as mobile phones, a Video object attached to the camera will only show upright video in a landscape-aspect orientation.
- Thus, mobile apps should use a landscape orientation when displaying video and should not auto-rotate.</p>
-
- <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,
- and many mobile device cameras do not, then the camera is focused when the Camera object is attached to a video stream and whenever
- 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>
-
- <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.
- In addition, streaming connections can be lost when the application is in the background. On iOS, the camera video cannot be
- displayed when an application uses the GPU rendering mode. The camera video can still be streamed to a server.</p>
-
- <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Mobile Browser Support:</b> This class is not supported in mobile browsers.</p>
-
- <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> This feature is supported
- on desktop operating systems, but it is not supported on all mobile devices. It is not
- supported on AIR for TV devices. See
- <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
- AIR Profile Support</xref> for more information regarding API support across multiple profiles.</p>
-
- <p class="- topic/p ">You can test
- for support at run time using the <codeph class="+ topic/ph pr-d/codeph ">Camera.isSupported</codeph> property.
- 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
- <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> always returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.</p>
-
- <p class="- topic/p ">
- For information about capturing audio, see the Microphone class.
- </p>
-
- <p class="- topic/p ">
- <b class="+ topic/ph hi-d/b ">Important: </b>Flash Player displays a Privacy dialog box that lets the user choose whether
- to allow or deny access to the camera. Make sure your application window size is at least 215 x 138 pixels;
- this is the minimum size required to display the dialog box.
- </p>
-
- <p class="- topic/p ">To create or reference a Camera object, use the <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> method.</p>
-
- </apiDesc><example conref="examples\CameraExample.as" class="- topic/example "> The following example shows the image from a camera after acknowledging the
- security warning. The Stage is set such that it cannot be scaled and is aligned to the
- top-left of the player window. The <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event is dispatched at the
- start and end (if any) of the session and is captured by the <codeph class="+ topic/ph pr-d/codeph ">activityHandler()</codeph>
- method, which prints out information about the event.
-
- <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> A camera must be attached to your computer for this example
- to work correctly.</p>
- <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
- package {
- import flash.display.Sprite;
- import flash.display.StageAlign;
- import flash.display.StageScaleMode;
- import flash.events.*;
- import flash.media.Camera;
- import flash.media.Video;
- public class CameraExample extends Sprite {
- private var video:Video;
-
- public function CameraExample() {
- stage.scaleMode = StageScaleMode.NO_SCALE;
- stage.align = StageAlign.TOP_LEFT;
-
- var camera:Camera = Camera.getCamera();
-
- if (camera != null) {
- camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
- video = new Video(camera.width * 2, camera.height * 2);
- video.attachCamera(camera);
- addChild(video);
- } else {
- trace("You need a camera.");
- }
- }
-
- private function activityHandler(event:ActivityEvent):void {
- trace("activityHandler: " + event);
- }
- }
- }
- </codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone</linktext></link><link href="http://coenraets.org/blog/2010/07/video-chat-for-android-in-30-lines-of-code/" class="- topic/link "><linktext class="- topic/linktext ">Cristophe Coenraets: 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 ">
- 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 ">
- Dispatched when a camera reports its status.
- Before accessing a camera, Flash Player displays a Privacy dialog box to let users
- 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>,
- the user has refused to allow the SWF file access to the user's 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.Unmuted"</codeph>,
- the user has allowed the SWF file access to the user's camera.
- </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 ">
- 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 ">
- Dispatched when a camera begins or ends a session.
- Call <codeph class="+ topic/ph pr-d/codeph ">Camera.setMotionLevel()</codeph> to specify the amount of motion
- 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>
- value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph>, or the time without activity
- 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>
- value of <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
-
-
-
- </apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.media:Camera:getCamera" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">getCamera</apiName><shortdesc class="- topic/shortdesc ">
- 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
- </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
- to the default camera or, if it is in use by another application, to the first
- available camera. (If there is more than one camera installed, the user may specify
- the default camera in the Flash Player Camera Settings panel.) If no cameras are available
- or installed, the method returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.
-
- </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:Camera</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">name</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Specifies which camera to get, as determined from the array
- returned by the <codeph class="+ topic/ph pr-d/codeph ">names</codeph> property. For most applications, get the default camera
- by omitting this parameter. To specify a value for this parameter, use the string representation
- of the zero-based index position within the Camera.names array. For example, to specify the third
- camera in the array, use <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera("2")</codeph>.
-
- </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
- Returns a reference to a Camera object for capturing video. To begin capturing
- the video, you must attach the Camera object to a Video object (see <codeph class="+ topic/ph pr-d/codeph ">Video.attachCamera()
- </codeph>). To transmit video to Flash Media Server, call <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachCamera()</codeph>
- to attach the Camera object to a NetStream object.
-
- <p class="- topic/p ">Multiple calls to the <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> method reference the same camera driver.
- Thus, if your code contains code like <codeph class="+ topic/ph pr-d/codeph ">firstCam:Camera = getCamera()</codeph>
- and <codeph class="+ topic/ph pr-d/codeph ">secondCam:Camera = getCamera()</codeph>,
- both <codeph class="+ topic/ph pr-d/codeph ">firstCam</codeph> and <codeph class="+ topic/ph pr-d/codeph ">secondCam</codeph> reference the same camera,
- which is the user's default camera.</p>
-
- <p class="- topic/p ">On iOS devices with a both a front- and a rear-facing camera, you can only capture
- video from one camera at a time. On Android devices, you can only access the rear-facing camera.</p>
-
- <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
- <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> to return a reference to the default camera. By means of the Camera
- settings panel (discussed later in this section), the user can specify the default camera
- to use. </p>
-
- <p class="- topic/p ">You can't use ActionScript to set a user's Allow or Deny permission setting
- for access to the camera, but you can display the Adobe Flash Player Settings camera
- setting dialog box where the user can set the camera permission. When a SWF file using
- the <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> method tries to
- attach the camera returned by the <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> method to a Video or
- NetStream object, Flash Player displays a dialog box that lets the user choose
- to allow or deny access to the camera. (Make sure your application window size is at least
- 215 x 138 pixels; this is the minimum size Flash Player requires to display the dialog box.)
- When the user responds to the camera setting dialog box, Flash Player returns an
- information object in the <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event that indicates the user's response:
- <codeph class="+ topic/ph pr-d/codeph ">Camera.muted</codeph> indicates
- the user denied access to a camera; <codeph class="+ topic/ph pr-d/codeph ">Camera.Unmuted</codeph> indicates the user allowed access
- to a camera. To determine whether the user has denied or allowed access to the camera without
- 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>
-
- <p class="- topic/p ">In Flash Player, the user can specify permanent privacy settings for a particular domain by right-clicking
- (Windows and Linux) or Control-clicking (Macintosh) while a SWF file is playing, selecting Settings,
- opening the Privacy dialog, and selecting Remember. If the user selects Remember, Flash Player no longer
- asks the user whether to allow or deny SWF files from this domain access to your camera.</p>
-
- <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
- to Allow or Deny access to the camera if the user has denied access by selecting Remember
- in the Flash Player Settings dialog box. In this case, you can prompt the user to change the
- Allow or Deny setting by displaying the Flash Player Privacy panel for the user
- using <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings(SecurityPanel.PRIVACY)</codeph>.</p>
-
- <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
- application, or there are no cameras installed on the system. To determine whether any cameras
- are installed, use the <codeph class="+ topic/ph pr-d/codeph ">names.length</codeph> property. To display the Flash Player Camera Settings panel,
- which lets the user choose the camera to be referenced by <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph>, use
- <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings(SecurityPanel.CAMERA)</codeph>. </p>
-
- <p class="- topic/p ">Scanning the hardware for cameras takes time. When the runtime finds at least one camera,
- the hardware is not scanned again for the lifetime of the player instance. However, if
- the runtime doesn't find any cameras, it will scan each time <codeph class="+ topic/ph pr-d/codeph ">getCamera</codeph> is called.
- This is helpful if the camera is present but is disabled; if your SWF file provides a
- Try Again button that calls <codeph class="+ topic/ph pr-d/codeph ">getCamera</codeph>, Flash Player can find the camera without the
- user having to restart the SWF file.</p>
-
- </apiDesc><example conref="examples\Camera_getCameraExample.as" class="- topic/example "> In the following example, after the user allows access to the camera, the attached
- camera is used to capture video images. Information about the video stream, such as
- the current frames per second, is also displayed.
-
- <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
- no camera is available or installed. The if statement checks whether the camera was found and whether
- the user allowed access to the camera. If the user denied access, the <codeph class="+ topic/ph pr-d/codeph ">muted</codeph>
- property is set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>.</p>
-
- <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
- user to allow or deny Flash Player access to the camera. However, if the user denied access
- and selected the <codeph class="+ topic/ph pr-d/codeph ">Remember</codeph> option, the dialog box does not appear and nothing displays.
- 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
- instructs the user to click the text field to invoke the Flash Player Settings dialog box.</p>
-
- <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
- displays the <codeph class="+ topic/ph pr-d/codeph ">PRIVACY</codeph> panel of the Settings dialog box. If the user allows access,
- 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>
- 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
- set to <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.)</p>
-
- <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,
- 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>
- method instantiates a video object with the captured stream's width and height. To display the
- camera's captured video, the reference to the video stream is attached to the video object, and the video
- object is added to the display list.</p>
-
- <p class="- topic/p ">A Timer object also is started. Every second, a Timer object's timer event is dispatched and the
- <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
- a number of properties of the Camera object. </p>
- <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> For this example, the only property that changes
- is the <codeph class="+ topic/ph pr-d/codeph ">currentFPS</codeph> property.</p>
-
- <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
- package {
- import flash.display.Sprite;
- import flash.media.Camera;
- import flash.media.Video;
- import flash.text.TextField;
- import flash.text.TextFieldAutoSize;
- import flash.utils.Timer;
- import flash.events.TimerEvent;
- import flash.events.StatusEvent;
- import flash.events.MouseEvent;
- import flash.system.SecurityPanel;
- import flash.system.Security;
- public class Camera_getCameraExample extends Sprite {
- private var myTextField:TextField;
- private var cam:Camera;
- private var t:Timer = new Timer(1000);
-
- public function Camera_getCameraExample() {
- myTextField = new TextField();
- myTextField.x = 10;
- myTextField.y = 10;
- myTextField.background = true;
- myTextField.selectable = false;
- myTextField.autoSize = TextFieldAutoSize.LEFT;
-
- if (Camera.isSupported)
- {
- cam = Camera.getCamera();
-
- if (!cam) {
- myTextField.text = "No camera is installed.";
-
- } else if (cam.muted) {
- myTextField.text = "To enable the use of the camera,\n"
- + "please click on this text field.\n"
- + "When the Flash Player Settings dialog appears,\n"
- + "make sure to select the Allow radio button\n"
- + "to grant access to your camera.";
-
- myTextField.addEventListener(MouseEvent.CLICK, clickHandler);
-
- }else {
- myTextField.text = "Connecting";
- connectCamera();
- }
-
- addChild(myTextField);
-
- t.addEventListener(TimerEvent.TIMER, timerHandler);
- }else {
- myTextField.text = "The Camera class is not supported on this device.";
- }
- }
- private function clickHandler(e:MouseEvent):void {
- Security.showSettings(SecurityPanel.PRIVACY);
- cam.addEventListener(StatusEvent.STATUS, statusHandler);
- myTextField.removeEventListener(MouseEvent.CLICK, clickHandler);
- }
- private function statusHandler(event:StatusEvent):void {
- if (event.code == "Camera.Unmuted") {
- connectCamera();
- cam.removeEventListener(StatusEvent.STATUS, statusHandler);
- }
- }
- private function connectCamera():void {
- var vid:Video = new Video(cam.width, cam.height);
- vid.x = 10;
- vid.y = 10;
- vid.attachCamera(cam);
- addChild(vid);
- t.start();
- }
- private function timerHandler(event:TimerEvent):void {
- myTextField.y = cam.height + 20;
- myTex…
Large files files are truncated, but you can click here to view the full file