86
Application Development Tips and Tricks
On the server side, you must implement slightly different code; server-side ActionScript does
not contain a global object. The following code includes a file called my_file.asc:
if (_my_file_asc == null) {
_my_file_asc = true;
// All the code for myfile.asc goes here.
}
Also, instead of using the
#include
command, the server-side script uses a
load
command, as
follows:
load("my_file.asc");
Archiving and compiling server-side
script files
Flash Media Server includes a command-line archive compiler utility (far.exe) that lets you
package all your server-side scripts into one archive file, much like a ZIP file, to simplify
deployment. You can also use the archive compiler utility (called
FAR
) to compile server-side
script files to bytecode (with the file extension .ase) to speed up the time required to load an
application instance.
Archiving server-side scripts
A large application can contain multiple server-side script files stored in different locations.
Some files are located in the application directory and others are scattered in the script library
paths that are defined in the server configuration file. To simplify deployment of your media
application, you can package your server-side .js, .asc, and .ase files in a self-contained Flash
Media Server Archive file (.far).
The FAR file is a package that includes the main script file (which is either main.js, main.asc,
main.ase, <appname>.js, <appname>.asc, or <appname>.ase) and any other script files that are
referred to in the main script.
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 ...