Developing Flash Communication Server MX Applications in Flash

 <  Day Day Up  >  

Flash MX Professional 2004 is the complete authoring environment for developing applications that communicate with Flash Communication Server MX. You must download and install the Flash Communication Server MX 2004 authoring components from to begin creating communication applications . After they are installed, Flash will be outfitted with a new Communications component Library, additional ActionScript objects, and some tools to help you develop your application.

The Integrated ActionScript window built into Flash MX Professional 2004 improves the efficiency of developing communication applications from previous versions of Flash. Figure 15.1 shows the new panel configuration for creating ServerSide ActionScript (SSAS). Flash MX Professional 2004 is the only authoring environment needed to develop communication applications because SSAS can be developed directly within Flash. This lets you easily switch between your Flash document and your SSAS.

Figure 15.1. The authoring environment setup for developing SSAS.


Flash movies traditionally use SWF files and Hypertext Markup Language (HTML) container files to deliver an application by means of a web browser. Flash movies that use Flash Communication Server MX have significantly more pieces working together to develop and deliver the application, including the following:

  • Flash Communication Server MX

  • Applications folder

  • Flash video and MP3 sound files

  • ActionScript (Flash and server-side)

  • Debugging tools

  • An HTML container file

  • A web server

Let's look at these seven key pieces in more detail to understand how they all come together.

Flash Communication Server MX

Flash Communication Server MX is a server usually installed on a dedicated machine running Windows or Linux. It is used to connect Flash Players and other servers running Flash Communication Server MX. Flash Communication Server MX facilitates persistent communications over an IP network using a dedicated port number (the default port is 1935). When installed, Flash Communication Server MX creates folders on the server for the following:

  • Server files: The core server service.

  • Configuration folders: XML files used to customize the server and to manage server resources and connections.

  • Help and debugging tools: HTML support files, the Administration console, and the Communication App Inspector tool (discussed later in this chapter).

  • Applications: A folder that contains application assets.

The Applications Folder

An application that uses Flash Communication Server MX is defined by creating a folder within the applications folder on the server. It is important to know where your folder, flashcom\applications , is located because that is where you will set up applications and store its assets (video, MP3, and SSAS). If you installed Flash Communication Server MX on a Windows machine with a web server previously installed, its default install folder is as follows and is shown in Figure 15.2:

Figure 15.2. The directory path showing a single application folder ready for use with Flash Communication Server MX.


If you installed Flash Communication Server MX without a web server installed or installed the Developer edition, the applications folder will be placed as shown in the following code:

 C:\program files\macromedia\flash communication server mx\flashcom\applications\ 

A communication application will be defined after a folder with the name of your application is placed within the applications folder.

If you use SSAS, this folder will contain the SSAS stored within a file called main.asc . The folder will also store streams and Remote SharedObjects that are persistent.

Flash Video and MP3 Sound Assets

FLV files and MP3 sound files that are streamed using Flash Communication Server MX are stored within the application folder. You can use Flash MX Professional 2004 to convert many popular digital video formats, including Windows Media (AVI and WMV), QuickTime (MOV), or Digital Video (DV), into the FLV format.

Any MP3 file can be streamed from Flash Communication Server MX. Song information such as artist, song name, and album title embedded within MP3 files can be accessed and displayed to the user . MP3 files are prerecorded and cannot be created from a live source.

FLV files can also be created from a live video source using Flash Communication Server MX or Sorenson Squeeze, a third-party tool developed by Sorenson Media (www. sorenson .com).

These media files are stored within a streams folder of the application. You must create the streams folder, plus a folder for each instance of the application. Application instances will be discussed later in this chapter. Figure 15.3 shows a typical directory structure that contains a streams folder for an application called "FCS-AS2."

Figure 15.3. The directory path showing a streams folder for the instance myInstance within the application "FCS-AS2."


Flash Communication Server MX also supports virtual folders that can be used to map streams folders available across all applications. Virtual folders are defined in the vHost.xml file located in the conf folder in your Flash Communication Server MX install folder.


Flash Communication Server MX applications are built using Flash MX and therefore ActionScript 2.0 is used as the programming model. ActionScript is used in two places when developing communication applications:

  • On the Flash Player (ActionScript 2.0)

  • On the server (SSAS 1.0)

SSAS is used to control and manage server connections and connected Flash Players. It exists in a file called main.asc located within the application folder. When the authoring components for Flash Communication Server MX are installed into Flash MX Professional 2004, some ActionScript 2.0 objects definitions will be extended. These extensions will provide code hinting and support for Flash Communication Server MX-specific operations in SSAS and Flash ActionScript 2.0.

Debugging Tools

There are two tools that are installed with Flash Communication Server MX: the Communication App Inspector and the Communication Admin Console. These tools let you interact with the server's operation and monitor activity across all applications.

Here are the debugging options available in Flash MX Professional 2004 for building applications that use Flash Communication Server MX:

  • Communication App Inspector. Used to load and reload application instances after SSAS changes have been made. The tool also acts as a server output (trace) window, and it lets you monitor streams, messages, and other application-specific information.

  • Communication Admin Console. This console lets you manage the server operation, including user accounts and licensing.

  • NetConnection Debugger. This tool is installed with the Flash Remoting components. The debugger monitors AMF activity, which is the format used by Flash Remoting over HTTP. You can also monitor Flash Communication Server MX over RTMP.

  • Flash Output window. This is probably the best tool to help you debug applications ”Flash Communication Server MX or otherwise . This window is used in conjunction with the trace action.

  • Flash Interactive Debugger. This lets you place watches and monitor the values of complex ActionScript objects and Remote SharedObjects .

HTML Container Files and Web Server

Communication applications that use Flash Communication Server MX and Flash can be delivered in two ways:

  • Delivered as a stand-alone executable file sent by email or published onto CD-ROM. In this scenario, the Flash Player is build into the executable file with the application.

  • Delivered over the Internet using any typical web server. In this scenario, the application is delivered as an SWF movie and played within the embedded Flash Player installed on the client.

Flash Communication Server MX does not require a web server (such as Apache or Windows Internet Information Services [IIS]) to operate . The web server provides the transport protocol used to deliver the application. It is your option to use either the web server or the executable file to deliver the application. Web servers are not used in any Flash Communication Server MX communication methods .

 <  Day Day Up  >  

Object-Oriented Programming with ActionScript 2.0
Object-Oriented Programming with ActionScript 2.0
ISBN: 0735713804
EAN: 2147483647
Year: 2004
Pages: 162 © 2008-2017.
If you may any questions please contact us: