Home arrow Flash arrow Page 2 - Video and the Flash Communication Server
FLASH

Video and the Flash Communication Server


In this article, the last of three parts, you will learn how to build a simple video conferencing application using the Flash Communication Server. It is excerpted from chapter one of the book Programming Flash Communication Server, written by Brian Lesser, Giacomo Guilizzoni, Robert Reinhardt, Joey Lott, and Justin Watkins (O'Reilly, 2005; ISBN: 0596005040). Copyright © 2005 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

Author Info:
By: O'Reilly Media
Rating: 5 stars5 stars5 stars5 stars5 stars / 12
December 21, 2006
TABLE OF CONTENTS:
  1. · Video and the Flash Communication Server
  2. · Building the user interface
  3. · Setting up the NetConnection and showing its status
  4. · Making the connection

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Video and the Flash Communication Server - Building the user interface
(Page 2 of 4 )

Figure 1-6 shows the user interface for the helloVideo client. Each user’s video is displayed above the name he chose when he connected. The example shows the screen Robert used to connect.

The interface is made using four movie clips and a few components. There is one movie clip for each user. The movie clip contains an embedded Video object and a Label and TextInput component. The TextInput component in each movie clip will


Figure 1-6.  The helloVideo Flash movie

display the name each user enters in the My Name field. Note the TextInput component at the bottom of the screen containing the text “robert.” I also use a TextInput component to display the current connection status of the application. The button also indicates that the user is connected by displaying the Disconnect label. If the user is not connected, it toggles to Connect.

To build the interface:

  1. Start with an empty Flash movie and set its dimensions to 320 x 480 using the Properties panel.
  2. Create a new library symbol using the Insert -> New Symbol (Ctrl-F8) command.
  3. In the Create New Symbol dialog box, enter the symbol name GuestVideo and set the Behavior type to MovieClip. Enable the Export for ActionScript option, (click the Advanced button to display this option if it isn’t already visible). Set the Identifier field to GuestVideo as well.
  4. When the symbol is created in the Library, the Stage displays the empty symbol and its registration point. We want to place an embedded Video object within the symbol so that the video’s upper-left corner is at the symbol’s registration point.
  5. To add a Video object to the Library, open the Library panel (Ctrl-L or Cmd-L), and choose New Video from the Library panel’s Options menu, as shown in Figure 1-7.


    Figure 1-7.  Using the Library's Options menu to add an embedded video object

To place the embedded Video object within the symbol so that the video’s upper-left corner is at the symbol’s registration point:

 

  1. Drag the Video object from the Library to the Stage and position it at the GuestVideo symbol’s registration point. Use the X and Y fields in the Properties panel as illustrated in Figure 1-8 to position it at exactly (0, 0), and give it the instance name video.
  2. Drag one Label and one TextInput component from the Components panel to the Stage. Arrange them as illustrated in Figure 1-8 and give the TextInput component the instance name nameInput.
  3. Set the Text parameter of the Label to the text Name: using the Properties panel.


    Figure 1-8.  Using the Library menu to add the Video, Label, and TextInput to the GuestVideo symbol

 

Now that you’re done creating the GuestVideo symbol with the embedded Video object, we want four instances on stage (to display the four possible simultaneous clients):

  1. To return to the main movie’s Stage, click the Scene 1 link in the Timeline panel’s Edit bar.
  2. Drag the GuestVideo symbol from the Library to the Stage four times and arrange the four instances as shown in Figure 1-6. Select each one in turn and set its name toguest_1,guest_2,guest_3, orguest_4using Flash’s Properties panel.
  3. Finally, at the bottom of the movie, add the two Label components, two TextInput components, and one Button component. Position and resize them as illustrated in Figure 1-6. Name the large TextInput instancestatusInput, the small TextField instanceuserNameInput, and the Button instanceconnectButton.

With the main Stage of the movie laid out, it’s time to start coding.


blog comments powered by Disqus
FLASH ARTICLES

- More Top Flash Game Tutorials
- Top Flash Game Tutorials
- Best Flash Photo Gallery Tutorials
- The Top Flash Tutorials for Menus
- 7 Great Flash Tutorials
- Adobe Creative Suite 5.5 Now Available
- Critical Flash Vulnerability Heats Up the Web
- More on Nonpersistent Client-Side Remote Sha...
- Nonpersistent Client-Side Remote Shared Obje...
- Using the Decorator Pattern for a Real Web S...
- Using Concrete Decorator Classes
- Delving More Deeply into the Decorator Patte...
- The Decorator Pattern in Action
- A Simple Decorator Pattern Example
- Decorator Pattern

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials