Document.optimizecurves(), Document.path – Adobe Extending Flash Professional CS5 User Manual
Page 145
123
EXTENDING FLASH PROFESSIONAL
Document object
Last updated 5/2/2011
document.optimizeCurves()
Availability
Flash MX 2004.
Usage
document.optimizeCurves(smoothing, bUseMultiplePasses)
Parameters
smoothing
An integer in the range from 0 to 100, with 0 specifying no smoothing and 100 specifying maximum
smoothing.
bUseMultiplePasses
A Boolean value that, when set to
true
, indicates that the method should use multiple passes,
which is slower but produces a better result. This parameter has the same effect as clicking the Use Multiple Passes
button in the Optimize Curves dialog box.
Returns
Nothing.
Description
Method; optimizes smoothing for the current selection, allowing multiple passes, if specified, for optimal smoothing.
This method is equivalent to selecting Modify > Shape > Optimize.
Example
The following example optimizes the curve of the current selection to 50º of smoothing with multiple passes:
fl.getDocumentDOM().optimizeCurves(50, true);
document.path
Availability
Flash MX 2004.
Usage
document.path
Description
Read-only property; a string that represents the path of the document in a platform-specific format. If the document
has never been saved, this property is
undefined
.
Example
The following example displays the path of the first document in the documents array in the Output panel. You must
save the document before running this script. In the example, the file is named test.fla and is saved in the My
Documents folder on a Windows computer.
var filePath = flash.documents[0].path;
fl.trace(filePath);
// displays C:\Documents and Settings\