13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 26: Working with cameras<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

A camera attached to a user’s computer can serve as a source of video data that you can display and manipulate using<br />

ActionScript. The Camera class is the mechanism built into ActionScript for working with a computer or device<br />

camera.<br />

On mobile devices, you can also use the CameraUI class. The CameraUI class launches a separate camera application<br />

to allow the user to capture a still image or video. Wh<strong>en</strong> the user is finished, your application can access the image or<br />

video through a MediaPromise object.<br />

More Help topics<br />

Christian Cantrell: How to use CameraUI in a Cross-platform Way<br />

Michaël CHAIZE: Android, AIR and the Camera<br />

Understanding the Camera class<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

The Camera object allows you to connect to the user’s local camera and broadcast the video either locally (back to the<br />

user) or remotely to a server (such as Flash Media Server).<br />

Using the Camera class, you can access the following kinds of information about the user’s camera:<br />

Which cameras installed on the user’s computer or device are available<br />

Whether a camera is installed<br />

Whether Flash Player is allowed or d<strong>en</strong>ied access to the user’s camera<br />

Which camera is curr<strong>en</strong>tly active<br />

The width and height of the video being captured<br />

The Camera class includes several useful methods and properties for working with camera objects. For example, the<br />

static Camera.names property contains an array of camera names curr<strong>en</strong>tly installed on the user’s computer. You can<br />

also use the name property to display the name of the curr<strong>en</strong>tly active camera.<br />

Note: Wh<strong>en</strong> streaming camera video across the network, you should always handle network interruptions. Network<br />

interruptions can occur for many reasons, particularly on mobile devices.<br />

Last updated 6/6/2012<br />

520

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!