Swffile.getnaturalsize() – Adobe Dreamweaver API Reference CS5 User Manual
Page 45
40
DREAMWEAVER API REFERENCE
Flash integration
Last updated 8/27/2013
•
The jpgFileName argument, which is expressed as a file:// URL, is the output filename of a JPEG file. This argument
is optional.
•
The movFileName argument, which is expressed as a file:// URL, is the output filename of a QuickTime file. This
argument is optional.
•
The 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:
Returns
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 arguments’ 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.
Example
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");
SWFFile.getNaturalSize()
Description
This function returns the natural size of any uncompressed Flash content.
Arguments
fileName
•
The fileName argument, which is expressed as a file:// URL, is a path to the Flash content.
Option Flag
Data
Description
Example
-defaultsize
Width, height
Sets the output image size to the specified width
and height
"-defaultsize",
"640", "480"
-exactFit
None
Stretches the contents in the output image to fit
exactly into the specified output size
"-exactFit"