SearchPath*

Type

Character

Description

A search path is a list of folders separated by semicolons. The SearchPath variable is particularly useful when the computer on which your Authorware piece is running doesn't have the same folder structure as the computer on which you created it. When Authorware needs to locate an external file, it does so as follows:

  1. During authoring, Authorware first looks in the location from which it originally loaded the file. This step doesn't occur at runtime.
  2. Next it looks in the directories specified in the variable SearchPath.
  3. Next it looks in the directory containing the current Authorware file.
  4. Next it looks in the directory containing the Authorware application file.
  5. Finally, it looks in the Windows directory and in the Windows System directory.

If Authorware looks for an external movie and doesn't find it, it displays a File dialog box and prompts the user to locate the movie. If Authorware looks for a DLL and doesn't find it, it displays a message indicating the problem during authoring, and silently ignores the call at runtime.

When starting a piece, Authorware initializes the value of SearchPath to the path you've entered in the Search Path field of the File Properties dialog box. Once your piece is running, you can assign values to SearchPath to make Authorware search different locations for external media, such as movies.

However, the value you enter in the Search Path field doesn't help Authorware locate libraries, since it searches for them before running the piece. If Authorware can't find a library it needs, it prompts the user for the location of the file.

You can assign a value to the initial search path that Authorware uses to look for a library by editing the A7W.INI file. This file should be placed in either the Authorware application directory or the Windows directory. For pieces packaged with the Authorware runtime, the A7W.INI file can be placed in the directory that contains the executable (.EXE) file. If Authorware does not locate the A7W.INI file, it creates a new file in the user's home directory. Often, developers use an installation routine to edit this file. Use the following format to set the search path for a specific file:

[ExactFileName]
SearchPath = path1; path2; ...; pathx

You can set the search path for all files by entering a SearchPath line under the Directory section:

[Directory]
SearchPath = path1; path2; ...; pathx

Generally, in Windows a path uses the syntax DriveLetter:\directory\directory.

When the Authorware Web Player is running a piece in nontrusting mode, it disables this variable.

Example

You could set the search path of a file named money.exe like this:

[money.exe]
SearchPath=D:\movies; D:\library

When Authorware starts opening the piece, it checks the search path D:\movies;D:\library. Once the piece is running, Authorware concatenates this value of SearchPath to any value that you've entered in the File Properties Search Path field.

For example, if the Search Path field in the File Setup dialog box contains

C:\main

Authorware concatenates the initial value of SearchPath to the new value

C:\main; D:\movies; D:\library

A path that doesn't include a volume name or drive letter is called a relative path. In Authorware, all relative paths are relative to the directory that contains the Authorware file (available in the FileLocation variable). Relative paths are often useful when you are specifying search paths because they don't depend on volume names or drive letters. To go up the folder hierarchy use .. on Windows. For example, if you want to use the images folder that is adjacent to the folder containing your Authorware piece, set the search path to ..\\images.

Cross-platform search paths

For cross-platform pieces, Authorware does not automatically convert a search path you specify to its Macintosh equivalent. Instead you must specify both Windows and Macintosh search paths in the Search Path box of the File Properties dialog box or by using the SearchPath variable. Use a semicolon to separate Windows and Macintosh search paths.


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/authorware/7/using_aw_en/15_va174.htm