16
Getting Started
For organizational purposes during your development work, it might be convenient to store
all of our client and server application files (FLA, SWF, HTML, or ASC) in one subdirectory.
When you deploy your application, you can place your SWF
and HTML files in any location.
However, the registered application directory must remain on the Flash Media Server server,
along with any ASC, FSO, and FLV files that the application uses. The server-side files (your
ASC, FLV, and FSO files) and your FLA source file should not be in your web root directory
when you deploy the server and applications. Only your SWF and HTML files should remain
inside the web root directory.
In any case, you must create a registered application directory that has the same name as the
application you connect to when you issue the
NetConnection.connect()
command.
For example, suppose you have an application called chat_App, as the following example
shows:
NetConnection.connect("rtmp://myServer.myDomain.com/chat_App")
You must create a subdirectory named chat_App in the applications directory. Suppose also
that your application uses some server-side scripting, stored in a file called chat_App.asc. You
must place the chat_App.asc file in this same directory.
Storing your application’s server-side script files
In most of your applications, you’re likely to use server-side scripting. You create the server-
side script file for your application in the Flash ActionScript editor or in a JavaScript text
editor. Name the script file main.asc or main.js or
registered_app_name
.asc or
registered_app_name
.js, where
registered_app_name
is the name of the registered application
directory and the application itself. Save the script file in your registered application directory.
For example, if you have an /applications/chat_app directory for your chat application, you
could name your server-side script file chat_app.asc and place it in the chat_app directory.
Alternatively, you can place your server-side scripts in a subdirectory named scripts in the
registered application directory (/applications/chat_App/scripts).
NO
TE
You must create a registered application directory that matches your application name
even if you have no server-side script files to place there. This is because Flash Media
Server stores in your registered application directory any stream or shared-object files
that your application creates (see
“Coding conventions” on page 101
). Also, the
existence of this directory tells Flash Media Server that the application is authorized and
that users can connect to instances of this application.
NO
TE
To simplify deployment, Flash Media Server includes an archive compiler utility (far.exe)
that you can use to package your server-side script files in a single archive file. To speed
up loading time, the utility also lets you compile script files to binary format. For more
information, see
“Archiving and compiling server-side script files” on page 86
.
Summary of Contents for FLASH MEDIA SERVER 2-DEVELOPING MEDIA
Page 1: ...Developing Media Applications ...
Page 6: ...6 ...
Page 10: ...10 About This Manual ...
Page 36: ...36 Flash Media Server Architecture ...
Page 80: ...80 Debugging and Monitoring Applications ...
Page 106: ...106 Application Development Tips and Tricks ...
Page 114: ...114 ...