This function generates a new Flash Object file with the specified template and array of parameters. It 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 that you do not want to include, you need to specify empty strings for the unused 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.
templateFile,templateParams,swfFileName,{gifFileName},{pngFileName},{jpgFileName},{movFileName},{generatorParams}
templateFile argument is a path to a template file, which is expressed as a file:// URL. This file can be a SWT file.
templateParams argument 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 Dreamweaver to recognize a SWF file 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 argument, which is expressed as a file:// URL, is the output filename of an SWF file or an empty string to ignore.
gifFileName argument, which is expressed as a file:// URL, is the output filename of a GIF file. This argument is optional.
pngFileName argument, which is expressed as a file:// URL, is the output filename of a PNG file. This argument is optional.
jpgFileName argument, which is expressed as a file:// URL, is the output filename of a JPEG file. This argument is optional.
movFileName argument, which is expressed as a file:// URL, is the output filename of a QuickTime file. This argument is optional.
generatorParams argument is an array of strings that represents optional Generator command line flags. This argument is optional. Each flag's data items must follow it in the array. Some commonly used flags are listed in the following table:
| Option Flag | Data | Description | Example |
|---|---|---|---|
|
|
Width, height |
Sets the output image size to the specified width and height |
|
|
|
None |
Stretches the contents in the output image to fit exactly into the specified output size |
|
A string that contains one of the following values:
"noError" means the call completed successfully.
"invalidTemplateFile" means the specified template file is invalid or not found.
"invalidOutputFile" means at least one of the specified output filenames is invalid.
"invalidData" means that one or more of the templateParams name/value pairs is invalid.
"initGeneratorFailed" means the Generator cannot be initialized.
"outOfMemory" means there is insufficient memory to complete the operation.
"unknownError" means an unknown error occurred.
The following JavaScript creates a Flash object file of type "myType", which replaces any occurrences of the string "text" inside the Template file with the string, "Hello World". It creates a GIF file as well as a SWF file.
var params = new Array; params[0] = "dwType"; params[1] = "myType"; params[2] = "text"; params[3] = "Hello World"; errorString = SWFFile.createFile( "file:///MyMac/test.swt", ¬ params, "file:///MyMac/test.swf", "file:///MyMac/test.gif");
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/dreamweaver/8/apiref/06_flas7.htm