beautypg.com

Presetpanel.exportitem() – Adobe Extending Flash Professional CS5 User Manual

Page 392

background image

370

EXTENDING FLASH PROFESSIONAL

presetPanel object

Last updated 5/2/2011

Description
Method; expands or collapses the currently selected folder or folders in the Motion Presets panel. To expand or
collapse folders other than the folders that are currently selected, pass a value for folderPath.

Example
The following example expands the Custom Presets folder but does not expand its subfolders:

fl.presetPanel.expandFolder(true, false, "Custom Presets");

The following example expands the Custom Presets folder and all its subfolders:

fl.presetPanel.expandFolder(true, true, "Custom Presets");

presetPanel.exportItem()

Availability
Flash CS4 Professional.

Usage

presetPanel.exportItem(fileURI [, namePath] )

Parameters

fileURI

A string, expressed as a file:/// URI, that specifies the path and optionally a filename for the exported file. See

“Description,” below, for more information.

namePath

A string that specifies the path and name of the item to select from the Motion Presets panel. This

parameter is optional.

Returns
A Boolean value of

true

if the preset was exported successfully;

false

otherwise.

Description
Method; exports the currently selected or the specified preset to an XML file. Only presets can be exported; the method
fails if you try to export a folder. This method also fails if you try to overwrite a file on disk.

If you don’t specify a filename as part of fileURI (that is, if the last character of fileURI is a slash (/)), the exported file
is saved with the same name as the preset being exported. If you don’t specify a value for namePath, the currently
selected preset is exported. See the example below.

Example
The following example demonstrates what files are created when different parameters are passed to this method, and
informs you if the specified file was successfully created. Before running this example, select the fly-in-left preset in the
Default Presets folder and create the

My Presets

folder on disk.

This manual is related to the following products: