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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Working with video<br />

External vs embedded video<br />

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

Using external video files provides certain capabilities that are not available wh<strong>en</strong> you use imported video:<br />

Longer video clips can be used in your application without slowing down playback. External video files use cached<br />

memory, which means that large files are stored in small pieces and accessed dynamically. For this reason, external<br />

F4V and FLV files require less memory than embedded video files.<br />

An external video file can have a differ<strong>en</strong>t frame rate than the SWF file in which it plays. For example, you can set<br />

the SWF file frame rate to 30 frames per second (fps) and the video frame rate to 21 fps. This setting gives you better<br />

control of the video than embedded video, to <strong>en</strong>sure smooth video playback. It also allows you to play video files at<br />

differ<strong>en</strong>t frame rates without the need to alter existing SWF file cont<strong>en</strong>t.<br />

With external video files, playback of the SWF cont<strong>en</strong>t is not interrupted while the video file is loading. Imported<br />

video files can sometimes interrupt docum<strong>en</strong>t playback to perform certain functions, such as accessing a CD-ROM<br />

drive. Video files can perform functions indep<strong>en</strong>d<strong>en</strong>tly of the SWF cont<strong>en</strong>t, without interrupting playback.<br />

Captioning video cont<strong>en</strong>t is easier with external FLV files because you can access the video metadata using ev<strong>en</strong>t<br />

handlers.<br />

Understanding the Video class<br />

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

The Video class <strong>en</strong>ables you to display live streaming video in an application without embedding it in your SWF file.<br />

You can capture and play live video using the Camera.getCamera() method. You can also use the Video class to play<br />

back video files over HTTP or from the local file system. There are several differ<strong>en</strong>t ways to use Video in your projects:<br />

Load a video file dynamically using the NetConnection and NetStream classes and display the video in a Video<br />

object.<br />

Capture input from the user’s camera. For more information, see “Working with cameras” on page 520.<br />

Use the FLVPlayback compon<strong>en</strong>t.<br />

Use the VideoDisplay control.<br />

Note: Instances of a Video object on the Stage are instances of the Video class.<br />

Ev<strong>en</strong> though the Video class is in the flash.media package, it inherits from the flash.display.DisplayObject class.<br />

Therefore, all display object functionality, such as matrix transformations and filters, also applies to Video instances.<br />

For more information see “Manipulating display objects” on page 173, “Working with geometry” on page 209, and<br />

“Filtering display objects” on page 267.<br />

Last updated 6/6/2012<br />

478

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

Saved successfully!

Ooh no, something went wrong!