MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Instrukcja Użytkownika Strona 6

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 80
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 5
6
To install and test the server-side ActionScript file, do the following:
1 Locate the Macromedia Flash Communication Server /applications directory.
The default location of the /applications directory is under the Macromedia Flash
Communication Server MX product installation directory.
Note: If you did not accept the default installation settings and you aren’t sure where the application directory is
located, the location is specified in the
<AppsDir> tag of the Vhost.xml file, which is located at \Flash
Communication Server MX\conf\_defaultRoot_\_defaultVhost_\. For information about configuring a different
application directory, see Managing Flash Communication Server. While your SWF and HTML files should be
published under a web server directory, your server-side ASC files, your audio/video FLV files, and your
ActionScript FLA source files should not be accessible to a user browsing your website.
2 Your server-side script file must be named main.asc, main.js, registered_app_name.asc, or
registered_app_name.js.
3 Create a subdirectory in the /applications directory called appName, where appName is a name
you choose as the filename of your Flash Communication Server application. You must pass
this name as a parameter to the
NetConnection.connect method in the client-side
ActionScript.
4 Place the main.asc file in the appName directory or in a subdirectory called scripts in the
appName directory.
5 Open the Flash application (the SWF) in a browser or in the stand-alone Flash Player.
The SWF must contain ActionScript code that passes appName to the
connect method of the
NetConnection object, as shown in the following example:
nc = new NetConnection();
nc.connect("rtmp://flashcomsvr.mydomain.com/myFlashComAppName");
Note: You can use the Communication App inspector or the Administration Console to check if the application
loaded successfully.
Using naming conventions
When you write server-side ActionScript code, there are certain naming conventions that you
must use to name your applications, methods, properties, and variables. These rules let you
logically identify objects so your code executes properly.
Naming applications
Flash Communication Server application names must follow the Uniform Resource Identifier
(URI) RFC 2396 convention (see http://www.w3.org/Addressing/). This convention supports a
hierarchical naming system where a forward slash (/) separates the elements in the hierarchy. The
first element specifies the application name. The element following the application name specifies
the application instance name. Each instance of the application has its own script environment.
Specifying instances
By specifying a unique application instance name after an application name, you can run multiple
instances of a single application. For example, rtmp:/support/session215 specifies a customer
support application named “support” and refers to a specific session of that application named
session215”. All users who connect to the same instance name can communicate with each other
by referencing the same streams or shared objects.
Przeglądanie stron 5
1 2 3 4 5 6 7 8 9 10 11 ... 79 80

Komentarze do niniejszej Instrukcji

Brak uwag