mFile.createShortcut()

Availability

Windows: Flash 8 or 9 AS2.0 SWF + mProjector 3.0; Windows 98/ME/NT Support: Flash 7 SWF + mProjector 2.0;

Macintosh: Flash 8 or 9 AS2.0 SWF + mProjector 2.0; replacing mProjector 1.0 async

Usage

mFile.createShortcut(targetFile:String, arguments:String, shortcutFile:String, description:String, iconFile:String, iconNumber:Number) : Boolean

Parameters

targetFile - Name (including the full path) of the file the shortcut should point to.

arguments - WINDOWS ONLY - Command-line arguments for the targetFile file. This argument is ignored on the Mac.

shortcutFile - Name and location of the shortcut. On Windows the shortcut must have an .lnk extension.

description - WINDOWS ONLY - Description of the shortcut. This argument is ignored on the Mac.

iconFile - WINDOWS ONLY - Name (including the path) of the file containing the icon to be used for this shortcut. This argument is ignored on the Mac.

iconNumber - WINDOWS ONLY - Ordinal number of the icon within the iconFile. This argument is ignored on the Mac.

Returns

A boolean.; ;

Description

Method; Creates a shortcut to an existing file. Platform Implementation Differences: On Windows the file name must include a fully qualified path. On the Mac if no path is specified, the working directory is used.

Example

The following example creates an iTunes shortcut on the Windows desktop.

var programFilesPath:String = mSystem.getSpecialFolder("PROGRAM_FILES")
var desktopPath:String = mSystem.getSpecialFolder("DESKTOP");
var shortcutFilename: String;
var pathDelimiter:String = mSystem.getPathDelimiter();
if (mSystem.isMac()) {
	shortcutFilename = pathDelimiter + "iTunes";
} else if (mSystem.isWindows()) {
	shortcutFilename = pathDelimiter + "iTunes.lnk"; // windows shortcuts require ".lnk" extension
}
mFile.createShortcut(programFilesPath+pathDelimiter + "iTunes"+pathDelimiter + "iTunes.exe","",desktopPath+shortcutFilename,"Shortcut","",0);

Code Examples

Desktop Shortcut and Start Menu Support, Creating an Installer, mProjector Class Basics -- mFile