File Monikers

File monikers provide a simple mechanism for referring to common locations without having to supply paths and without using global variables created by SWF Studio. You can use a file moniker in place of a file system path in any ActionScript API parameter that says: "This parameter supports monikers".

The following is a list of valid monikers and the values that SWF Studio will replace them with:

startdir://application start directory (same as ssGlobals.ssStartDir)
tempdir://application temporary directory (same as ssGlobals.ssTempDir)
internal://root folder where files are autoextracted from the layout (same as ssGlobals.ssTempDir)
windows://Windows directory e.g. "C:\Windows"
winsys://Windows system directory e.g. "C:\Windows\System32"
desktop://path to the current users desktop folder e.g. "C:\Documents and Settings\Tim\Desktop"
programfiles://path to the program files directory e.g. "C:\Program Files"
appdata://application data folder e.g. "C:\Documents and Settings\Tim\Application Data"
allusersappdata://common application data folder e.g. "C:\Documents and Settings\All Users\Application Data"

Example 1:

Without monikers.

// In this example we have hard coded the path to Notepad.exe but the
// path we have provided will only work on systems where that path
// is valid, we could use ssGlobals.ssWinSysDir...

ssCore.FileSys.fileExists({path:"c:\\WinNT\\System32\\Notepad.exe"}, {callback:onFileExistst});

Example 2:

Using monikers.

// In this example we have replaced the hard coded path with the winsys://
// moniker. SWF Studio will automatically find out at runtime where the Windows
// system directory is and replace the moniker with the correct path.

ssCore.FileSys.fileExists({path:"winsys://Notepad.exe"}, {callback:onFileExistst});

Note: All paths returned when you use monikers will be short paths names so instead of "C:\Program Files" you will see something like "C:\PROGRA~1".