This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
54
|
Chapter 2: Communication Components
Speaker Mode
Whereas the PresentationSWF component uses a global variable named
speakerMode, the PresentationText component provides the speaker/viewer tog-
gle value at the instance level. For the speaker version of the PresentationText
component, set the parameter to
true. For the viewer version, set the parameter
to
false. This parameter corresponds to the speakerMode property of the Presen-
tationText component, not the global variable of the same name.
How the component works
The PresentationText component uses the same overall structure as the Presentation-
SWF component, in that both of them use an RSO to synchronize slide information
among connected users. However, the
presentation RSO created by the Presenta-
tionText component is persistent—the data used for the slides, once created by a
user in speaker mode, can exist in perpetuity. This feature allows the speaker to cre-
ate the outline and text slides of a presentation before the live presentation. For
example, a professor could create the headings and text for each slide days in
advance; each text slide’s information would be stored within the persistent
presentation RSO. When the professor is ready to conduct his online course, the
speaker-enabled PresentationText component automatically loads the existing slide
information and displays it to the viewers.
RoomList
The RoomList component is perhaps the most advanced communication compo-
nent. Of all the communication components, it requires the most manual coding—
you can’t simply drag and drop this component onto the Stage, even with the use of
SimpleConnect, and be on your way. The RoomList component enables you to cre-
ate a gateway to other application instances running on your FlashCom Server.
Remember, when you create a FlashCom application, a Flash movie can connect to
the default instance or a specific named instance of the application. For a chat appli-
cation, you can equate an application instance with a room within the chat applica-
tion. The RoomList component enables a Flash movie to show each of these
instances. The movie containing the RoomList component, however, must connect
to an application entirely separate from the chat application. As shown in
Figure 2-10, the user interface of the RoomList component displays a list of running
FlashCom applications and allows a Flash client to join, create, or delete instances of
those applications.
Unlike other communication components, the RoomList component is used with an
entirely separate FlashCom application instance than the one to which the clients
will ultimately connect.
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Summary of Communication Components
|
55
The following steps outline a standard user experience with an application using the
RoomList component:
1. The user loads an HTML page containing a Flash movie (SWF file #1) with an
instance of the RoomList component. The RoomList instance connects to a
FlashCom application (application A) that monitors one or more instances of
another FlashCom application (application B).
2. The user logs into application A from SWF file #1, using the SimpleConnect
component.
3. In SWF file #1, the user chooses one of the application instances from the UI of
the RoomList component and clicks the Create Room or Join Room button.
4. The RoomList component opens a new browser window, containing a different
HTML page with another Flash movie (SWF file #2). The HTML code of this
document passes parameters from the original Flash movie (SWF file #1); SWF
file #2 connects to a new FlashCom application (application B), which receives
the parameters. A custom server-side script must be written for application B to
process the parameters and notify application A that a user has now connected
to application B.
See the Developing Communication Applications documentation that accompanies
Flash Communication Server MX 1.5 (available in both LiveDocs and PDF format
from http://www.macromedia.com/support/documentation/en/flashcom/index.html) for
more information about the specific server-side event handlers that are necessary for
two FlashCom applications to use the RoomList component.
Nested Flash UI components
The RoomList component uses three Flash MX UI components: ListBox, PushBut-
ton, and ScrollBar. You can alter the look of these component by changing the
appropriate skin symbol in the Component Skins folder within the Flash docu-
ment’s Library panel.
Figure 2-10. The RoomList component provides a lobby

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.