This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
62
|
Chapter 2: Communication Components
UserColor component is a combo box with 10 preselected colors, as shown in
Figure 2-14. When the user selects a color within the UserColor component, her text
appears in that color within the history window of the Chat component. If the Cur-
sor component is used with the Flash movie, the user’s cursor will be displayed to
other users in the chosen color as well.
Nested Flash UI components
The UserColor component uses the Flash MX UI components ComboBox and
ScrollBar. You can alter the look of this component by changing the appropriate skin
symbol in the Component Skins folder within the Flash document’s Library panel.
How the component works
The UserColor component, like the SetBandwidth component, uses a gFlashCom.
Notifier object in client-side ActionScript to notify other color-aware communica-
tion components of changes made to the user’s color preference. When the user
loads a Flash movie that contains a UserColor component, the UserColor compo-
nent connects to the FlashCom application specified by a SimpleConnect compo-
nent or a custom connection that passed its NetConnection object to the UserColor’s
connect( ) method. In order for the UserColor component to work properly, the set-
Username( ) method of the component must be invoked and passed a string value for
the user’s name. If you use the SimpleConnect component, this happens automati-
cally. The UserColor component also stores its selected color value within the
usercolor property of the client’s global storage object within Server-Side Action-
Script for the duration of the application session.
VideoConference
The VideoConference component enables you to create a Flash client capable of dis-
playing multiple instances of the AVPresence component. As each user connects to
the FlashCom application, a new AVPresence instance is added to the Stage, display-
ing her audio/video stream as shown in Figure 2-15.
This component can be particularly bandwidth-intensive for both client-side and
server-side connections. As each user is added to the AV chat, the stream must man-
age multiple additional streams depending on the number of users—the new user
Figure 2-14. The UserColor component
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Summary of Communication Components
|
63
has one outgoing stream, plus one incoming stream for each existing user. Likewise,
the new user’s stream must be sent to existing users (in addition to the streams they
already have). For example, if you have three users connected to an application using
the VideoConference component, the server is managing nine streams; the server and
each user’s bandwidth must be capable of handling three streams for each user: his
own stream (outgoing) and the two from the other participants (incoming). You can
quickly determine how many streams a server must handle by squaring the number
of participants. For example, five participants will require the server to handle 25
streams (five for each participant).
Nested Flash UI components
The VideoConference component does not use any Flash UI components. It does
however automatically include the AVPresence component symbol. The skin assets
of the VideoConference component are located in the Communication Components
Core Assets - Developer Only VideoConference Assets folder of your docu-
ment’s Library. You can also change the look of the AVPresence component by mod-
ifying the graphics in the AVPresence Assets
fc_av_icons folder.
Client-side component parameters
The VideoConference component has four parameters that can be set in the Proper-
ties panel or Component Parameters panel:
Show Boundary
This Boolean parameter, corresponding to the
showBoundary property, deter-
mines if the border of the VideoConference instance is displayed. The default
value is
false. You can use Flash’s Transform tool to stretch the dimensions of
the instance without distorting the physical appearance of the AVPresence
instances that will be attached for each user.
Figure 2-15. The runtime look of the VideoConference 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.