
23
CHAPTER 2
About Flash Communication Server
Applications
With a few lines of code, your Macromedia Flash MX application (SWF) can communicate with
another client through the Macromedia Flash Communication Server MX. Using object-oriented
programming techniques and sound programming practices, you can write simple ActionScript
code to get started right away.
This chapter explains some ideas behind Macromedia Flash Communication Server MX and
describes the types of files you’ll generate. An overview of the ActionScript objects specific to
Flash Communication Server is also described here.
About Flash Communication Server services
You should be familiar with writing the instructions for a Flash application in a FLA file and
publishing it as a SWF file. When you run the SWF file, the Flash Player processes the
instructions. If these instructions do not include any calls to a Flash Communication Server, the
player relies on all of the technology within the player itself to execute each step. As soon as you
make a Flash Communication Server call in your ActionScript, however, the player sends that
request to the server.
After you use
new NetConnection to create an instance of the NetConnection object, the first
call you make to the server is
NetConnection.connect, which tells the player to connect to an
application on the server. The Flash Communication Server requires the use of the Real-Time
Messaging Protocol (RTMP):
my_nc = new NetConnection();
my_nc.connect("rtmp://myFlashComServer/myAppName/instanceName");
Once your Flash application issues this command (and succeeds in connecting to the server), it
has become a client-server application, and the instance of your Flash application running in the
player is referred to as the client.
Common client-server workflows
After the connection is established, the services provided by the server depend, in part, on what
the client expects. Four common scenarios are described below.
Commentaires sur ces manuels