MACROMEDIA CAPTIVATE 2 Reference

Category
Software
Type
Reference
Client-Side ActionScript Language
Reference for Flash Media Server 2
Trademarks
1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central,
ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite,
FlashPaper, Flash Video Encoder, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder,
Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit,
Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in
the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases
mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and
may be registered in certain jurisdictions including internationally.
Third-Party Information
This guide contains links to third-party websites that are not under the control of Macromedia, and Macromedia is not
responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your
own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia
endorses or accepts any responsibility for the content on those third-party sites.
Sorensonâ„¢ Sparkâ„¢ video compression and decompression technology licensed from
Sorenson Media, Inc.
Copyright © 2002-2005 Macromedia, Inc. All rights reserved. This manual may not be copied, photocopied, reproduced,
translated, or converted to any electronic or machine-readable form in whole or in part without written approval from
Macromedia, Inc. Notwithstanding the foregoing, the owner or authorized user of a valid copy of the software with which
this manual was provided may print out one copy of this manual from an electronic version of this manual for the sole
purpose of such owner or authorized user learning to use such software, provided that no part of this manual may be
printed out, reproduced, distributed, resold, or transmitted for any other purposes, including, without limitation,
commercial purposes, such as selling copies of this documentation or providing paid-for support services.
Acknowledgments
Project Management: Suzanne Smith
Writing: Jody Bleyle
Managing Editor: Rosana Francescato
Editing: Geta Carlson
Production Management: Patrice O’Neill
Media Design and Production: Adam Barnett, Aaron Begley, Mario Reynoso, Paul Benkman, John Franics
Special thanks to Erick Vera and the Flash Media Server engineering and QA teams.
First Edition: October 2005
Macromedia, Inc.
601 Townsend St.
San Francisco, CA 94103
3
Contents
Chapter 1: Client-Side ActionScript Language Reference. . . . . . . 5
ActionScript classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
ActionScript elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Camera class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Microphone class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
MovieClip class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
NetConnection class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
NetStream class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
SharedObject class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
System class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Video class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139
Appendix A: Client-Side Information Objects . . . . . . . . . . . . . . .149
Camera information objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
LocalConnection information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Microphone information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
NetConnection information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152
NetStream information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153
SharedObject information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156
4Contents
5
1
CHAPTER 1
Client-Side ActionScript
Language Reference
Macromedia Flash Media Server provides two application program interfaces (APIs): a Client-
Side Media ActionScript API and a Server-Side Media ActionScript API. This guide explains
the client-side API.
This document is designed to be used in combination with the ActionScript documentation
included with Macromedia Flash. Refer to the Flash documentation for general scripting
information. Use this document to add Flash Media Server functionality to your Flash
applications.
For additional information about developing applications for Flash Media Server and to
understand how objects created on the client-side are paired with those on the server-Rside,
see Developing Media Applications.
ActionScript classes
The following table lists all the classes in this guide, Client-Side ActionScript Language
Reference for Flash Media Server 2:
NOTE
Most sample code in this document uses ActionScript 2.0 syntax.
ActionScript class Description
Camera class Lets you capture video from a video camera attached to the
computer that is running Macromedia Flash Player.
Microphone class Lets you capture audio from a microphone attached to the
computer that is running Flash Player.
MovieClip class Lets you specify whether an audio source is to be played locally
(Microphone object) or streamed from Flash Media Server
(NetStream object).
6 Client-Side ActionScript Language Reference
ActionScript elements
Entries in this document are alphabetical by class name and then by method, property, or
event handler name. The following table lists all classes, methods, properties, and event
handlers individually in alphabetical order.
NetConnection class Manages a bidirectional connection between Flash Player and a
server, which lets you connect to Flash Remoting or to Flash
Media Server.
NetStream class Opens a one-way streaming connection between Flash Player
and Flash Media Server through a connection made available by
a NetConnection object.
SharedObject class Allows real-time data sharing between multiple client SWF files
and objects that are persistent on the local or remote location.
System class The System class contains properties related to certain
operations that take place on the user's computer, such as
operations with shared objects, local settings for cameras and
microphones, and use of the Clipboard.
Video class Lets you display live or recorded streaming video on the Stage
without embedding it in your SWF file.
ActionScript element See entry
activityLevel
Camera.activityLevel
, Microphone.activityLevel
attachAudio
MovieClip.attachAudio()
, NetStream.attachAudio()
attachVideo
NetStream.attachVideo()
, Video.attachVideo()
bandwidth
Camera.bandwidth
bufferLength
NetStream.bufferLength
bufferTime
NetStream.bufferTime
call
NetConnection.call()
clear
SharedObject.clear()
, Video.clear()
close
NetConnection.close()
, NetStream.close(),
SharedObject.close()
connect
NetConnection.connect()
, SharedObject.connect()
currentFps
Camera.currentFps
, NetStream.currentFps
data
SharedObject.data
ActionScript class Description
ActionScript elements 7
deblocking
Video.deblocking
flush
SharedObject.flush()
fps
Camera.fps
gain
Microphone.gain
get
Camera.get()
, Microphone.get()
getLocal
SharedObject.getLocal()
getRemote
SharedObject.getRemote()
getSize
SharedObject.getSize()
height
Camera.height
, Video.height
index
Camera.index
, Microphone.index
isConnected
NetConnection.isConnected
keyFrameInterval
Camera.keyFrameInterval
loopback
Camera.loopback
liveDelay
NetStream.liveDelay
motionLevel
Camera.motionLevel
motionTimeOut
Camera.motionTimeOut
muted
Camera.muted
, Microphone.muted
name
Camera.name
, Microphone.name
names
Camera.names
, Microphone.names
onActivity
Camera.onActivity
, Microphone.onActivity
onCuePoint
NetStream.onCuePoint
onMetaData
NetStream.onMetaData
onPlayStatus
NetStream.onPlayStatus
onStatus
Camera.onStatus
, Microphone.onStatus, NetConnection.onStatus,
NetStream.onStatus, SharedObject.onStatus
onSync
SharedObject.onSync
pause
NetStream.pause()
play
NetStream.play()
publish
NetStream.publish()
quality
Camera.quality
ActionScript element See entry
8 Client-Side ActionScript Language Reference
Camera class
Availability
â–  Flash Player 6.
â–  Flash Media Server (not required).
rate
Microphone.rate
receiveAudio
NetStream.receiveAudio()
receiveVideo
NetStream.receiveVideo()
seek
NetStream.seek()
send
NetStream.send()
, SharedObject.send()
setBufferTime
NetStream.setBufferTime()
setFps
SharedObject.setFps()
setGain
Microphone.setGain()
setKeyFrameInterval
Camera.setKeyFrameInterval()
setLoopback
Camera.setLoopback()
setMode
Camera.setMode()
setMotionLevel
Camera.setMotionLevel()
setQuality
Camera.setQuality()
setRate
Microphone.setRate()
setSilenceLevel
Microphone.setSilenceLevel()
setUseEchoSuppression
Microphone.setUseEchoSuppression()
showSettings
System.showSettings()
silenceLevel
Microphone.silenceLevel
silenceTimeout
Microphone.silenceTimeout
smoothing
Video.smoothing
time
NetStream.time
uri
NetConnection.uri
useCodepage
System.useCodepage
useEchoSuppression
Microphone.useEchoSuppression
width
Camera.width
, Video.width
ActionScript element See entry
Camera class 9
The Camera class lets you capture video from a video camera attached to the computer that is
running Macromedia Flash Player. When used with Flash Media Server, this class lets you
transmit, display, and optionally record the video being captured. With these capabilities, you
can develop media applications such as video conferencing, instant messaging with video, and
so on. Flash provides similar audio capabilities; for more information, see the Microphone
class entry.
You can also use a Camera object without a server—for example, to monitor a video feed from
a webcam attached to your local system.
To create or reference a Camera object, use the
Camera.get() method.
Method summary for the Camera class
NOTE
When a SWF file tries to access the camera returned by Camera.get(), Flash Player
displays a Privacy dialog box that lets the user choose whether to allow or deny access
to the camera. (Make sure your Stage size is at least 215 x 138 pixels for the Camera
class examples; this is the minimum size Flash requires to display the dialog box.) End
users and administrative users may also disable camera access on a per-site or global
basis.
Method Description
Camera.get() Returns a reference to a Camera object for capturing
video.
Camera.setKeyFrameInterval() Specifies which video frames are transmitted in full
instead of being interpolated by the video compression
algorithm.
Camera.setLoopback() Specifies whether to use a compressed video stream for a
local view of what the camera is transmitting.
Camera.setMode() Sets aspects of the camera capture mode, including
height, width, and frames per second.
Camera.setMotionLevel() Specifies how much motion is required to invoke
Camera.onActivity(true).
Camera.setQuality() Sets the maximum amount of bandwidth per second or
the required picture quality of the current outgoing video
feed.
10 Client-Side ActionScript Language Reference
Property summary for the Camera class
Property (read-only) Description
Camera.activityLevel A numeric value from 0 to 100 that specifies the amount of
motion the camera is detecting.
Camera.bandwidth The maximum amount of bandwidth the current outgoing
video feed can use, in bytes.
Camera.currentFps The rate at which the camera is capturing data, in frames per
second.
Camera.fps The rate at which you would like the camera to capture data, in
frames per second.
Camera.height The current capture height, in pixels.
Camera.index The index of the camera, as reflected in the array returned by
Camera.names.
Camera.keyFrameInterval A number that specifies which video frames are transmitted in
full instead of being interpolated by the video compression
algorithm.
Camera.loopback A Boolean value that specifies whether a local view of what
the camera is capturing is compressed or uncompressed.
Camera.motionLevel A numeric value from 0 to 100 that specifies the amount of
motion required to invoke
Camera.onActivity(true).
Camera.motionTimeOut The number of milliseconds between the time the camera
stops detecting motion and the time
Camera.onActivity(false) is invoked.
Camera.muted A Boolean value that specifies whether the user has allowed
or denied access to the camera.
Camera.name The name of the camera as specified by the camera hardware.
Camera.names Class property; an array of strings containing the names of all
available video capture devices, including video capture cards
and cameras.
Camera.quality A number that specifies the current level of picture quality
based on the amount of compression being applied to each
video frame.
Camera.width The current capture width, in pixels.
Camera class 11
Event handler summary for the Camera class
Constructor for the Camera class
See Camera.get().
Camera.activityLevel
Availability
â–  Flash Player 6.
â–  Flash Media Server (not required).
Usage
public activityLevel : Number [read-only]
Description
Property (read-only); a numeric value that specifies the amount of motion the camera is
detecting. Values range from 0 (no motion is being detected) to 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 to
Camera.setMotionLevel().
If the camera is available but is not yet being used because neither
Video.attachVideo() nor
NetStream.attachVideo() has been called, this property is set to -1.
If you are streaming only uncompressed local video—that is, you are not streaming the video
within a NetStream object and you have not called
Camera.setLoopback()(true)—this
property is set only if you have assigned a function to the
Camera.onActivity event handler.
Otherwise, it is undefined.
See also
Camera.motionLevel, Camera.onActivity, Camera.setMotionLevel()
Method Description
Camera.onActivity Invoked when the camera starts or stops detecting motion.
Camera.onStatus Invoked when the user allows or denies access to the camera.
12 Client-Side ActionScript Language Reference
Camera.bandwidth
Availability
â–  Flash Player 6.
â–  Flash Media Server (not required).
Usage
public bandwidth : Number [read-only]
Description
Property (read-only); an integer that specifies the maximum amount of bandwidth the current
outgoing video feed can use, in bytes. A value of 0 means that Flash Video can use as much
bandwidth as needed to maintain the desired frame quality.
To set this property, use
Camera.setQuality().
Example
The following example changes the maximum amount of bandwidth used by the camera feed.
Create a new video instance by selecting New Video from the Library options menu. Add an
instance to the Stage and give it the instance name
my_video. Add a NumericStepper
component instance to the Stage and give it the instance name
bandwidth_nstep. Then add
the following ActionScript to Frame 1 of the Timeline:
var bandwidth_nstep:mx.controls.NumericStepper;
var my_video:Video;
var my_cam:Camera = Camera.get();
my_video.attachVideo(my_cam);
this.createTextField("bandwidth_txt", this.getNextHighestDepth(), 0, 0,
100, 22);
bandwidth_txt.autoSize = true;
this.onEnterFrame = function() {
bandwidth_txt.text = "Camera is currently using "+my_cam.bandwidth+"
bytes ("+Math.round(my_cam.bandwidth/1024)+" KB) bandwidth.";
};
//
bandwidth_nstep.minimum = 0;
bandwidth_nstep.maximum = 128;
bandwidth_nstep.stepSize = 16;
bandwidth_nstep.value = my_cam.bandwidth/1024;
function changeBandwidth(evt:Object) {
my_cam.setQuality(evt.target.value/1024, 0);
}
bandwidth_nstep.addEventListener("change", changeBandwidth);
Camera class 13
The MovieClip.getNextHighestDepth() method used in this example requires Flash Player
7 or later. If your SWF file includes a v2 component (version 2 of the Macromedia
Component Architecture), use the DepthManager class from the component framework
instead of the
MovieClip.getNextHighestDepth() method.
See also
Camera.setQuality()
Camera.currentFps
Availability
â–  Flash Player 6.
â–  Flash Media Server (not required).
Usage
public currentFps : Number [read-only]
Description
Property (read-only); the rate at which the camera is capturing data, in frames per second.
This property cannot be set; however, you can use
Camera.setMode() to set a related
property—
Camera.fps—which specifies the maximum frame rate at which you would like
the camera to capture data.
Example
The following example detects the rate in frames per second that the camera captures data,
using the
currentFps property and a ProgressBar instance. Create a new video instance by
selecting New Video from the Library options menu. Add an instance to the Stage and give it
the instance name
my_video. Add a ProgressBar component instance to the Stage and give it
the instance name
fps_pb. Then add the following ActionScript to Frame 1 of the Timeline:
var my_video:Video;
var fps_pb:mx.controls.ProgressBar;
var my_cam:Camera = Camera.get();
my_video.attachVideo(my_cam);
this.onEnterFrame = function() {
fps_pb.setProgress(my_cam.fps-my_cam.currentFps, my_cam.fps);
};
fps_pb.setStyle("fontSize", 10);
fps_pb.setStyle("themeColor", "haloOrange");
fps_pb.labelPlacement = "top";
fps_pb.mode = "manual";
fps_pb.label = "FPS: %2 (%3%% dropped)";
14 Client-Side ActionScript Language Reference
See also
Camera.fps, Camera.setMode()
Camera.fps
Availability
â–  Flash Player 6.
â–  Flash Media Server (not required).
Usage
public fps : Number [read-only]
Description
Property (read-only); the maximum rate at which you want the camera to capture data, in
frames per second. The maximum rate possible depends on the capabilities of the camera; that
is, if the camera doesn’t support the value you set here, this frame rate will not be achieved.
â–  To set a desired value for this property, use Camera.setMode().
â–  To determine the rate at which the camera is currently capturing data, use
Camera.currentFps.
Example
The following example detects the rate in frames per second that the camera captures data,
using the
currentFps property and a ProgressBar instance. Create a new video instance by
selecting New Video from the Library options menu. Add an instance to the Stage and give it
the instance name
my_video. Add a ProgressBar component instance to the Stage and give it
the instance name
fps_pb. Then add the following ActionScript to Frame 1 of the Timeline:
var my_video:Video;
var fps_pb:mx.controls.ProgressBar;
var my_cam:Camera = Camera.get();
my_video.attachVideo(my_cam);
this.onEnterFrame = function() {
fps_pb.setProgress(my_cam.fps-my_cam.currentFps, my_cam.fps);
};
fps_pb.setStyle("fontSize", 10);
fps_pb.setStyle("themeColor", "haloOrange");
fps_pb.labelPlacement = "top";
fps_pb.mode = "manual";
fps_pb.label = "FPS: %2 (%3%% dropped)";
NOTE
The setMode() method does not guarantee the requested fps setting; it sets the fps you
requested or the fastest fps available.
Camera class 15
See also
Camera.currentFps, Camera.setMode()
Camera.get()
Availability
â–  Flash Player 6.
â–  Flash Media Server (not required).
Usage
public static get([index:Number]) : Camera
Parameters
index An optional zero-based integer that specifies which camera driver to get, as
determined from the array returned by
Camera.names. To get the default camera driver
(which is recommended for most applications), omit this parameter.
Returns
â–  If index is not specified, this method returns a reference to the default camera driver or, if
it is in use by another application, to the first available camera driver. (If there is more
than one camera driver installed, the user may specify the default camera driver in the
Flash Player Camera Settings panel.) If no camera drivers are available or installed, the
method returns
null.
â–  If index is specified, this method returns a reference to the requested camera driver, or
null if it is not available.
Description
Method; returns a reference to a Camera object for capturing video. To actually begin
capturing the video, you must attach the Camera object either to a Video object (see
Video.attachVideo()) or to a NetStream object (see NetStream.attachVideo()). (The
NetStream object is available only with Flash Media Server.)
NOTE
To assign the Camera object to a variable, use the following syntax:
var active_cam:Camera = Camera.get().
NOTE
The Camera.get() method returns a reference to a camera driver, not to a physical
camera.
16 Client-Side ActionScript Language Reference
Unlike objects that you create using the new constructor, multiple calls to Camera.get()
reference the same camera driver. Thus, if your script contains the lines
cam1 = Camera.get() and cam2 = Camera.get(), both cam1 and cam2 reference the same
(default) camera driver.
In general, you shouldn’t pass a value for
index; simply use Camera.get() to return a
reference to the default camera driver. By means of the Camera settings panel (discussed later
in this section), the user can specify the default camera driver Flash should use. If you pass a
value for
index, you might be trying to reference a camera driver other than the one the user
prefers. You might use
index in rare cases—for example, if your application is capturing video
from two cameras at the same time.
When a SWF file tries to access the camera returned by
Camera.get()—for example, when
you issue
NetStream.attachVideo() or Video.attachVideo()—Flash Player displays a
Privacy dialog box that lets the user choose whether to allow or deny access to the camera.
(Make sure your Stage size is at least 215 by 138 pixels; this is the minimum size Flash
requires to display the dialog box.)
When the user responds to this dialog box, the
Camera.onStatus event handler returns an
information object that indicates the user’s response. To determine whether the user has
denied or allowed access to the camera without processing this event handler, use
Camera.muted.
The user can also specify permanent privacy settings for a particular domain by right-clicking
(Windows) or Control-clicking (Macintosh) while a SWF file is playing and selecting
Settings. When the Privacy dialog box opens, the user selects Remember.
You can’t use ActionScript to set the Allow or Deny value for a user, but you can display the
Privacy dialog box for the user by using
System.showSettings(0). If the user selects
Remember, Flash Player no longer displays the Privacy dialog box for SWF files from this
domain.
If
Camera.get() returns null, 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
Camera.names.length. To display the Flash Player Camera Settings panel, which lets the
user choose the camera driver to be referenced by
Camera.get(), use
System.showSettings(3).
Camera class 17
Scanning the hardware for cameras takes time. When Flash finds at least one camera, the
hardware is not scanned again for the lifetime of the Flash Player instance. However, if Flash
doesn’t find any cameras, it will scan each time
Camera.get() is called. This is helpful if a
user has forgotten to connect the camera; if your SWF file provides a Try Again button
that calls
Camera.get(), Flash can find the camera without the user having to restart the
SWF file.
Example
The following example lets you select an active camera to use from a ComboBox instance.
The current active camera is displayed in a Label instance. Create a new video instance by
selecting New Video from the Library options menu. Add an instance to the Stage and give it
the instance name
my_video. Add a Label component instance to the Stage and give it the
instance name
camera_lbl, and a ComboBox component instance and give it the instance
name
cameras_cb. Then add the following ActionScript to Frame 1 of the Timeline:
var my_cam:Camera = Camera.get();
var my_video:Video;
my_video.attachVideo(my_cam);
var camera_lbl:mx.controls.Label;
var cameras_cb:mx.controls.ComboBox;
camera_lbl.text = my_cam.name;
cameras_cb.dataProvider = Camera.names;
function changeCamera():Void {
my_cam = Camera.get(cameras_cb.selectedIndex);
my_video.attachVideo(my_cam);
camera_lbl.text = my_cam.name;
}
cameras_cb.addEventListener("change", changeCamera);
camera_lbl.setStyle("fontSize", 9);
cameras_cb.setStyle("fontSize", 9);
See also
Camera.index, Camera.muted, Camera.names, Camera.onStatus, Camera.setMode(),
NetStream.attachVideo(), System.showSettings(), Video.attachVideo()
18 Client-Side ActionScript Language Reference
Camera.height
Availability
â–  Flash Player 6.
â–  Flash Media Server (not required).
Usage
public height : Number [read-only]
Description
Property (read-only); the current capture height, in pixels. To set a value for this property, use
Camera.setMode().
Example
The following code displays the current width, height and FPS of a video instance in a Label
component instance on the Stage. Create a new video instance by selecting New Video from
the Library options menu. Add an instance to the Stage and give it the instance name
my_video. Add a Label component instance to the Stage and give it the instance name
dimensions_lbl. Then add the following ActionScript to Frame 1 of the Timeline:
var my_cam:Camera = Camera.get();
var my_video:Video;
my_video.attachVideo(my_cam);
var dimensions_lbl:mx.controls.Label;
dimensions_lbl.setStyle("fontSize", 9);
dimensions_lbl.setStyle("fontWeight", "bold");
dimensions_lbl.setStyle("textAlign", "center");
dimensions_lbl.text = "width: "+my_cam.width+", height: "+my_cam.height+",
FPS: "+my_cam.fps;
See also the example for Camera.setMode().
See also
Camera.setMode(), Camera.width
Camera.index
Availability
â–  Flash Player 6.
â–  Flash Media Server (not required).
Camera class 19
Usage
active_cam.index
Description
Property (read-only); a zero-based integer that specifies the index of the camera, as reflected in
the array returned by
Camera.names.
Example
The following example displays an array of cameras in a text field that is created at runtime,
and tells you which camera you are currently using. Create a new video instance by selecting
New Video from the Library options menu. Add an instance to the Stage and give it the
instance name
my_video. Add a Label component instance to the Stage and give it the
instance name
camera_lbl. Then add the following ActionScript to Frame 1 of the Timeline:
var camera_lbl:mx.controls.Label;
var my_cam:Camera = Camera.get();
var my_video:Video;
my_video.attachVideo(my_cam);
camera_lbl.text = my_cam.index+". "+my_cam.name;
this.createTextField("cameras_txt", this.getNextHighestDepth(), 25, 160,
160, 80);
cameras_txt.html = true;
cameras_txt.border = true;
cameras_txt.wordWrap = true;
cameras_txt.multiline = true;
for (var i = 0; i<Camera.names.length; i++) {
cameras_txt.htmlText += "<li><u><a
href=\"asfunction:changeCamera,"+i+"\">"+Camera.names[i]+"</a></u></
li>";
}
function changeCamera(index:Number) {
my_cam = Camera.get(index);
my_video.attachVideo(my_cam);
camera_lbl.text = my_cam.index+". "+my_cam.name;
}
The MovieClip.getNextHighestDepth() method used in this example requires Flash Player
7 or later. If your SWF file includes a v2 component (version 2 of the Macromedia
Component Architecture), use the DepthManager class from the component framework
instead of the
MovieClip.getNextHighestDepth() method.
See also
Camera.get(), Camera.names
20 Client-Side ActionScript Language Reference
Camera.keyFrameInterval
Availability
â–  Flash Player 6.
â–  Flash Media Server (not required).
Usage
public keyFrameInterval : Number [read-only]
Description
Property (read-only); a number that specifies which video frames are transmitted in full
(called keyframes) instead of being interpolated by the video compression algorithm. The
default value is 15 (every 15th frame is a keyframe).
See also
Camera.setKeyFrameInterval()
Camera.loopback
Availability
â–  Flash Player 6.
â–  Flash Media Server (not required).
Usage
public loopback : Boolean [read-only]
Description
Property (read-only); a Boolean value that specifies whether a local view of what the camera is
capturing is compressed and decompressed as it would be for live transmission using Flash
Media Server (
true) or uncompressed (false). The default value is false.
To set this value, use Camera.setLoopback(). To set the amount of compression used when
this property is
true, use Camera.setQuality().
Example
See the example for Camera.setLoopback().
See also
Camera.setLoopback(), Camera.setQuality()
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148
  • Page 149 149
  • Page 150 150
  • Page 151 151
  • Page 152 152
  • Page 153 153
  • Page 154 154
  • Page 155 155
  • Page 156 156

MACROMEDIA CAPTIVATE 2 Reference

Category
Software
Type
Reference

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI