Document object

The following table lists the properties of the Document object, along with their data types, acceptable values and notes. Read-only properties are marked with a bullet (•). You can also use many API calls to work with documents. For more information, see Document functions.

Property Data type Notes
backgroundColor

string

A color string that specifies the document canvas color (for more information, see Color string data type).

backgroundURL

string

Sets a general URL for a document that uses a Hotspot. Everything that is not covered by the Hotspot has the background URL.

brushes •

array

Array of Brush objects that are available for use in the document (for more information, see Brush object).

currentFrameNum

zero-based index

The index of the current frame.

currentLayerNum

zero-based index

The index of the current layer.

defaultAltText

string

Default Alt text for the output images. It works for single and sliced images. Sliced images get the default, unless specific text is specified for a slice. Corresponds to the text that is specified in File > HTML Properties > ImageMap > AltImageDescription.

docTitleWithoutExtension

string

The title of the document file, without any file extension. If the document has not been saved, this string is empty.

exportFormatOptions

object

Identical to exportOptions. Included for backward compatibility with Fireworks 2.

exportOptions

object

ExportOptions object (for more information, see ExportOptions object).

exportSettings

object

ExportSettings object (for more information, see ExportSettings object).

filePathForRevert

string

The path to the file from which this document was opened, which is expressed as file://URL, or null if created from scratch.

filePathForSave

string

The location to which this document was saved, which is expressed as file://URL, or null if never saved.

fills •

array

Array of Fill objects that are available for use in the document (for more information, see Fill object).

frameCount

integer

The number of frames in the current document.

frameLoopingCount

integer

-1 -- don't repeat

0 -- repeat forever

> 0 -- repeat this number of times

frames •

array

Array of Frame objects in the document (for more information, see Frame object).

gammaPreview

Boolean

If set to true, the document should be previewed in opposite-platform gamma. If set to false, the document colors are unadjusted.

gradients •

array

Array of Gradient objects that are available for use in the document (for more information, see Gradient object).

gridColor

string

A color string that specifies the color of the grid display (for more information, see Color string data type).

gridOrigin

point

Used to set the origin of the grid. Corresponds to the point set when dragging the ruler origin from the upper-left of the document when rulers are visible.

gridSize

point

gridSize.x is the horizontal grid size; gridSize.y is the vertical grid size.

guides •

object

Guides object (for more information, see Guides object).

height

integer

Total height of the document, in pixels. To find the bottom edge of the document, use document.

top + document.height.

isDirty

Boolean

Set to true if the document was modified since the last ti me it was saved.

isPaintMode •

Boolean

Set to true if the document is currently in paint-mode editing, false otherwise.

isSymbolDocument

Boolean

Set to true if the document is a Symbol or Button document, false if it is an ordinary document. You might see this when looking through the list of open documents and one is a symbol-editing window.

isValid

Boolean

Set to true if the document is open in Fireworks; false otherwise. (Occasionally the JavaScript object that is associated with a document lingers after the document closes; this property lets you check for that eventuality.)

lastExportDirectory

string

The path to the last directory to which the file was exported, which is expressed as file://URL, or null if the file was never exported. For instance, if the document was last exported to "file:///files/current/logo.gif", it returns "file:///files/current".

lastExportFile

string

The name that was used the last time the file was exported, or null if the file was never exported. For instance, if the document was last exported to "file:///files/current/logo.gif", it returns "logo.gif".

layers

array

An array of Layer objects in the document (for more information, see Layer object).

left

integer

Coordinate of the left edge of the document, in pixels. To find the right edge of the document, use document.left + document.width.

mapType

string

Acceptable values are "client", "server", and "both". Corresponds to the image-map type selected in File > HTML Properties > ImageMap.

matteColor

string

A color string that corresponds to the matte color specified in the Optimize panel (for more information, see Color string data type). This string is used by the useMatteColor property.

onionSkinAfter

integer

Number of frames after the current frame to show through onion skinning. Corresponds to the onion-skin controls in the left edge of the Frames panel. A value of 0 indicates no onion skinning; a very large value (such as 99,999) indicates onion skinning of all frames after the current frame.

onionSkinBefore

integer

Similar to the onionSkinAfter property, but refers to the number of frames to show through onion skinning before the current frame.

patterns •

object

List of internal pattern names.

pathAttributes

object

PathAttrs object (for more information, see PathAttrs object). This object specifies default attributes that will be applied to all newly created objects.

pngText

object

A structure that can be used to store various chunks of text in a well-known format. For more information, see The pngText object.

resolution

float

Document resolution, in pixels per unit (for more information, see resolutionUnits). The range is 1 to 5000.

resolutionUnits

string

The units to be used with the resolution property. Acceptable values are "inch" and "cm".

savedSelections

object

Array of the saved bitmap selections in the active document.

textures

array

Array of Texture objects that are available for use in the document (for more information, see Texture object).

top

integer

Coordinate of the top edge of the document, in pixels. To find the bottom edge of the document, use document.top + document.height.

useMatteColor

Boolean

If set to true, the matteColor property is used when exporting documents with transparent backgrounds. If set to false, the matteColor property is ignored in this situation, and the exported file is matted against the document's canvas color.

width

integer

The width of the document, in pixels. To find the right edge of the document, use document.left + document.width.


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fireworks/8/fwextending/fw_02_16.htm