This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Summary of Communication Components
|
57
This Flash movie and HTML document are published and put on your web
server.
5. A Flash document (.fla file), which we’ll use to create SWF #2, is made for the
second application (application B). This document contains the managed appli-
cation monitored by the RoomList component and application A. The Flash
movie (.swf) for this document is embedded in the HTML document specified in
the Room Application Path parameter of the RoomList component as well. For
example, you can create a Flash document that uses the SimpleConnect, Chat,
and PeopleList components for a basic chat room. This document needs to pro-
cess parameters passed by the RoomList component in the URL of the HTML
document hosting the Flash movie (SWF #2). If you use the SimpleConnect
component in SWF #2 that connects to application B, the parameters will be
processed automatically. Otherwise, you’ll need to use client-side ActionScript
to process two
_root variables, username and appInstance, which are passed by
the RoomList component (
username is the string value entered by the user in the
SimpleConnect component of SWF #1, and
appInstance is the name of the
“room” instance specified in the Create Room dialog box or an existing instance
name displayed in the RoomList component).
6. Finally, the application.onConnect( ) method of the Server-Side ActionScript code
for application B must pass the
username and appInstance values to the Server-
Side ActionScript code of application A. There, an RSO used by the server-side
RoomList component stores, updates, and broadcasts the new information. In
turn, any users connected to SWF #1 will see an updated user count and new
“room” (or application instance) displayed in the UI of the client-side RoomList
component.
SetBandwidth
The SetBandwidth component allows a user to control how much bandwidth can be
used by Camera and Microphone objects utilized by other communication compo-
nents, such as the AVPresence and AudioConference components. The SetBand-
width component limits the byte throughput of a client Flash movie to a FlashCom
application. The component’s UI consists of a combo box with labels—Modem,
DSL, LAN, and Custom—as shown in Figure 2-11, indicating four connection types.
These labels are associated with preset bandwidth caps (typical connection speeds),
which can be set in the Properties panel or in client-side ActionScript.
Figure 2-11. The SetBandwidth component menu
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
58
|
Chapter 2: Communication Components
Selecting Custom opens a separate window, shown in Figure 2-12, in which the user
can customize the Up and Down bandwidth limits.
Whenever a user chooses an item in the SetBandwidth component, the quality and
attributes of Camera and Microphone objects managed by other communication
components will change. As more bandwidth is allocated to the movie, the quality of
the audio/video output improves.
Nested Flash UI components
The SetBandwidth component uses three Flash MX UI components: ComboBox,
PushButton, and ScrollBar. You can alter the look of these components by changing
the appropriate skin symbol in the Component Skins folder within the Flash docu-
ment’s Library panel.
Client-side component parameters
An instance of the SetBandwidth component has six settings in the Properties panel
or Component Parameters panel, as listed in Table 2-2.
These parameters establish the preferred bandwidth limit for the incoming and out-
going connection when the user chooses the specified connection type (Modem,
DSL, or LAN) in the SetBandwidth component. The connection type also affects the
capture attributes of the Camera object (as used by the AVPresence component) and
the sampling rate of the Microphone object (as used by the AVPresence or Audio-
Conference component).
Note that:
The practical throughput for a typical 56 Kbps dial-up modem is only 33 Kbps.
The DSL options reflect the typical upper limit of household ADSL (asymmetric
DSL) connections. The default DSL Down value is greater than DSL Up; there-
fore, the quality of incoming streams to the Flash movie client can be more than
twice the quality of the user’s outgoing stream.
Figure 2-12. The Custom options for the SetBandwidth component

Get Programming Flash Communication Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.