Macromedia flash media server 2-developing media applications User Manual

Page of 114
Archiving and compiling server-side script files
87
To package server-side scripts in an archive file:
1.
Open your operating system’s command shell.
2.
Enter far -package with the desired options at the prompt.
The syntax for running the archive compiler utility to create a script package is as follows:
c:\> far -package -archive <archive> -files <file1> [<file2> ... 
<fileN>]
The following table describes the command-line options available for the 
-package
 
command:
About FAR files
You can place the FAR file in two places in an application: in the applications directory, or in 
the scriptlib path. 
If you place the FAR file in the applications directory, the name of the FAR file must be 
main.far or <appname>.far where <appname> is the name of the application directory. 
For example, if an application is located in C:/samples/foo, you can package all the required 
script files from the application folder into main.far or <appname>.far and put it in C:/
samples/foo. When the server loads an application, the server looks for the main script in the 
main.far or <appname>.far file in the application folder. If no FAR file is found, the server 
looks for the main script in the application folder. 
When scripts in the FAR file refer to other script files in a scriptlib path, Macromedia 
recommends that you place all of the required script files from the path into the FAR file. This 
placement prevents an application from loading a different version of the script file with the 
same name from a different computer. When a scripts refers to a script file in the FAR file, the 
server always looks for the script file inside the FAR file first and then looks in the application 
directory. When other scripts are referred to in the main script, you must maintain the path in 
the FAR file.
NO
TE
If the main script refers to scripts in a sub-directory, the hierarchy must be 
maintained in the archive file. To maintain this hierarchy, Macromedia recommends 
that you run the FAR utility in the same directory where the main script is located.
Option
Description
-archive <archive>
Specifies the name of the archive file; the 
archive file has a .far file extension.
-files <file1 [<file2> ... <fileN>]
Specify the list of files to be included in the 
archive file. This option takes a minimum of 
one file.