User Guide

The Flash Objects API 75
SWFFile.getObjectType()
Description
This function returns the Flash object type; the value that passed in the dwType parameter when
the
SWFFile.createFile() function created the file.
Arguments
fileName
The fileName argument, which is expressed as a file:// URL, is a path to a Flash Object file.
This file is usually a SWF file.
Returns
A string that represents the object type, or null if the file is not a Flash Object file or if the file
cannot be found.
Example
The following code checks to see if the test.swf file is a Flash object of type myType:
if ( SWFFile.getObjectType("file:///MyMac/test.swf") == ¬
"myType" ){
alert ("This is a myType object.");
}else{
alert ("This is not a myType object.");
}
SWFFile.readFile()
Description
This function reads a Flash Object file.
Arguments
fileName
The fileName argument, which is expressed as a file:// URL, is a path to a Flash Object file.
Returns
An array of strings where the first array element is the full path to the template SWT file. The
following strings represent the parameters (name/value pairs) for the object. Each name is
followed in the array by its value. The first name/value pair is
"dwType", followed by its value.
The function returns a null value if the file cannot be found or if it is not a Flash Object file.
Example
Calling var params = SWFFile.readFile("file:///MyMac/test.swf") returns the
following values in the parameters array:
"file:///MyMac/test.swt" // template file used to create this .swf file
"dwType" // first parameter
"myType" // first parameter value
"text" // second parameter
"Hello World" // second parameter value
000_DW_API_Print.book Page 75 Wednesday, August 20, 2003 9:14 AM