MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Specifiche Pagina 96

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 369
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 95
Chapter 118
Starting the service
During server installation, you might have chosen to start the service automatically. If you did,
the service will be started whenever the server machine is started, and you dont need to start it
manually. If you did not, you can start the server from the Windows Start menu: choose Programs
> Macromedia Flash Communication Server MX > Start Service. On Windows, to confirm that
the service is running, open the Task Manager and make sure both FlashCom.exe and
FlashComAdmin.e are listed in the Processes tab.
Opening a connection to the server
Open a new file in the Flash authoring environment, and then add the client-side ActionScript
commands to connect to the server.
To use ActionScript to connect to the server:
1 In a new Flash movie, begin opening a connection to the Flash Communication Server by
issuing the following command:
my_nc = new NetConnection();
2
Follow this command with a connect command:
my_nc.connect(targetURI);
In this basic syntax for NetConnection.connect (omitting optional parameters), targetURI
is the Uniform Resource Identifier (URI) of an application on the Flash Communication
Server that should run when the connection is made. To specify
targetURI, use one of the
following formats (items in brackets are optional):
rtmp:[port]/appName[/instanceName] (acceptable if the movie and the Flash
Communication Server are on the same computer)
rtmp://host[:port]/appName[/instanceName]
Note that in both syntax examples for targetURI, you must specify rtmp (the Real-Time
Messaging Protocol) as the protocol for the connection. If you omit it, the Flash Player
assumes you want to make an HTTP connection to an application server, and your connection
will fail.
If the server is running on your local machine, you can use
"localhost" as the host name in
the URI; this is often convenient during application development.
For example, the following code uses the
new NetConnection constructor to create a new
connection object. Then, the object is connected to the server with the call to
my_nc.connect.
// Makes a new connection object
my_nc = new NetConnection();
// Connects to the instance named appInstance
// of the application named appName
// located on the Flash Communication Server
// that is running on myServer.myDomain.com
my_nc.connect("rtmp://myServer.myDomain.com/appName/appInstance");
Vedere la pagina 95
1 2 ... 91 92 93 94 95 96 97 98 99 100 101 ... 368 369

Commenti su questo manuale

Nessun commento