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
Summary of Contents for DREAMWEAVER MX 2004-DREAMWEAVER API
Page 1: ...Dreamweaver API Reference...
Page 24: ...24 Contents...
Page 32: ......
Page 70: ...70 Chapter 5 Fireworks Integration...
Page 76: ...76 Chapter 6 Flash Integration...
Page 116: ...116 Chapter 9 The JavaBeans API...
Page 140: ......
Page 152: ...152 Chapter 11 Application...
Page 218: ...218 Chapter 12 Workspace...
Page 248: ...248 Chapter 13 Site...
Page 292: ...292 Chapter 14 Document...
Page 378: ...378 Chapter 17 Design...
Page 430: ...430 Chapter 18 Code...
Page 486: ...486 Index...