mSystem.openDocument()

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 1.1;

Usage

mSystem.openDocument(documentFile:String) : Void

Parameters

documentFile - Document file name. This can be a URL.

Returns

Nothing.

Description

Method; Opens the specified document.

Example

Example 1 creates a simple text document and then opens it. Example 2 opens the user's email client and creates a new email.

This command will also display URLs using the end-user's preferred browser as opposed to getURL() which will always launch IE (on Windows) to display the page.

//*===Example 1: Text Document ==*/

var success:Boolean;
var theWorkingDir:String = mApplication.getFolder() + mSystem.getPathDelimiter();
success = mFile.writeString(theWorkingDir +"File.txt","hello"); //write string
if (success) {
	mSystem.openDocument(theWorkingDir+"File1.txt");
}

//*===Example 2: Email ==*/

/* 
This command creates a new email with the following information:
 To: support@screentime.com
 Subject: Hello ScreenTime
 Body: I need help!
*/

var documentFile = "mailto:support@screentime.com?subject=Hello ScreenTime&body=I need help."
mSystem.openDocument(documentFile");

//*===Example 3: Open a PDF ==*/
mSystem.openDocument("C:/Help.pdf");

//*===Example 4: Open the user's preferred browser to a specific web page ==*/
mSystem.openDocument("http://www.screentime.com");


Code Examples

Open Documents, Creating an Installer