Specifications
307
CHAPTER 26
The Flash Objects API
The Flash Objects API lets extension developers build objects that create simple Macromedia
Flash content. This API provides a way to set parameters in a Flash Generator template (.swt file)
and output a Flash Movie or Image file. The API lets you create new Flash objects as well as
read and manipulate existing Flash objects. The Flash button and Flash text features are built
using this API.
The .swt file is a Flash Generator Template file, which contains all the necessary information
required to construct a Flash Object file (.swf). These API functions let you create a new .swf file
(or Image file) from a .swt file by replacing the parameters of the .swt file with real values. For
more information on Flash, see the Flash manual.
SWFFile.createFile()
Description
Generates a new Flash Object file with the specified template and array of parameters.
Also creates a GIF, PNG, JPEG, and MOV version of the title if filenames for those formats
are specified.
If you want to specify an optional parameter that follows optional parameters you do not want to
include, you need to specify empty strings for the extraneous parameters. For example, if you
want to specify a .png file, but not a .gif file, you need to specify an empty string before specifying
the.png filename.
Arguments
templateFile, templateParams, swfFileName, {gifFileName}, {pngFileName},
{jpgFileName}, {movFileName}, {generatorParams}
• templateFile is a path to a Template file, which is expressed as a file:// URL. This file can be
a .swt file.
• templateParams is an array of name/value pairs where the names are the parameters in the
.swt file and the values are what you want to specify for those parameters. For an .swf file to be
recognized by Macromedia Dreamweaver MX as a Flash object, the first parameter must be
"dwType". Its value should be a string that represents the name of the object type, such as
"Flash Text".
• swfFileName is the output filename of an .swf file, which is expressed as a file:// URL, or an
empty string to ignore.
• {gifFileName} is the output filename of a .gif filename, which is expressed as a file://URL Optional.