Playing Back External Flv Files Dynamically - MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Playing back external FLV files dynamically

As an alternative to importing video into the Flash authoring environment, you can use
ActionScript to dynamically play back external FLV files in Flash Player. You can play back FLV
files from an HTTP address or from the local file system. To play back FLV files, you use the
NetConnection and NetStream classes and the
complete information, see the
entries in
Chapter 12, "ActionScript Dictionary," on page
You can create FLV files by importing video into the Flash authoring tool and exporting it as an
FLV file. (See "Macromedia Flash Video" in Using Flash Help.) If you have Flash Professional,
you can use the FLV Export plug-in to export FLV files from supported video-editing
applications. (See "Exporting FLV files from video-editing applications (Flash Professional only)"
in Using Flash Help.)
Using external FLV files provides certain capabilities that are not available when you use
imported video:
You can use longer video clips in your Flash documents without slowing down playback.
External FLV files are played using cached memory. This means that large files are stored in
small pieces and accessed dynamically, and do not require as much memory as embedded
video files.
An external FLV file can have a different frame rate than the Flash document in which it plays.
For example, you can set the Flash document frame rate to 30 fps and the video frame rate to
21 fps. This gives you greater control in ensuring smooth video playback.
With external FLV files, Flash document playback does not have to be interrupted while the
video file is loading. Imported video files may sometimes interrupt document playback to
perform certain functions; for example, accessing a CD-ROM drive. FLV files can perform
functions independently of the Flash document, and thus do not interrupt playback.
Captioning of video content is easier with external FLV files, because you can use event
handlers to access metadata for the video.
The following procedure shows how you would play back a file named videoFile.flv that is stored
in the same location as your SWF file.
attachVideo()
NetConnection
class,
Playing back external FLV files dynamically
method of the Video class. (For
NetStream
class, and
Video.attachVideo()
205.)
197

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents