beautypg.com

Document.importpublishprofile(), Document.importpublishprofilestring() – Adobe Extending Flash Professional CS5 User Manual

Page 137

background image

115

EXTENDING FLASH PROFESSIONAL

Document object

Last updated 5/2/2011

document.importPublishProfile()

Availability
Flash MX 2004.

Usage

document.importPublishProfile( fileURI )

Parameters

fileURI

A string, expressed as a file:/// URI, that specifies the path of the XML file defining the profile to import.

Returns
An integer that is the index of the imported profile in the profiles list. Returns -1 if the profile cannot be imported.

Description
Method; imports a profile from a file.

Example
The following example imports the profile contained in the profile.xml file and displays its index in the profiles list:

alert(fl.getDocumentDOM().importPublishProfile('file:///C|/Documents and

Settings/janeUser/Desktop/profile.xml'));

document.importPublishProfileString()

Availability
Flash CS4 Professional.

Usage

document.importPublishProfileString(xmlString)

Parameters

xmlString

A string that contains the XML data to be imported as the current profile.

Returns
A Boolean value of

true

if the string was successfully imported;

false

otherwise.

Description
Method: imports an XML string that represents a publish profile and sets it as the current profile. To generate an XML
string to import, use

document.exportPublishProfileString()

before using this method.

Example
In the following example, the default profile is exported as an XML string. The standard JavaScript

replace

command

is used to modify the XML string. The string is then imported, and the default ActionScript 3 output setting is set to
ActionScript 1.

This manual is related to the following products: