Macromedia flash media server 2-developing media applications User Manual

Page of 114
Archiving and compiling server-side script files
89
Now the scripts are ready to be packaged into a FAR file. Open the Archive Compiler utility 
in a command shell and run the following command:
far -package -archive main.far -files testFAR.asc webServices\*.asc
Finally, replace the scripts folder in the application directory with the main.far file.
To verify the content in the FAR file, open the file in WinZip.   It is important to verify that 
the path of the scripts inside the FAR file is set so that the main script can refer to the scripts 
correctly. In the testFAR example, the unzipped FAR file looks like the following example: 
You can also include the FAR file in the scriptlib path in Flash Media Server. The scriptlib 
path is defined in the fcs.ini file under the Flash Media Server installation directory. In this 
case, the FAR file acts like a directory; instead of looking for script files from a directory, Flash 
Media Server looks for the script files in the FAR file.
The scriptlib is defined in the fcs.ini file as in the following example:
APP.JS_SCRIPTLIBPATH = C:\Program Files\Macromedia\Flash Communication 
Server MX\scriptlib
To include a FAR file in the scriptlib path, use the following code:
APP.JS_SCRIPTLIBPATH = C:\Program Files\Macromedia\Flash Communication 
Server MX\scriptlib;C:\FMS\myLibrary.far
Compiling scripts to bytecode
To speed up the time required to load an application instance, you can use the FAR utility to 
compile one or more ASC or JS files to bytecode. 
The output file is in the same location as the input file and has the same name, but the .asc or 
.js file extension is replaced with a .ase file extension. If the input file does not have a .asc or .js 
extension, the .ase extension is appended to the filename.