Adobe 65011817 - Fireworks CS4 - Mac Extended User Manual
Adobe 65011817 - Fireworks CS4 - Mac Extended User Manual

Adobe 65011817 - Fireworks CS4 - Mac Extended User Manual

Extending guide
Hide thumbs Also See for 65011817 - Fireworks CS4 - Mac:
Table of Contents

Advertisement

Quick Links

Extending
CS 4
ADOBE
FIREWORKS
®
®

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 65011817 - Fireworks CS4 - Mac and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Adobe 65011817 - Fireworks CS4 - Mac

  • Page 1 Extending CS 4 ADOBE FIREWORKS ® ®...
  • Page 2 This guide is licensed for use under the terms of the Creative Commons Attribution Non-Commercial 3.0 License. This License allows users to copy, distribute, and transmit the user guide for noncommercial purposes only so long as (1) proper attribution to Adobe is given as the owner of the user guide; and (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms.
  • Page 3: Table Of Contents

    Core objects ......................16 Adobe AIR Extension .
  • Page 4 Last updated 12/8/2009 EXTENDING FIREWORKS Contents Layer object ......................261 PathAttrs object .
  • Page 5: Chapter 1: Extending Fireworks Overview

    Chapter 1: Extending Fireworks Overview To extend Adobe® Fireworks® CS4, you must write JavaScript code. You can use JavaScript to write your own objects and commands that affect Fireworks documents and the elements within them. To accomplish these tasks, you must be proficient in JavaScript and in Fireworks.
  • Page 6: What's New In Extending Fireworks Cs4

    You can export designs as FXG files and use them in advanced design tools to develop rich Internet FXG export applications and experiences that can run on Adobe® Flash Player or Adobe® AIR™. You can package your Fireworks documents as Adobe AIR applications that you can secure using Adobe AIR export a digital signature.
  • Page 7 Class Property or Method Description AIRExt AIRext.PreviewDocument() Calls the ADL tool to preview an HTML document as an Adobe AIR application. AIRext.PackageApplication() Calls the ADT tool package an Adobe AIR application. AIRext.CreatePackage() Calls the ADT tool to create a signed AIR package.
  • Page 8 Last updated 12/8/2009 EXTENDING FIREWORKS Extending Fireworks Overview Class Property or Method Description SliceInfo backgroundHorizontalPosition Horizontal position of the background image. (Left, right, or center, numeric value) backgroundVerticalPosition Horizontal position of the background image. (Left, right, or center, numeric value) backgroundHorizontalPositionV Horizontal position value of the background image if the argument is value.
  • Page 9: Conventions Used In This Guide

    • The user refers to the person using Fireworks. • The visitor refers to the person who views the graphic that the user created. Additional resources for extension writers To communicate with other developers who are writing extensions, you can visit the Adobe online forums at www.adobe.com/support/forums/.
  • Page 10: Chapter 2: The Fireworks Object Model

    Chapter 2: The Fireworks Object Model If you want to extend the functionality of Adobe Fireworks CS4 by writing or modifying a JavaScript extensibility file, you must become familiar with the objects that Fireworks makes available through JavaScript. The hierarchy of these objects comprises the Fireworks Object Model, which contains the following major components: •...
  • Page 11 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model fw.documents[2].brushes[4].shape = "square"; The preceding example includes the following properties: • is a property of the Fireworks object and contains an array of Document objects. documents • is a property of the Document object and contains an array of Brush objects. brushes •...
  • Page 12: Using Fireworks Api Functions

    Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model Matrix data type The format for a matrix is matrix: [float, float, float, float, float, float, float, float, float]} This guide assumes that you know how to use these nine values to construct a three-by-three transformation matrix; discussion of the construction of transformation matrices is beyond the scope of this manual.
  • Page 13: Using The Common Api

    Using the common API You can use the common Adobe API if you want commands to use a common syntax (and thus run a single command in multiple applications). You can access this API using .The following methods are currently...
  • Page 14 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model • RectanglePrimitive • PathAttrs • Image To test whether a text block is selected, type the following code: firstSelection = fw.selection[0]; if (firstSelection == "[object Text]"){ alert("I am a text block"); You can use the information in the following sections to return or set property values.
  • Page 15 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model Working with specific properties for selected elements Some elements have specific properties that can be returned in addition to those that can be returned for any selected object (for more information, see “Working with properties for any selected object”...
  • Page 16 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model To return the number of objects in a selected group, type the following code: numOfObjectsinGroup = fw.selection[0].elements.length; Instance • symbolID • transformMode • instanceType • urlText • altText • targetText To return the for the currently selected instance, type the following code: instanceType instance = fw.selection[0].instanceType;...
  • Page 17: Global Methods

    Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model pathAttributes Several objects have the property. The following list is the valid set of pathAttributes pathAttributes properties that can be returned or set: • brushColor • fillColor • brush • fill •...
  • Page 18 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model confirm(message) Availability Fireworks 3. Usage confirm(message) Arguments A string containing the message to display. message Returns True if OK is clicked, false if Cancel is clicked. Description Displays a string in a modal alert box, along with OK and Cancel buttons. prompt(caption, text) Availability Fireworks 3.
  • Page 19 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model Arguments Strings containing content for output. arg1, arg2, ..., argN Returns An output file. Description Same as WRITE_HTML; WRITE_HTML was created to let you differentiate HTML output calls from other JavaScript calls in your code.
  • Page 20: Core Objects

    Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model fw.setUseAGMRenderingForSelection() Availability Fireworks 10. Usage fw. setUseAGMRenderingForSelection() Arguments None. Returns Nothing. Description Sets the currently selected vectors to use the new AGM Rendering. Example fw.getDocumentDOM().setUseAGMRenderingForSelection(true); Core objects This section describes the set of core objects that are always available: Errors, Files, Find, and System. The Document object is described within its own chapter: see “The Document object”...
  • Page 21 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model Method Data type Notes copy(docname1, docname2) string, string Copies the file specified in the first argument to the file specified in the second argument. Each argument must be the name of a file, which is expressed as file://URL. Only files (not directories) can be copied.
  • Page 22 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model Method Data type Notes The argument, if used, must be expressed as file://URL. Returns getTempFilePath ({dirname}) string a file URL in the Temporary Files directory or in the specified directory. This method does not create a file; it simply returns a unique file URL that does not conflict with existing files in the directory.
  • Page 23: Find Object

    Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model Method Data Type Notes close() none Closes the current File Reference object. You are not required to use this method (the file is closed when the Files object is destroyed), but it is useful for controlling access to a file. readline() none Reads the next line from the current File Reference object and...
  • Page 24 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model Property Data type Notes integer Number that represents the style to find: findStyle AnyStyle = -1 Plain = 0 Bold = 1 Italic = 2 BoldItalic = 3 Underline = 4 BoldUnderline = 5 ItalicUnderline = 6 BoldItalicUnderline = 7...
  • Page 25: Adobe Air Extension

    Returns the system color used for text (Windows-only property). string Returns the system color used for menu backgrounds menuColor (Windows-only property). string Returns the system color used for text in menus (Windows-only menuTextColor property). Adobe AIR Extension AIRext.PreviewDocument() Availability Fireworks 10.
  • Page 26 Description Calls the ADL tool to preview an HTML document as an Adobe AIR application. The path to file that needs to be previewed is not specified because it is included in the application descriptor; this path is relative to the site root.
  • Page 27 Path to the site root folder in which all files that needs to be included in package reside. siteFullPath Full path of the resulting Adobe AIR package. packagePath Array of paths to files and folders that need to be included in package; all paths need to be relative to the fileList site root.
  • Page 28 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model Password for the specified certificate. password Returns 0 if saved successfully. Description Saves the password for the given digital certificate, for the current session of Fireworks (no persistent storage). AIRext.GetDigSigPassword() Availability Fireworks 10.
  • Page 29 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model AIRext.GetAIRInstallPath() Availability Fireworks 10. Usage configurationPath = AIRext.GetAIRInstallPath(); Arguments None. Returns The full system path to the current user configuration folder (for example, "C:\Documents and settings\...\Configuration"). Description Returns the full system path name and path of the generated file. AIRext.GetJREVersion() Availability Fireworks 10.
  • Page 30 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Model Arguments Path to digital certificate file that will be created (required). certificatePath Password for the created certificate (required) password Encryption key type (either "1024-RSA" or "2048-RSA" (required). keyType Name of publisher (required). publisher Name of organization (optional).
  • Page 31: Chapter 3: The Document Object

    Last updated 12/8/2009 Chapter 3: The Document object This chapter describes the Fireworks Document object and functions. Document object properties 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 “Property inspector functions”...
  • Page 32 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Property Data type Notes frames • array Array of Frame objects in the document (for more information, “Frame object” on page 259). gammaPreview Boolean If set to , the document should be previewed in opposite- true platform gamma.
  • Page 33 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Property Data type Notes mapType string Acceptable values are , and "client" "server" "both" Corresponds to the image-map type selected in File > HTML Setup. matteColor string A color string that corresponds to the matte color specified in the Optimize panel (for more information, see “Color string data...
  • Page 34: Document Functions

    The software used to create the document. The current version of Fireworks always sets this value to Software “Adobe Fireworks CS4.” You can edit these fields or add your own fields, and they will be preserved across file saves. The pngText object corresponds directly to the chunk of the document’s PNG structure.
  • Page 35 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Example The following command adds a simple rollover behavior at the end of the selected slice or hotspot: fw.getDocumentDOM().addBehavior("MM_simpleRollover()", "onMouseOver", -1); See also “dom.removeBehavior()” on page 116 Using the dom.addBehavior() function The following code shows the syntax for dom.addBehavior() fw.getDocumentDOM().addBehavior(action, event, eventindex);...
  • Page 36 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments type, target, swapFrame, fileName, preload, downHighlight, downHighlightFrame, downHighlightFilename • Pass "over" type • target specifies the slice to which the behavior is attached. Pass – for this value; all other values are used internally by Fireworks.
  • Page 37 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object MM_nbGroup [out] Availability Fireworks 3. Arguments Pass "out" for type type Description Sets a navigation bar restore behavior. Example fw.getDocumentDOM().addBehavior("MM_nbGroup(\'out\')", "onMouseOut", -1); MM_simpleRollover Availability Fireworks 3. Arguments None. Description Adds a simple rollover behavior. Example fw.getDocumentDOM().addBehavior("MM_simpleRollover()", "onMouseOver", -1);...
  • Page 38 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments target, swapFrame, fileName, preload, restoreOnMouseOut • specifies the slice to which the behavior is attached. Pass – for this value; all other values are used internally target by Fireworks. • is an integer value that specifies the frame to swap, starting with (although, to use as a URL, swapFrame...
  • Page 39 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Adds a new empty mask to the selected element. If the selection already has an element mask, it is replaced with the new one. Only one element can be selected when calling this function. If selecting more than one element (or none) at the time this function is called, Fireworks throws an exception.
  • Page 40 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Acceptable values for . If , it guidekind guidekind "horizontal" "vertical" guidekind "horizontal" is assumed that is a y coordinate; if , it is an x coordinate. position "vertical" Returns Nothing. Description Adds a guide to the document.
  • Page 41 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Adds a new hotspot that fits into the specified bounding rectangle. Example The following command adds a new rectangle slice with the specified coordinates: fw.getDocumentDOM().addNewHotspot("slice","rectangle",{left:0, top:0, right:50, bottom:100}); dom.addNewImage() Availability Fireworks 3.
  • Page 42 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Adds a new image to the document containing the contents of the current paint-mode selection. The new image is placed directly above the active bitmap. You must have a current pixel selection for this to succeed. The new bitmap appears with Fireworks in paint mode.
  • Page 43 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Example The following command adds a new unshared layer with a default name that is generated by Fireworks: fw.getDocumentDOM().addNewLayer(null, false); dom.addNewLine() Availability Fireworks 3. Usage dom.addNewLine(startPoint, endPoint) Arguments Points that specify the x,y coordinates between which the path is added (see “Point data startPoint endPoint...
  • Page 44 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Example The following command adds a new oval within the specified coordinates: fw.getDocumentDOM().addNewOval({left:72, top:79, right:236, bottom:228}); dom.addNewPage() Availability Fireworks CS3. Usage dom.addNewPage() Arguments None Returns Nothing. Description Adds a new page to the current document. dom.addNewRectangle() Availability Fireworks 3.
  • Page 45 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object See also dom.addNewRectanglePrimitive() dom.addNewRectanglePrimitive() Availability Fireworks 4. Usage dom.addNewRectanglePrimitive(boundingRectangle, roundness) Arguments A rectangle that specifies the bounds within which the new rectangle primitive is added (see boundingRectangle “Rectangle data type” on page 8). A floating-point value between 0 and 1 that specifies the “roundness”...
  • Page 46 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments , and Points that specify the x,y coordinates of the preceding controlPointFirst mainpoint controlPointLast control point, the main point, and the following control point of the Bezier path (see “Point data type”...
  • Page 47 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object fw.getDocumentDOM().addNewStar(5, -1, true, {x:186, y:72}, {x:265, y:89}); dom.addNewSubLayer() Availability Fireworks CS3. Usage dom.addNewSubLayer(index, name, shared) Arguments A long value that specifies the index of the parent layer for the new sub layer. index A string that specifies the name for the new sub layer.
  • Page 48 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Adds a new symbol to the library and opens the symbol document for editing. Optionally adds an instance of the symbol to the document. Example The following command adds a new graphic symbol called to the library and places an instance of it in the text document:...
  • Page 49 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns if the swap image behavior was added; if no suitable hotspot was at the specified location. true false Description If a single hotspot or slice is selected, this function adds to it a swap image behavior from the hotspot or slice located in the document.
  • Page 50 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Increases (positive values) or decreases (negative values) the font size of selected text elements. If a text element has multiple font sizes, each size is adjusted independently. dom.align() Availability Fireworks 3. Align to canvas parameter is only available in Fireworks 8. Usage dom.align(alignmode, alignToCanvas) Arguments...
  • Page 51 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.appendPointToPath() Availability Fireworks 3. Usage dom.appendPointtoPath(ontourIndex, ptToInsertBefore, controlPointFirst, mainPoint, controlPointLast) Arguments An zero-based index value that specifies the contour to which the Bezier point is appended. For paths contourIndex with multiple contours, the contours are in an arbitrary order. A zero-based index value that specifies where on the path the new point should be placed.
  • Page 52 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.applyCharacterMarkup() Availability Fireworks 3, updated in Fireworks 4. Usage dom.applyCharacterMarkup(tag) Arguments Acceptable values for , and , for bold, italic, and underline: and , which was added "b" "i" "u" "fwplain" in Fireworks 4, for text with no character markup. Returns Nothing.
  • Page 53 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.ApplyEffects(effectList) Arguments An EffectList object (see “EffectList object” on page 247). If , this function removes effectList effectList null all effects from the selection. Returns Nothing. Description Applies the specified effects to the selection. Example The following command applies a drop shadow with an angle of 315, a blur of 4, a color of black, and a distance of 7 (see...
  • Page 54 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.applyStyle(styleName, styleIndex) Arguments A string that specifies the style name to be applied. The style group from which the style is being applied styleName should be selected. An index to the style to apply. This is usually zero. However, if there are multiple styles with the same styleIndex name, is used to resolve the ambiguity (0 references the first style with that name, 1 references the second,...
  • Page 55 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.attachTextInPath() Availability Fireworks CS4. Usage dom.attachtTextInPath() Arguments None. Returns Nothing. Description Attaches the selected text inside the selected path. If no text and path are selected, no action occurs. Example When two items are selected (one a text block and the other a shape), the following command attaches the text block inside the shape's path: fw.getDocumentDOM().attachTextInPath();...
  • Page 56 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.breakLink() Availability Fireworks 3. Usage dom.breakLink() Arguments None. Returns Nothing. Description Breaks the link between the symbol and the instance. dom.changeCurrentPage() Availability Fireworks CS3. Usage dom.changeCurrentPage(pageNum) Arguments An long value that specifies the page number of the page that will become the active page. pageNum Returns Nothing.
  • Page 57 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object A floating-point value that specifies the new position of the guide. newPosition Acceptable values for . If , it guidekind guidekind "horizontal" "vertical" guidekind "horizontal" is assumed that the specified positions are y coordinates; if guidekind is , it is assumed that the specified "vertical"...
  • Page 58 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.changeSliceGuide(currentPosition, newPosition, guidekind, isMagneticDrag, isSingleDrag) Arguments A floating-point value that specifies the current position of the slice guide to be moved. currentPosition A floating-point value that specifies the new position of the slice guide. newPosition Acceptable values are "...
  • Page 59 The following command copies the selected items to the clipboard: fw.getDocumentDOM().clipCopy(); dom.clipCopyAsPaths() Availability Fireworks MX. Usage dom.clipCopyAsPaths() Arguments None. Returns Nothing. Description Copies the selection to the clipboard in Adobe Illustrator format. Example The following command copies the selected items to the clipboard in Adobe Illustrator format: fw.getDocumentDOM().clipCopyAsPaths();...
  • Page 60 The Document object dom.clipCopyFormats() Availability Fireworks MX. Usage dom.clipCopyFormats(format) Arguments The graphics format for the selection. For example, is the Adobe Illustrator format. format "AICB" Returns Nothing. Description Copies the selection to the clipboard using the specified format. dom.clipCopyJsToExecute() Availability Fireworks 9.
  • Page 61 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Cuts the selection to the clipboard. Example The following command cuts the selected items and places them on the clipboard: fw.getDocumentDOM().clipCut(); dom.clipPaste() Availability Fireworks 3, updated in Fireworks 4. Usage dom.clipPaste({whatIfResolutionDifferent}, {whatIfPastingIntoElementMask}) Arguments...
  • Page 62 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.clipPasteAsMask(whatIfResolutionDifferent, masktype, maskReplaceOptions) Arguments A string that specifies how resampling should be done if the resolution of the whatIfResolutionDifferent clipboard contents doesn’t match the resolution of the document. Acceptable values for , and (displays a dialog box to let whatIfResolutionDifferent...
  • Page 63 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.clipPasteFromChannelToChannel() Availability Fireworks MX. Usage dom.clipPasteFromChannelToChannel(fromChannel, toChannel) Arguments If the current selection is not a single bitmap, a new opaque bitmap is created and the fromChannel fromChannel pasted in to all three color channels of the new bitmap, resulting in a grayscale image. This first argument is ignored if the current selection is not a single bitmap.
  • Page 64 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Pastes the clipboard contents into the selection, and places the selected element into the element mask for the pasted elements. If the selected element already has a mask, this function groups the pasted elements with the selected element and applies the existing element mask to the group.
  • Page 65 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments , and the document was changed since the last time it bPromptToSaveChanges bPromptToSaveChanges true was saved, the user is prompted to save any changes to the document. If , the user is bPromptToSaveChanges false not prompted, and changes to the document are discarded.
  • Page 66 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Converts marquee selection to path. dom.convertPathToMarquee() Availability Fireworks 7. Usage dom.convertPathToMarquee(mode, featherAmount) Arguments Sets the mode. Acceptable values are , and mode "hard edge" "antialias" "feather" Sets the amount of feathering for the marquee selection. This value is ignored if is not set to featherAmount mode...
  • Page 67 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Converts the selected items to a new animation symbol. See also dom.convertAnimSymbolToGraphicSymbol(), dom.convertToSymbol(), dom.setAnimInstanceNumFrames() dom.convertToPaths() Availability Fireworks 3. Usage dom.convertToPaths() Arguments None. Returns Nothing. Description Converts the selected text items into editable paths. Example The following command converts the selected text items into editable paths: fw.getDocumentDOM().convertToPaths();...
  • Page 68 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Converts the selected item(s) to a new symbol. Example The following command creates a graphic symbol from the selected item and names it “star”: fw.getDocumentDOM().convertToSymbol("graphic", "star"); See also dom.convertToAnimSymbol(), dom.convertAnimSymbolToGraphicSymbol() dom.convolveSelection() Availability Fireworks MX 2004.
  • Page 69 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.copyHtmlWizard() Availability Fireworks MX. Usage dom.copyHtmlWizard() Arguments None. Returns Nothing. Description Opens the Copy HTML Wizard dialog box. Example The following command opens the Copy HTML Wizard dialog box: fw.getDocumentDOM().copyHtmlWizard(); dom.copyToHotspot() Availability Fireworks 3.
  • Page 70 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Example The following command adds a hotspot to the selected item. If more than one item is selected, Fireworks creates one hotspot for each item. fw.getDocumentDOM().copyToHotspot("hotspot", "multiple"); dom.cropSelection() Availability Fireworks 3. Usage dom.cropSelection(boundingRectangle) Arguments A rectangle that specifies the bounds within which the selection should be cropped (see...
  • Page 71 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.deleteFrames(frameIndex, howMany) Arguments An integer value that specifies the location at which to begin deleting frames, starting with (although, frameIndex to specify the current frame, pass – Specifies how many frames to delete. howMany Returns Nothing.
  • Page 72 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments A long value that indicates the page number of the page to be deleted. pageNum Returns Nothing. Description Deletes a specified page from the current document. For example: fw.getDocumentDOM().deletePageAt(0) dom.deletePointOnPath() Availability Fireworks 4.
  • Page 73 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments The name of the saved bitmap selection. selection Returns Nothing. Description Deletes the selection or the pixel selection if Fireworks is in bitmap mode. Example If Fireworks is not in bitmap mode, the following command deletes the selected items. If Fireworks is in bitmap mode, the following command fills the selected items to transparent.
  • Page 74 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments The name of the symbol to delete from the library. If more than one symbol exists with this name, only symbolName the first symbol is deleted. • To delete all the selected symbols from the library (not document), pass null •...
  • Page 75 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Splits the selected text-on-a-path items into its original text and path items. dom.detachSharedLayer() Availability Fireworks CS3. Usage dom.detachSharedLayer(layerNum, pageNum) Arguments A long value that specifies the layer number for the layer that is to be detached. layerNum A long value that specifies the page number of the page from which the layer will be detached.
  • Page 76 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Distributes the selection along a vertical or horizontal dimension. dom.distributeLayerToFrames() Availability Fireworks 3. Usage dom.distributeLayerToFrames(layerIndex) Arguments An integer value that specifies the layer that contains the items to be distributed, starting with layerIndex (although, to specify the current layer, pass –...
  • Page 77 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.dragControlPoint(index, newLoc, shiftKeyDown, ctrlCmdKeyDown, altOptKeyDown) Arguments The index of the control point to move. index Specifies the new location of the point. newLoc Specifies whether the Shift key is pressed. shiftKeyDown Specifies whether the Control key (Windows) or Command key (Macintosh) is pressed.
  • Page 78 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.duplicateLayer() Availability Fireworks 3. Usage dom.duplicateLayer(layerIndex, {howMany}, {where}) Arguments An integer value that specifies the layer to duplicate, starting with (although, to specify the current layerIndex layer, pass – here). An optional integer that specifies how many times to duplicate the layer. If omitted, the layer is duplicated howMany once.
  • Page 79 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.duplicateSelection() Availability Fireworks 3. Usage dom.duplicateSelection() Arguments None. Returns Nothing. Description Makes a duplicate of the selection, offsetting it slightly from the original. Example The following command duplicates the selected items: fw.getDocumentDOM().duplicateSelection(); See also dom.cloneSelection() dom.duplicateSelectionToFrameRange()
  • Page 80 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.duplicateSelectionToFrames() Availability Fireworks 3. Usage dom.cuplicateSelectionToFrames(whichFrames) Arguments Acceptable values are , and . Note that means the last frame whichFrames "all" "previous" "next" "end" "end" of the document; it does not add a new frame. Returns Nothing.
  • Page 81 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments None. Returns Nothing. Description If any symbol instances are selected, this function makes duplicate symbols of all the symbols that are pointed to by those instances. The selected instances are updated to point to the new duplicate copies of the symbols. Duplicate symbols always result in nonlinked duplicates.
  • Page 82 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object An optional bitmap selection mask. If newSelectionMask is not , and newSelectionMask null , the selection will be set on the mask after entering paint mode. This selectAndEnterPaintModeIfPossible true argument is by default. null Returns Nothing.
  • Page 83 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Turns anti-aliasing on or off for the selected blocks of text. dom.enterPaintMode() Availability Fireworks 3, with the argument added in Fireworks MX. newSelectionMask Usage dom.enterPaintMode({newSelectionMask}) Arguments An optional bitmap selection mask. When is not , the selection is set newSelectionMask...
  • Page 84 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments Integer that specifies the number of levels back to exit symbol edit mode, especially when exiting Nested level Symbols. Returns Nothing. Description Exits the symbol edit mode through the number of levels specified. dom.exportElements() Availability Fireworks 10.
  • Page 85 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Replaces the values in with those in the specified GIF or ACT file. This dom.exportOptions.paletteEntries function also sets . For more information, see “ExportOptions dom.exportOptions.paletteMode "custom" object” on page 253. dom.exportOptions.saveColorPalette() Availability Fireworks 3.
  • Page 86 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.fillSelectedPixels() Availability Fireworks 3. Usage dom.fillSelectedPixels(clickPt, p1, p2, p3, bFillSelectionOnly, tolerance, edgemode, featherAmt) Arguments A point that specifies the x,y coordinates of the pixel to be filled or generated (see “Point data type”...
  • Page 87 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Applies the specified pixel filter to the selection. Items that are not images are converted into images before the filter is applied. Only external filters that are capable of also being Live Effects can be applied using this function. To apply other types of external filters, use dom.filterSelectionByName() Example...
  • Page 88 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object A string that specifies the name of the pixel filter to be applied. Acceptable values depend on which filters you name have installed. Returns Nothing. Description Applies the specified pixel filter to the selection as a permanent action, not as a Live Effect. (To apply filters that can also be Live Effects, you can use .) This function always displays a dialog box.
  • Page 89 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.flattenSelection() Availability Fireworks 3. Usage dom.flattenSelection() Arguments None. Returns Nothing. Description Flattens the selection into a single pixel image. This action is the same behavior as the Merge Images command. dom.getFontMarkup() Availability Fireworks 3.
  • Page 90 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns if the guides are locked; otherwise. True false Description Determines if the guides are locked. dom.getPageSetter() Availability Fireworks 9. Usage dom.getPageSetter() Arguments None. Returns The PageSetter object which helps in changing pages without refreshing. Description Gets the pageSetter object which helps in changing pages without refreshing.
  • Page 91 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.getPixelMask() Arguments None. Returns The mask for the current pixel selection. Returns if Fireworks is not in bitmap mode, or if there is no pixel null selection. For information on the format of mask variables, see “Mask data type”...
  • Page 92 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Determines whether the grid is visible. dom.getShowGuides() Availability Fireworks 8. Usage dom.getShowGuides() Arguments None. Returns if the guides are visible; otherwise. true false Description Determines if the guides are visible. dom.getShowRulers() Availability Fireworks 3.
  • Page 93 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments None. Returns if the Snap to Guides function is available; otherwise. true false Description Determines if the Snap to Guides function is available. dom.getSnapToGrid() Availability Fireworks 3. Usage dom.getSnapToGrid() Arguments None. Returns if the Snap to Grid function is active;...
  • Page 94 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.group() Availability Fireworks 3, argument deprecated in 4. Usage dom.group({type}) Arguments An optional string that specifies how to group the items. Acceptable values are type "normal" "mask to image" . If the argument is omitted, is assumed.
  • Page 95 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.hasMasterPage() Arguments None. Returns A Boolean value of if the current document has a master page, or if there is no master page. true false Description Indicates whether or not a master page exists for the specified document. For example: fw.getDocumentDOM().hasMasterPage() dom.hideSelection() Availability...
  • Page 96 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object , the file is scaled to the largest size that fits within bMaintainAspectRatio bMaintainAspectRatio true while retaining the file’s current aspect ratio. (This is a handy option for creating thumbnails.) boundingRectangle If it is , the file is scaled to fill false boundingRectangle...
  • Page 97 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments The fileURL of the file that contains the symbol to be copied. filepath The index of the symbol within the document, which is specified in the whichSymbol filepath Returns Nothing. Description Extracts the component elements from the selected symbol and places copies of those elements in the document.
  • Page 98 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object A zero-based index that specifies where the new point should be placed on the path. The new ptToInsertBefore point is appended in front of the point that this integer represents: To add a point to the beginning of the path, pass to add a point to the end of the path, pass a large number.
  • Page 99 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.insertSymbolAt(uiName, locationPoint) Arguments The name of the symbol in the library. If more than one symbol exists with the specified name, Fireworks uiName inserts the first symbol named. The center of the symbol expressed as x, y coordinates. locationPoint Returns Nothing.
  • Page 100 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Indicates whether or not the specified layer is a master page layer. For example: fw.getDocumentDOM().isMasterPageLayer(0) dom.isSelectionDirectlyAboveBitmapObject() Availability Fireworks MX. Usage dom.isSelectionDirectlyAboveBitmapObject() Arguments None. Returns A Boolean value: if the selected objects are directly above an image element; otherwise.
  • Page 101 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.knifeElementsFromPoint(from, tolerance) Arguments A point that specifies the x,y coordinates of the point that the user clicked (see “Point data type” on page 8). from A floating-point value > = 0 that specifies the tolerance within which items are cut. tolerance Returns A Boolean value:...
  • Page 102 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.linkElementMask(frame, layer, element, bLink) Arguments An integer value that specifies the frame that contains the element, starting with (although, to specify the frame current frame, pass – here). An integer value that specifies the layer that contains the element, starting with (although, to specify the layer current layer, pass –...
  • Page 103 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.lockSelection() Arguments None. Returns Nothing. Description Locks the selection. dom.makeFind() Availability Fireworks 3. Usage dom.MakeFind(findSpec) Arguments A Find object (see “Find object” on page 19). findSpec Returns A Find object. Description Creates an object of class Find to perform a search-and-replace operation in a document.
  • Page 104 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.mergeDown() Availability Fireworks MX. Usage dom.MergeDown() Arguments None. Returns Nothing. Description Merges selected objects to the bitmap directly below the selected objects. Succeeds only if the object immediately below the selection is a bitmap. For more information, see dom.isSelectionDirectlyAboveBitmapObject(). dom.modifyPointOnPath() Availability Fireworks 3.
  • Page 105 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.motionBlurSelection() Availability Fireworks MX 2004. Usage dom.motionBlurSelection(typeStr, angle, distance, samples) Arguments typeStr A string that specifies the type of blur to apply. Valid values are , and "linear" "radial" "zoom" An integer between 0 and 359 that specifies in degrees the direction of the blur, similar to the drop shadow angle effect angle.
  • Page 106 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Moves the specified point’s Bézier handles by a certain amount. dom.moveElementMaskBy() Availability Fireworks 4. Usage dom.moveElementMaskBy(delta) Arguments A point that specifies the x,y coordinate values by which the element masks are moved (see “Point data type”...
  • Page 107 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description If the selection has a fill that uses a fill vector (for example, a gradient fill), this function adjusts the handles of the fill vector. If the selection does not, this function has no effect. dom.moveMaskGroupContentsBy() Availability Fireworks 3.
  • Page 108 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Example The following command moves a horizontal top guide by 10 pixels. fw.getDocumentDOM().moveNineScaleGuide("horizontal-top",10); dom.movePixelMaskBy() Availability Fireworks 4. Usage dom.movePixelMaskBy(delta) Arguments A point that specifies the x,y coordinate values by which the bitmap mode selection is moved (see “Point data delta type”...
  • Page 109 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.movePointOnHotspotByWithFlags() Availability Fireworks MX. Usage dom.MovePointOnHotspotByWithFlags(ptToModifyIndex, delta, flags) Arguments A zero-based index that specifies which point on the path is to move. ptToModifyIndex A point that specifies the x-,y-coordinate values by which the point is moved (see “Point data type”...
  • Page 110 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.moveSelectionBy(delta, bMakeCopy, doSubSel) Arguments A point that specifies the x,y coordinate values by which the selection moved (see “Point data type” on page 8). delta For example, passing moves the selection 1 pixel to the right and 2 pixels down. The items that are copied instead of moved.
  • Page 111 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.moveSelectionTo(location, bMakeCopy, doSubSel) Arguments A point that specifies the x-,y-coordinate values of the location to which the selection is moved or copied location (see “Point data type” on page 8). Specifies copying instead of moving the selection. bMakeCopy is set to , the function moves only the subselected parts of a path.
  • Page 112 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.moveSelectionToLayer(layerIndex, bMakeCopy, {whatIfMultipleSelected}, {elementIndex}) Arguments An integer value that specifies the layer to which the selection should be moved or copied, starting with layerIndex 0 (although, to specify the current layer, pass –1 here). Boolean.
  • Page 113 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.pageName() Arguments None. Returns A string specifying the name of the current page. Description Indicates the name of the current page. For example: fw.getDocumentDOM().pageName dom.pathCrop() Availability Fireworks 3. Usage dom.pathCrop() Arguments None.
  • Page 114 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Performs an expand operation on the selected paths. dom.pathInset() Availability Fireworks 3. Usage dom.pathInset(width, miter, join) Arguments A floating-point value that specifies the new width of the selected paths, in pixels. width A floating-point value that specifies the new miter angle of the selected paths, in pixels.
  • Page 115 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.pathPunch() Availability Fireworks 3. Usage dom.pathPunch() Arguments None. Returns Nothing. Description Performs a punch operation on the selected paths. dom.pathSimplify() Availability Fireworks 3. Usage dom.pathSimplify(limit) Arguments is a floating-point value that specifies how much to simplify. This value corresponds to the value in the Modify limit >...
  • Page 116 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Performs a union operation on the selected paths. dom.placeTextInPath() Availability Fireworks 10. Usage dom.placeTextInPath() Arguments None. Returns Nothing. Description Places the selected text inside the selected path. If no text and path are selected, no action occurs. dom.previewInBrowser() Availability Fireworks MX.
  • Page 117 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.previewAllPagesInBrowser() Arguments Nothing. Returns Nothing. Description Previews the document in the primary browser. dom.rebuildColorTable() Availability Fireworks 3. Usage dom.rebuildColorTable() Arguments None. Returns Nothing. Description Rebuilds the color table for the current export settings of the document. This is the same behavior as choosing Rebuild Color Table from the Color Table panel.
  • Page 118 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Redefines the target style with the source style. Example The following command redefines the attributes of the target style “ " with the attributes of Chrome Reflective 016 the source style “ ”.
  • Page 119 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.redrawSmartShape() Availability Fireworks 8. Usage dom.redrawSmartShape() Arguments None. Returns Nothing. Description Forces the Auto Shapes in the document to redraw. This method is useful when modifying a Auto Shape outside a tool. dom.reflectSelection() Availability Fireworks 3.
  • Page 120 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments Acceptable values are guidekind "horizontal" "vertical" Returns Nothing. Description Removes all guides of the specified type. dom.removeBehavior() Availability Fireworks 3. Usage dom.removeBehavior({event}, {eventIndex}) Arguments An optional argument specifying the event that triggers the behavior. This argument is ignored by Fireworks. event An integer value that specifies the location of the behavior to be removed, starting with 0 (although, to eventIndex...
  • Page 121 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Sets the brush of the selection to None. dom.removeCharacterMarkup() Availability Fireworks 3. Usage dom.removeCharacterMarkup(tag) Arguments Acceptable values are , and , for bold, italic, and underline. "b" "i" "u" Returns Nothing. Description Reapplies the default value for the specified markup type to the text in the selection.
  • Page 122 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.removeFontMarkup(fontAttribute) Arguments Acceptable values are , and fontAttribute "size" "color" "face" Returns Nothing. Description Reapplies the default value for the specified font attribute to the text in the selection. dom.removeFill() Availability Fireworks 3.
  • Page 123 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Removes the specified guide. If no guide is at that position, this function has no effect. dom.removeNineScale() Availability Fireworks CS3 Usage dom.removeNineScale(status) Arguments None. Returns Nothing. Description Removes 9-slice scaling from the selected symbol. Example The following command removes 9-slice scaling from the selected symbol: fw.getDocumentDOM().removeNineScale();...
  • Page 124 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.reorderFrame(frameToMove, frameToPutItBefore, bMakeCopy) Arguments A zero-based index that specifies which frame to move or copy. frameToMove A zero-based index that specifies where to place the frame that is to be moved or copied. For frameToPutItBefore example, if you pass , the second frame is placed before the first...
  • Page 125 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.reorderPages() Availability Fireworks CS3. Usage dom.reorderPages(origPos, newPos) Arguments A long value that indicates the page number (position) of the page to be moved. origPos A long value that indicates the new position of the page within the document. newPos Returns Nothing.
  • Page 126 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.replaceButtonTextStringsInInstances() Availability Fireworks 3. Usage dom.replaceButtonTextStringsInInstances(newString, uniformAttrs) Arguments Specifies the string to be used as replacement text. newString Boolean. If , each character retains the attributes of the character that was formerly in its uniformAttrs false position;...
  • Page 127 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.resetNineScale() Availability Fireworks CS3 Usage dom.resetNineScale(status) Arguments None. Returns Nothing. Description Resets 9-slice scaling for the selected symbol back to default. Example The following command resets 9-slice scaling for the selected symbol: fw.getDocumentDOM().resetNineScale();...
  • Page 128 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments None. Returns Nothing. Description Restores the selection that is specified in dom.saveJPEGMask(). See also dom.saveJPEGMask() dom.restoreSelection() Availability Fireworks 4. Usage dom.restoreSelection(selectionName, fromDocument, {operation}, {invert}) Arguments User-specified name of the selection to restore. If selection name is not specified, the selection named selectionName will be restored.
  • Page 129 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.reversePathTextDirection() Arguments None. Returns Nothing. Description For all text-on-a-path items in the selection, it reverses the direction of the text along the path. dom.rotateDocument() Availability Fireworks 3. Usage dom.rotateDocument(rotationAmount) Arguments Acceptable values for are 90, 180, and 270.
  • Page 130 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Rotates the selection clockwise by the specified number of degrees. Rotating 270º is the same behavior as rotating 90º counterclockwise. dom.save() Availability Fireworks 3. Usage dom.save({bOkToSaveAs}) Arguments If this optional argument is or omitted and the file was never saved, then the Save As dialog box bOkToSaveAs true...
  • Page 131 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.saveJPEGMask() Arguments None. Returns Nothing. Description Stores the current selection in bitmap mode as the “Selective JPEG mask”. Use to restore dom.restoreJPEGMask() the JPEG mask. See also dom.restoreJPEGMask() dom.saveSelection() Availability Fireworks 4. Usage dom.saveSelection({selectionName}, {toDocument}, {operation}) Arguments...
  • Page 132 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.scaleSelection() Availability Fireworks 3. Usage dom.scaleSelection(xScaleAmount, yScaleAmount, opts) Arguments Float values that specify the amount to scale the selection in the horizontal and xScaleAmount yScaleAmount vertical axes. Acceptable values are 0.0 or greater; a value of 1 represents 100%, 2 represents 200%, and so on. Acceptable values are , and “...
  • Page 133 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.selectAdjustPixelSel() Availability Fireworks 3. Usage dom.selectAdjustPixelSel(whatToDo, amount) Arguments Acceptable values are , and whatToDo "expand" "contract" "border" "smooth" • Use to expand the pixel selection outward by the number of pixels that are specified by "expand"...
  • Page 134 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.selectAllOnLayer() Availability Fireworks MX. Usage dom.selectAllOnLayer(layerIndex, bRememberSelection, bToggleSelection) Arguments A long integer that identifies the layer on which to select the element. layerIndex A Boolean value. If , all the elements on the layer are appended to the current selection. bRememberSelection true A Boolean value.
  • Page 135 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.selectFeather() Availability Fireworks 3. Usage dom.selectFeather(featherAmount) Arguments An integer that specifies the number of pixels by which to feather the selection. featherAmount Returns Nothing. Description If Fireworks is in bitmap mode and a pixel selection is active, this function feathers the selection by the specified number of pixels.
  • Page 136 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Deselects any selected items. If Fireworks is in image edit mode, has a pixel selection, and has a Selection tool selected, then this function deselects the pixels and exits image edit mode. dom.selectParents() Availability Fireworks 3.
  • Page 137 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description If Fireworks is in bitmap mode and a pixel selection is active, this function selects all pixels in the current image that are within the specified tolerance of the average color in the current pixel selection. See also dom.selectSimilarFromPoint()) dom.selectSimilarFromPoint()
  • Page 138 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments A string, which is expressed as file://URL, denoting the location of a file to send by e-mail. fileAttachment Returns Nothing. Description Creates a new e-mail with the specified file as an attachment. Example The following example opens a new e-mail in the default e-mail program and attaches the file foo.png to the message: fw.getDocumentDOM().sendEmail("file:///Users/andy/Documents/foo.png");...
  • Page 139 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Sets the loop count of the selected instances of multi-frame image symbols. dom.setAnimInstanceNumFrames() Availability Fireworks 4. Usage dom.setAnimInstanceNumFrames(numFrames) Arguments An integer that specifies the number of frames through which the symbol animates. numFrames Returns Nothing.
  • Page 140 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setAnimInstanceRotationAmount() Availability Fireworks 4. Usage dom.setAnimInstanceRotationAmount(rotationAmount) Arguments A floating-point value that specifies the degree of rotation to be applied to the animation symbol. rotationAmount For example, passing specifies an animation that does two complete clockwise rotations. To rotate the animation counter-clockwise, pass a negative number.
  • Page 141 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setAnimInstanceStartEndOpacity() Availability Fireworks 4. Usage dom.setAnimInstanceStartEndOpacity(startOpacity, endOpacity) Arguments Float values between 0 and 100 that specify the starting and ending opacity of the startOpacity endOpacity animation symbol. Returns Nothing. Description Sets the starting and ending opacity of the currently selected animation symbol. See also dom.convertToAnimSymbol() dom.setAnimInstanceStartFrame()
  • Page 142 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments Acceptable values are mode "normal" "multiply" "screen" "darken" "lighten" "difference" "hue" , and "saturation" "color" "luminosity" "invert" "tint" "erase" Returns Nothing. Description Specifies the blend mode of the selection. dom.setBrush() Availability Fireworks 3.
  • Page 143 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object See also dom.setBrushNColorNTexture() dom.setBrushName() Availability Fireworks 3. Usage dom.setBrushName(category, currentName, newName) Arguments A string that specifies the category of the brush to be renamed. category A string that specifies the current name of the brush. currentName A string that specifies the new name of the brush.
  • Page 144 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.setBrushNColorNTexture(brush, color, texture-name) Arguments A Brush object (see “Brush object” on page 236). brush A color string (see “Color string data type” on page 7). color The name of the texture to be applied. texture-name Returns Nothing.
  • Page 145 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description If the user is editing a Button document, this function turns automatic slicing on or off. dom.setButtonIncludeDownState() Availability Fireworks 3. Usage dom.setButtonIncludeDownState(bIncludeDownState) Arguments Boolean. If , the Down state is included in the button; if , it is not.
  • Page 146 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.setButtonShowDownOnLoad(bShowDownOnLoad) Arguments Boolean. If , the Down-State-on-Load is shown in the button; if , it is not. bShowDownOnLoad true false Returns Nothing. Description If the user edits a Button document, this function specifies whether to show the Down-State-on-Load in a button. dom.setButtonOptions() Availability Fireworks 3.
  • Page 147 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments None. Returns Nothing. Description Resets the document’s brush and fill color to the default. dom.setDefaultFillVector() Availability Fireworks 3. Usage dom.setDefaultFillVector() Arguments None. Returns Nothing. Description Sets the fill-vector on the selection to the default. dom.setDocumentCanvasColor() Availability Fireworks 3.
  • Page 148 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object fw.getDocumentDOM().setDocumentCanvasColor("#0000ff"); dom.setDocumentCanvasSize() Availability Fireworks 3, with new argument added in Fireworks CS3. Usage dom.setDocumentCanvasSize(boundingRectangle, currentPageOnly) Arguments A rectangle that specifies the new canvas size for the document, in pixels (see “Rectangle data boundingRectangle type”...
  • Page 149 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Example The following command resizes the canvas to include all the items in the document, enlarging the canvas if necessary: fw.getDocumentDOM().setDocumentCanvasSizeToDocumentExtents(true); See also “dom.setDocumentCanvasSizeToSelection()” on page 145 dom.setDocumentCanvasSizeToSelection() Availability Fireworks 3. Usage dom.setDocumentCanvasSizeToSelection() Arguments None.
  • Page 150 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Scales the document to fit in the specified rectangle at the specified resolution. dom.setDocumentResolution() Availability Fireworks 3. Usage dom.setDocumentResolution(resolution) Arguments Specifies the resolution for the document (see “Resolution data type” on page 8). resolution Returns Nothing.
  • Page 151 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.setElementLocked(frameNum, layerNum, objectIndex, bLock, bAllLayers, bLockLayers) Arguments A zero-based integer that specifies the frame that contains the element or elements to be locked. To specify frameNum the current frame, pass -1. A zero-based integer that specifies the layer that contains the element or elements to be locked.
  • Page 152 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.setElementMaskMode(mode) Arguments Acceptable values are mode "mask to image" "mask to path" Returns Nothing. Description Sets the rendering mode on the selected element’s element mask. Only one element can be selected when calling this function.
  • Page 153 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Sets the name of the selected element(s). See also dom.findNamedElements() dom.setElementVisible() Availability Fireworks 4. Usage dom.setElementVisisble(frameIndex, layerIndex, elementIndex, bShow) Arguments An integer value that specifies the frame that contains the element(s) to be shown or hidden, starting frameIndex with (although, to specify the current frame, pass –...
  • Page 154 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments A string that specifies the name of the element(s) to be shown or hidden. If more than one element has the same name name, this function shows or hides all of them. Boolean.
  • Page 155 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Sets the document export settings. dom.setFill() Availability Fireworks 3. Usage dom.setFill(fill) Arguments A Fill object (see “Fill object” on page 258). fill Returns Nothing. Description Sets the selection to the specified fill. dom.setFillColor() Availability Fireworks 3.
  • Page 156 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments Acceptable values are , and edgemode "hard edge" "antialias" "feather" An integer that specifies the number of pixels to feather. This value is ignored if is not featherAmt edgemode "feather" Returns Nothing.
  • Page 157 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Sets the selection to the specified fill, fill color, and fill texture. Example The following command sets the selected items to a linear fill with a feather edge and no texture: fw.getDocumentDOM().setFillNColorNTexture({ category:"fc_Linear", ditherColors:[ "#000000", "#000000"...
  • Page 158 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setFillVectorStart() Availability Fireworks 3. Usage dom.setFillVectorStart(p1) Arguments A point that specifies the x,y coordinates of the fill start point (see “Point data type” on page 8). Returns Nothing. Description Modifies the fill vectors of the selection by moving the fill start to the specified point and then moving the two fill end handles to the same relative position.
  • Page 159 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments A point that specifies the x,y coordinates of the document’s grid origin (see “Point data type” on page 8). gridOrigin Returns Nothing. Description Sets the grid origin for the document. dom.setGridSize() Availability Fireworks 3.
  • Page 160 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setGroupType() Availability Fireworks 3, arguments deprecated in Fireworks 4. Usage dom.setGroupType({type}) Arguments An optional string that specifies how to group the items. Acceptable values are type "normal" "mask to image" . If the argument is omitted, is assumed.
  • Page 161 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.setHotspotAltTag(whatToSet, altTagString) Arguments Acceptable values are , and whatToSet "hotspots" "slices" "hotspots and slices" A string that specifies the text to be used for the alt tag. altTagString Returns Nothing. Description Sets the alt tag text to the specified value for the hotspots and slices in the selection.
  • Page 162 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.setHotspotRectangle(boundingRectangle, bMakeCopy) Arguments A rectangle that specifies the size of the new hotspot or slice (see “Rectangle data type” on boundingRectangle page 8). A Boolean value; if it is , the selection is copied and resized instead of moved and resized. bMakeCopy true Returns...
  • Page 163 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Sets the target tag text to the specified value for the hotspots and slices in the selection. Example The following command links the currently selected slices to the parent window: fw.getDocumentDOM().setHotspotTarget("slices", "_parent");...
  • Page 164 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setLayerDisclosure() Availability Fireworks 4. Usage dom.setLayerDisclosure(layerIndex, bDisclosed) Arguments An integer value that specifies the layer that contains the elements to be displayed or hidden, starting layerIndex with 0 (although, to specify the current layer, pass –1 here). Boolean.
  • Page 165 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Locks or unlocks one or all the layers on the specified frame. Example The following command locks all the layers on the first frame: fw.getDocumentDOM().setLayerLocked(1, 0, true, true); dom.setLayerName() Availability Fireworks 3. Usage dom.setLayerName(layerIndex, layerName) Arguments...
  • Page 166 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Changes the Shared layer status of a layer. Example The following command sets the selected layer to and displays a warning that data loss is possible: Shared fw.getDocumentDOM().setLayerSharing(-1, "shared", false, true); dom.setLayerVisible() Availability Fireworks 3.
  • Page 167 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Sets the specified page to be the document’s master page. For example: fw.getDocumentDOM().setMasterPage(0) dom.setMatteColor() Availability Fireworks 3. Usage dom.setMatteColor(bUseMatteColor, matteColor) Arguments Boolean. If , the document’s matte color is set to the value that is specified by .
  • Page 168 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Sets the color that is used to display 9-slice (nonslice) guides. dom.setPixelMask() Availability Fireworks 3, deprecated in 4 in favor of dom.setSelectionMask() Usage dom.setPixelMask(mask, howToCombineMasks) Arguments A mask variable that specifies the mask to be applied (see “Mask data type”...
  • Page 169 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Example The following command turns on onion skinning two frames before the selected frame and zero frames after it: fw.getDocumentDOM().setOnionSkinning(2, 0); dom.setOpacity() Availability Fireworks 3. Usage dom.setOpacity(opacity) Arguments A float variable between 0 and 100, inclusive. opacity Returns Nothing.
  • Page 170 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setQuadrangle() Availability Fireworks 3. Usage dom.setQuadrangle(pTopLeft, pTopRight, pBottomRight, pBottomLeft, options) Arguments Relative coordinates of a quadrangle expressed as pTopLeft, pTopRight, pBottomRight, pBottomLeft percentages of an arbitrary square. These are not specific x, y coordinates. Acceptable values are , and options...
  • Page 171 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object See also dom.addNewRectanglePrimitive(), dom.setRectSides() dom.setRectRoundnessMode() Availability Fireworks 4. Usage dom.setRectRoundnessMode(mode) Arguments String that specifies the mode of corner roundness of the rectangle as either a percentage value or or exact pixel mode value.
  • Page 172 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setSelectionBounds() Availability Fireworks 3. Usage dom.setSelectionBounds(boundingRectangle, opts) Arguments A rectangle that specifies the new location and size of the selection (see “Rectangle data type” boundingRectangle on page 8). Acceptable values are , and opts "transformAttributes"...
  • Page 173 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.setShowEdges(bShowEdges) Arguments Boolean. If , the Show Edges option is turned on; if , the option is turned off. bShowEdges true false Returns Nothing. Description Specifies whether the Show Edges option is on or off. dom.setShowGammaPreview() Availability Fireworks 3.
  • Page 174 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setShowGuides() Availability Fireworks 3. Usage dom.setShowGuides(bShow) Arguments Boolean. If , the normal guides are visible; if , the normal guides are not visible. bShow true false Returns Nothing. Description Specifies whether normal guides are visible. dom.setShowRulers() Availability Fireworks 3.
  • Page 175 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Specifies whether slice guides are visible. dom.setShowSliceOverlay() Availability Fireworks 3. Usage dom.setShowSliceOverlay(bShow) Arguments Boolean. If , the slice overlay is visible; if , slice overlay is not visible. bShow true false Returns...
  • Page 176 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.setSliceType(slicetype) Arguments Specifies the slice type as image (foreground image), background image, or empty (HTML Slice). slicetype Returns Nothing. Description Sets the slice type as image (foreground image), background image, or empty (HTML Slice). dom.setSliceExportOptions() Availability Fireworks 3.
  • Page 177 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setSliceGuideColor() Availability Fireworks 3. Usage dom.setSliceGuideColor(color) Arguments A color string (see “Color string data type” on page 7). color Returns Nothing. Description Sets the color that is used to display slice guides. To set the color of normal guides, use dom.setGuideColor() See also dom.setGuideColor()
  • Page 178 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments Boolean. If , sets the slices as HTML; if , sets the slices as Image. bHtml true false Returns Nothing. Description Sets the selected slices as HTML or Image. dom.setSnapToGrid() Availability Fireworks 3.
  • Page 179 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setSymbolProperties() Availability Fireworks 3; modified in Fireworks 9. Usage dom.setSymbolProperties(currentName, symbolType, newName, status) Arguments A string value that specifies the current name of the symbol in the library. If more than one master currentName exists with a name of , only the first master is changed.
  • Page 180 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.setTextAntiAliasing(level) Arguments Acceptable values are , and level "crisp" "smooth" "strong" Returns Nothing. Description Sets the anti-aliasing level for the selected blocks of text. See also dom.enableTextAntiAliasing() dom.setTextAutoKern() Availability Fireworks 3. Usage dom.setTextAutoKern(bKern) Arguments...
  • Page 181 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Description Adjusts the kerning of text. dom.setTextCustomAntiAliasOverSample() Availability Fireworks MX 2004. Usage dom.setTextCustomAntiAliasOverSample(overSample) Arguments The integer 4, 8 or 16 that specifies the amount of oversampling used to anti-alias text in custom mode. overSample Returns Nothing.
  • Page 182 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments An integer value, from 0 to 255, for the amount of anti-aliasing to apply. Strength Returns Nothing. Description Sets the strength value used to anti-alias text in custom mode. dom.setTextFlow() Availability Fireworks 3.
  • Page 183 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setTextLeading() Availability Fireworks MX. Usage dom.setTextLeading(leadingValue, leadingMode) Arguments A floating-point number that determines the spacing between two lines of text. The meaning of leadingValue depends on leadingValue leadingMode Acceptable values are “ “...
  • Page 184 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments A floating-point value that specifies the offset distance, in pixels. offset Returns Nothing. Description Sets the offset value between the items in the selected text-on-a-path. dom.setTextOrientation() Availability Fireworks 3. Usage dom.setTextOrientation(orientation) Arguments Acceptable values are orientation...
  • Page 185 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setTextParaSpacingAfter() Availability Fireworks MX. Usage dom.setTextParaSpacingAfter(paraSpaceAfter) Arguments The number of pixels to place after a paragraph before starting the next paragraph. paraSpaceAfter Returns Nothing. Description Sets the after-paragraph spacing for text; that is, the number of pixels to move down before starting the next paragraph. For vertical text mode, this function defines the vertical distance between paragraphs.
  • Page 186 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments A TextRuns object (see “TextRuns object” on page 268). textRuns Returns Nothing. Description Replaces the text in the selected text blocks with the styled text that is described by the TextRunsobject passed in the argument.
  • Page 187 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setTextRectangleAuto() Availability Fireworks 3. Usage dom.setTextRectangleAuto() Arguments None. Returns Nothing. Description Recalculates the bounding rectangle of the selected text item, setting the rectangle to the smallest box that encloses the text. See also dom.setTextRectangleAutoFromPoint() dom.setTextRectangleAutoFromPoint() Availability...
  • Page 188 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.setWebObjectsVisibility() Availability Fireworks CS3. Usage dom.setWebObjectsVisibility(value) Arguments A Boolean value that specifies the visibility of web objects. If the value is , the web objects are visible. If the value true value is the web objects are hidden.
  • Page 189 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Arguments None. Returns Nothing. Description Shows all the items that were hidden through dom.hideSelection() See also dom.hideSelection() dom.splitPaths() Availability Fireworks 3. Usage dom.splitPaths() Arguments None. Returns Nothing. Description Splits the selected paths. Compound paths are split into separate contours. dom.swapBrushAndFillColors() Availability Fireworks 3.
  • Page 190 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object dom.transformSelection() Availability Fireworks 3, updated in Fireworks 4. Usage dom.transformSelection(matrix, options) Arguments A three-by-three transformation matrix (see “Matrix data type” on page 8). matrix Acceptable values, some of which were added in Fireworks 4, are options "", "transformAttributes"...
  • Page 191 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Usage dom.undo() Arguments None. Returns Nothing. Description Undoes the most recent step performed, as long as that step is actually able to be undone; meaning, if you use a command that contains multiple JavaScript instructions, then you can undo the command (all 10 JavaScript instructions) and not just one JavaScript instruction within that command.
  • Page 192 Last updated 12/8/2009 EXTENDING FIREWORKS The Document object Returns Nothing. Description Ungroups any grouped items in the selection. To group items, use dom.group() See also dom.group() dom.unsetMasterPage() Availability Fireworks CS3. Usage dom.unsetMasterPage() Arguments None Returns Nothing. Description Resets the document’s master page. Makes the current master page into a normal page. For example: fw.getDocumentDOM().unsetMasterPage()
  • Page 193: Chapter 4: The Fireworks Object

    In the format: "MKBY" • string appMacJsfFileType In the format: "TEXT" appName • string The name of the application ( "Fireworks CS4" ). This attribute is part of the common API, so it also appears as app.appName (as implemented in Adobe Dreamweaver).
  • Page 194 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Property Data type Notes • string The path to the Patterns directory, which is expressed as appPatternsDir file://URL. string The path to the Preferences directory, which is expressed as a appPrefsDir file://URL. •...
  • Page 195 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Property Data type Notes • array Array of the current open Document objects (for more documents information, see “The Document object” on page 27). If no document is open, returns an array of length zero. ellipseBCPConst •...
  • Page 196: Fireworks Functions

    Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Property Data type Notes • integer Insertion index into the current active text object. If there is no textInsertionIndex text selected, returns a value of -1. • integer Insertion length into the current active text object. If there is no textInsertionLength text selected, returns a value of -1.
  • Page 197 "open" "select" "save" each is acceptable for compatibility with Adobe Dreamweaver. The third value displays a Save dialog box. title and previewArea Ignored by Fireworks but are accepted for compatibility with Dreamweaver. Returns The file URL selected by the user, or if the dialog box was canceled.
  • Page 198 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object fw.browseHelp() Availability Fireworks MX. Usage fw.browseHelp(helpID) Arguments The index number of the help topic to view. helpID Returns Nothing. Description Opens the specified help topic in the help viewer. fw.checkFwJsVersion() Availability Fireworks 3. Usage fw.checkFwJsVersion(version) Arguments...
  • Page 199 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Arguments A Boolean value that indicates which browser to select. If primaryBrowser is , Fireworks primaryBrowser true prompts the user to set the primary browser; if the argument is , Fireworks prompts the user to set the secondary false browser.
  • Page 200 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Returns Nothing. Description Closes the specified document. fw.createDocument() Availability Fireworks 3. Usage fw.createDocument(). Arguments None. Returns The Document object for the newly created document (see “The Document object” on page 27). Description Opens a new document and selects it.
  • Page 201 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object fw.createFireworksDocument() Availability Fireworks 3. Usage fw.createFireworksDocument(size, res, backgroundColor) Arguments A point whose x value specifies the document’s width and whose y value specifies the document’s height. Both size values are in pixels. Specifies the resolution for the scaled document (see “Resolution data type”...
  • Page 202 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object fw.dialogs.reloadCommonLibrary() Availability Fireworks 9. Usage fw.dialogs.reloadCommonLibrary() Arguments None. Returns Reloads the Common Library if you add a new widget, etc. You can reload the library from the JSF as well. fw.dialogs.runEditGrids() Availability Fireworks 3.
  • Page 203 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object fw.dialogs.runNumericTransform() Availability Fireworks 3. Usage fw.dialogs.runNumericTransform() Arguments None. Returns Opens the Numeric Transform dialog box. fw.disableFlashDebugging() Availability Fireworks MX Usage fw.disableFlashDebugging() Arguments None. Returns Nothing. Description Turns off debugging messages for Flash commands. For a description of the Flash debugging capabilities, see “fw.enableFlashDebugging()”...
  • Page 204 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Returns Nothing. Description Closes the Batch Progress dialog box automatically when the script finishes. This function has no effect if the Batch Progress dialog box does not appear. fw.enableFlashDebugging() Availability Fireworks MX Usage fw.enableFlashDebugging() Arguments...
  • Page 205 Specifies the filename for the exported file. If fileURL is , Fireworks displays the Export dialog box. fileURL null Returns A Boolean value: if successful; otherwise. true false Description Exports the specified document to the specified file as layers to be imported into Adobe Director.
  • Page 206 Returns A Boolean value: if successful; otherwise. true false Description Exports the specified document to the specified file as Adobe Director images. fw.exportDocumentAs() Availability Fireworks 3. Usage fw.exportDocumentAs(document, fileURL, exportOptions) Arguments A Document object, for example, , that specifies the document to be exported. If document fw.documents[2]...
  • Page 207 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object fw.exportFrames() Availability Fireworks 4. Usage fw.exportFrames(docObject, directoryURL) Arguments A Document object that specifies the document that contains the frames to export (see “The Document docObject object” on page 27). To export frames from the current document, pass null The directory where the images will be placed, which is expressed as a file://URL.
  • Page 208 Returns A Boolean value: if successful; otherwise. true false Description Exports the specified document to the specified file in Adobe Illustrator format. fw.exportLayers() Availability Fireworks 4. Usage fw.exportLayers(docObject, directoryURL) Arguments A Document object that specifies the document that contains the layers to export (see “The Document...
  • Page 209 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Returns A Boolean value: if successful; otherwise. true false Description Exports a document’s layers as individual images. The image names are based on the names in the Layers panel. The layers from the current frame are exported. Example The following command exports the layers in the third open document to the C:\images directory.
  • Page 210 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object fw.exportPDF() Availability Fireworks 10. Usage fw.exportPDF(doc, pdfURL) Arguments Document object (for example, ) that specifies the documentto be exported. To export frames fw.documents[2] from the current document, pass null. Specifies the filename for the exported file. If is null, Fireworks displays the Export dialog box.
  • Page 211 Exports a Fireworks document as a Adobe Flash document. Example The Adobe Flash writer is controlled by the values of several preferences. See the following example for allowed values. A well-behaved script should restore the original values after exporting the file.
  • Page 212 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object var prevMaintainObjEditable = fw.getPref("SwfMaintainObjEditable"); fw.setPref("SwfMaintainObjEditable", true); // maintain non-text editability //at expense of appearance or not var prevMaintainTextEditable = fw.getPref("SwfMaintainTextEditable"); fw.setPref("SwfMaintainTextEditable", false); // maintain text editability // at expense of appearance or not var prevExportAllFrames = fw.getPref("SwfExportAllFrames");...
  • Page 213 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Description Attempts to find the path to the requested application. On the Macintosh, Fireworks looks for the application using a four-character signature code. In Windows, Fireworks looks in the Windows registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths See also fw.launchApp()
  • Page 214 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Description Determines whether the specified file is open in a Fireworks Document window. fw.getBlue() Availability Fireworks MX. Usage fw.getBlue(color) Arguments RGB value of the color. color Returns The hex value of blue color in the selected object. Description Returns the hex value of blue color in the selected object.
  • Page 215 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Arguments A Document object, for example, that specifies the document whose path and document fw.documents[2], filename should be retrieved. If document is , information about the active document is retrieved. null Returns The file URL for the document if it was saved or an empty string if it has not been saved.
  • Page 216 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Note: Any panels not specified in the list of valid arguments (like those in the Command Panels folder which are “outside” the Fireworks application) should be named exactly as they appear in the file system without their file extension. For example, the valid argument name for the Align panel (Align.swf) is "Align", and a valid name for a custom panel file mypanel.swf would be "mypanel".
  • Page 217 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Note: Any panels not specified in the list of valid arguments (like those in the Command Panels folder which are “outside” the Fireworks application) should be named exactly as they appear in the file system without their file extension. For example, the valid argument name for the Align panel (Align.swf) is “Align”, and a valid name for a custom panel file mypanel.swf would be “mypanel”.
  • Page 218 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object fw.getHTMLFileForScript() Availability Fireworks MX. Usage fw.getHTMLFileForScript() Arguments None. Returns A file URL. Description Returns an HTML file. fw.getNumberOfTables() Availability Fireworks MX. Usage fw.getNumberOfTables(filename) Arguments The name of the file that contains the tables to be counted. filename Returns A long integer that represents the number of tables in the document.
  • Page 219 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Returns Platform name of the PostScript font. Description Returns the platform name of the PostScript font. fw.getPref() Availability Fireworks 3. Usage fw.getPref(prefkey) Arguments A string that specifies the Preference value to return. A complete list of these values is beyond the scope of prefkey this documentation, but the format of prefkey exactly matches that in the Fireworks Preferences file.
  • Page 220 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object fw.getStyleNameForPSFont() Availability Fireworks CS4. Usage fw.getStyleNameForPSFont(font) Arguments Name of the PostScript font. font Returns The style name of the specified PostScript font. Description Returns the style name of the PostScript font. fw.internalNameToUIName() Availability Fireworks MX2.
  • Page 221 Arguments The URL to open in the primary web browser. Returns Nothing. Example The following command starts a browser that opens to the Adobe website: fw.launchBrowserTo("http://www.Adobe.com"); Description Starts Fireworks’ primary web browser to open a URL. fw.locateDocDialog() Availability Fireworks 4.
  • Page 222 Value File type "ADOBE AI3" Adobe Illustrator "Fireworks JavaScript" Fireworks JSF Bitmap "kMoaCfFormat_BMP" "kMoaCfFormat_FreeHand7and8" Adobe FreeHand 7 or 8 "kMoaCfFormat_GIF" JPEG "kMoaCfFormat_JPEG" "kMoaCfFormat_PICT" Macintosh PICT "kMoaCfFormat_RTF" Rich text Plain text "kMoaCfFormat_Text" "kMoaCfFormat_TIFF"...
  • Page 223 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Returns RGB pixel value. Description Combines the individual hex values into a single RGB value. fw.moveFocusToDoc() Availability Fireworks 8. Usage fw.moveFocusToDoc() Arguments None. Returns Nothing. Description Moves the keyboard focus to the document window. fw.openDocument() Availability Fireworks 3, updated in Fireworks 4 and Fireworks 8.
  • Page 224 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Description Opens the specified files in new document windows. If a file is already open, it opens again; to avoid redundant open operations, call first. findOpenDocument() See also fw.findOpenDocument() fw.openMultiDocument() Availability Fireworks 6. Usage fw.openMultiDocument() Arguments...
  • Page 225 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Returns The specified color in format (for syntax details, see “Color string data type” on page 7). #rrggbbaa Description Opens the pop-up color swatches dialog box to let the user select a color. fw.popupColorPickerOverMouse() Availability Fireworks MX.
  • Page 226 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object fw.quitApplication() Availability Fireworks 3. Usage fw.quitApplication() Arguments None. Returns Nothing. Description Quits Fireworks, but prompts the user to save any changed documents before exiting. fw.readNthTable() Availability Fireworks MX. Usage fw.readNthTable(filename, tablenumber) Arguments A fileURL for the file that contains the desired table.
  • Page 227 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Returns Nothing. Description Reads in a panel state file, which is generated by fw.writePanelStateToFile(), and moves the panels, Property inspector, and toolbox to the appropriate locations. fw.reloadCommonLibrary() Availability Fireworks 9. Usage fw.reloadCommonLibrary() Arguments None.
  • Page 228 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object fw.replaceAll() Availability Fireworks 3. Usage fw.replaceAll() Arguments None. Returns The number of items replaced, or – if the search is not yet complete. Description Performs a replace all operation on the active document using the current search-and-replace strings. See also fw.setUpFindReplace() fw.resetWarnings()
  • Page 229 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Arguments A Document object, for example, , that specifies the document to be reverted. This document fw.documents[2] argument is optional. If document is omitted or , the active document is reverted. null Returns Nothing.
  • Page 230 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Description Saves all open documents, displaying the Save As dialog box for any documents that were not previously saved. fw.saveAs() Availability Fireworks 10. Usage fw.saveAs(doc, url, defaultfromoptions) Arguments The document object (for example, fw.documents[2]) that specifies the document to be saved. If document is null, the active document is saved.
  • Page 231 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object See also fw.exportDocumentAs() fw.saveDocumentAs() Availability Fireworks 3. Usage fw.saveDocumentAs(document) Arguments A Document object, for example, , that specifies the document to save. If document is document fw.documents[2] , the active document is saved. null Returns The file URL for the saved document, or...
  • Page 232 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object See also fw.exportDocumentAs() fw.saveJsCommand() Availability Fireworks 3. Usage fw.saveJsCommand(jscode, filename) Arguments The string of code to be saved as a JSF command file. jscode The name under which the file should be saved. filename Returns Nothing.
  • Page 233 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Usage fw.setActiveWindow(document, {trueFalse}) Arguments A Document object, for example, , that specifies which document should be made document fw.documents[2] active. This optional argument is ignored by Fireworks. It is included only for Dreamweaver compatibility. trueFalse Returns Nothing.
  • Page 234 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Example The following command moves the Stroke tab from its current location into the panel named Object. Although the panel name might be capitalized onscreen, it must be passed as lowercase. fw.setFloaterGrouping("stroke", "object"); fw.setFloaterPosition() Availability Fireworks 3.
  • Page 235 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Note: Any panels not specified in the list of valid arguments (such as those in the Command Panels folder, which are “outside” the Fireworks application) should be named exactly as they appear in the file system without their file extension. For example, the valid argument name for the Align panel (Align.swf) is "Align", and a valid name for a custom panel file mypanel.swf would be "mypanel".
  • Page 236 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Description Sets the value that is associated with the specified Preference key. See also “fw.getPref()” on page 215 fw.setUpFindReplace() Availability Fireworks 3. Usage fw.setUpFindReplace(findSpec) Arguments A Find object (see “Find object” on page 19). findSpec Returns Nothing.
  • Page 237 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Description Shows or hides the specified panel, or makes it topmost. • If the panel is hidden, this function shows it and makes it topmost. • If the panel is topmost, this function hides it. •...
  • Page 238 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object If bRecoverFromError is and the HTML update encounters an error, Fireworks displays a bRecoverFromError true Confirmation dialog box and attempts to recover. If it is , Fireworks fails without notifying the user if it false encounters an error.
  • Page 239 Last updated 12/8/2009 EXTENDING FIREWORKS The Fireworks Object Returns A Boolean value: if the user selected the Yes button; otherwise. true false Description Displays a dialog box that contains buttons labeled Yes and No. Example The following code displays a dialog box with Yes and No buttons and the message “Would you like to duplicate the element?”...
  • Page 240: Chapter 5: Objects Within Fireworks Documents

    Last updated 12/8/2009 Chapter 5: Objects within Fireworks documents This chapter describes the objects that can get or set the properties of elements in a Fireworks document. For syntax on accessing Fireworks documents and elements within them, see “Accessing a Fireworks document”...
  • Page 241 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes integer The lengths, in pixels, of dashes for a dotted line, these values dashOnSize1, dashOnSize2, dashOnSize3 control the first, second, and third dashes, respectively. integer 0 to 1000 diameter feedback string...
  • Page 242 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes float sense_random_size sense_speed_angle float sense_speed_blackness float float sense_speed_hue sense_speed_lightness float sense_speed_opacity float float sense_speed_saturation sense_speed_scatter float float sense_speed_size float sense_vdir_angle sense_vdir_blackness float float sense_vdir_hue float sense_vdir_lightness sense_vdir_opacity float float sense_vdir_saturation...
  • Page 243: Contour Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Contour object The following table lists the properties of the Contour object, along with their data types and, where appropriate, acceptable values and notes. Property Data type Notes isClosed Boolean If set to true , the path is closed by connecting the final point in the contour with the first point.
  • Page 244: Contournodedynamicinfo Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Method Parameter Definition RegisterMove() object The RegisterMoveParms object containing the move parameters. Use smartShape.GetDefaultMoveParms() obtain this object, then adjust properties as needed. For a list of properties, see “RegisterMoveParms object” on page 262. RegisterLinearMove() point A point, which in combination with the node point, defines the...
  • Page 245: Effect Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes Boolean , the tooltip drags with the mouse. toolTipTracksDrag true type string Determines the way the control point draws. Values are: "default" "defaultInverted" "crossHair" visible Boolean true , the control point is visible to the user.
  • Page 246 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Bevel object Property Data type Notes integer Specifies the blur, or feather amount, for the shadow and AngleSoftness highlight colors of the bevel. integer 0 to 100 percent BevelContrast BevelType integer Sets a bevel as inner, outer, raised embossed, inset embossed, or glow effect, as follows: InnerBevel = 0...
  • Page 247 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes string A color string that specifies the color of the outer bevel effect OuterBevelColor (for more information, see “Color string data type” on page 7). string A color string that specifies the color that is blended to provide ShadowColor the bevel shadow effect (for more information, see “Color...
  • Page 248 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Convert to Alpha object Property Data type Notes Boolean If set to , the effect is included but temporarily hidden. EffectIsVisible false The default value is true string "{2932d5a2-ca48-11d1-8561000502701850}" EffectMoaID Curves object Property Data type Notes...
  • Page 249 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Gaussian Blur object Property Data type Notes Boolean If set to , the effect is included but temporarily hidden. EffectIsVisible false The default value is true string EffectMoaID "{d04ef8c0-71b3-11d1-8c8200a024cdc039}" gaussian_blur_radius float 0.1 to 250 Hue/Saturation object Property...
  • Page 250 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Levels object Property Data type Notes string EffectMoaID "{d04ef8c1-71b4-11d1-8c8200a024cdc039}" EffectIsVisible Boolean If set to false , the effect is included but temporarily hidden. The default value is true integer These source* values are all input levels to the filter, with values source_low_rgb* of 0 to 255.
  • Page 251: Effectlist Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Sharpen More object Property Data type Notes string EffectMoaID "{1f2f2591-9db7-11d1-8cad00a024cdc039}" EffectIsVisible Boolean If set to false , the effect is included but temporarily hidden. The default value is true Unsharp Mask object Property Data type Notes...
  • Page 252 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes • float Read-only in the base class; other properties or API calls are height used to resize specific types of elements. Boolean Always false for an element. isLayer isSmartShape •...
  • Page 253 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes string Acceptable value is groupType "normal" "mask to image" "mask to path" were deprecated in Fireworks MX.) string The body of code in the JavaScript file that defines the Auto smartShapeCode Shape object.
  • Page 254 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes altText string The alternate text description. • string The type of element, for example , or instanceType "graphic" "button" "animation" • string An arbitrary string that uniquely identifies the symbol that symbolID owns this instance.
  • Page 255 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes • string An arbitrary string that uniquely identifies this slice. sliceID sliceKind string If set to "image" , generates an image; if set to "empty" generates the text specified by htmlText tdTagText string...
  • Page 256: Elementmask Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes object TextRuns object (for more information, see “TextRuns object” textRuns on page 268). point If the text has a textured brush or fill, specifies the offset of the textureOffset texture’s origin.
  • Page 257: Exportframeinfo Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes string Acceptable values are mode "mask to image" "mask to path" object The element (image, path, text, and so on) that owns the mask. owner showAttrs Boolean If set to true , and...
  • Page 258 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents – – use scaling xSize < 0, ySize = 0 xSize – – use scaling xSize < 0, ySize > 0 ySize – – use scaling xSize = 0, ySize < 0 ySize –...
  • Page 259: Exportpaletteinfo Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes string The default value is (an empty string). name "" numCustomEntries integer 0 to 256; default value is numEntriesRequested integer 0 to 256; default value is integer 0 to 256;...
  • Page 260: Exportsettings Object

    ) when the user exports a file. exportFilesStyle string Acceptable values are: "HTML and Images""Images Only""Dreamweaver LBI" "Director HTML""CSS Layers""Layers to Files""Frames to Files""Lotus Domino""Adobe Flash SWF" "Illustrator""Photoshop" string Defines the extension to append to the filename. fileExtension Boolean If set to...
  • Page 261 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes string Used to generate a name by concatenating six strings. If you sliceAutoNaming1 through sliceAutoNaming6 need fewer than six strings, fill in the remaining strings with "none" Acceptable values are: "none"...
  • Page 262: Fill Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes string Used to generate a name by concatenating two strings; the sliceFrameNaming1 sliceFrameNaming2 resulting string is concatenated to the name specified by . If you need fewer than two strings, fill in sliceAutoNaming the remaining string with "none"...
  • Page 263: Frame Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes string Acceptable values are stampingMode "blend" "blend opaque" textureBlend float 0 to 100 webDitherTransparent Boolean If set to true (and shape is set to "web dither" ), then the second color in the ditherColors array is ignored and...
  • Page 264: Gradient Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Gradient object The following table lists the properties of the Gradient object, along with their data types and, where appropriate, acceptable values and notes. Property Data type Notes name string The name that appears in the Fill panel. array Array of GradientNode objects (see “GradientNode...
  • Page 265: Layer Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Layer object The following table lists the properties of the Layer object, along with their data types and, where appropriate, acceptable values and notes. Read-only properties are marked with a bullet (•). Property Data type Notes...
  • Page 266: Pattern Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Pattern object The following table lists the property of the Pattern object, along with its data type and notes. Property Data type Notes name string The name that appears in the Fill panel. RectanglePrimitive object The following table lists the properties of the RectanglePrimitive object, along with their data types and, where appropriate, acceptable values and notes.
  • Page 267 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes Pass in the key that you want to use to constrain the x- string constrainXKey means that x will not be coordinate value. A value of "none" constrained.
  • Page 268 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes The ratio of mouse movement on the x-axis to the movement float deltaXtoY of the referenced point’s y coordinate. For example, means that when the mouse moves 1 pixel to the left, the referenced point moves 1 pixel towards the top of the document.
  • Page 269: Singletextrun Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes Boolean Determines whether the point itself should be moved as the movePt user moves the mouse. Boolean Determines whether the successor point should be moved as moveSucc the user moves the mouse.
  • Page 270: Style Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes Boolean Sets live preview. A value of enables live preview, and livePreview true disables wire-frame preview handled by Fireworks. Live preview is slower than wire-frame preview. If you want the user to set this value, write a function handling the DragControlPoint message from Fireworks (see “Fireworks messages”...
  • Page 271: Textattrs Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property (read-only) Data type Notes Boolean If set to , applies the property of the use_brushColor true brushColor PathAttrs object when applying the style. If set to false ignores the property. The default value is brushColor false use_effectList...
  • Page 272: Textruns Object

    Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes float Also known as pair kerning, specifies the percentage kerning kerning of an em square by which to separate two characters, in addition to the amount the font specifies. Applies to only one pair or characters.
  • Page 273 Last updated 12/8/2009 EXTENDING FIREWORKS Objects within Fireworks documents Property Data type Notes long A value that specifies the brush diameter for the path attributes element.pathattrs.brush.diam eter of the primitive (see “PathAttrs object” on page 261). string A color string that specifies the fill color for the path attributes element.pathattrs.fillColor of the primitive (see “Color string data...
  • Page 274: Chapter 6: Html Export Objects

    Last updated 12/8/2009 Chapter 6: HTML export objects Fireworks provides several object types that support the output of HTML and sliced images from Fireworks. These objects let you write JavaScript scripts that create templates to output the type of HTML that suits your specific requirement (generic HTML, Dreamweaver-compatible HTML, and so on).
  • Page 275 Last updated 12/8/2009 EXTENDING FIREWORKS HTML export objects Property (read-only) Data type Notes integer is set to 6 (Button Highlight), specifies the target dhTargetFrame action frame number for the down highlight state. Boolean is set to 6 (Button Highlight), specifies if there is an downHighlight action image highlight for the Down button state.
  • Page 276 Last updated 12/8/2009 EXTENDING FIREWORKS HTML export objects Property (read-only) Data type Notes integer is set to 9 (Popup Menu), specifies the cell padding menuItemPadding action for the menu items. integer is set to 9 (Popup Menu), specifies the spacing menuItemSpacing action between menu items in points.
  • Page 277: Behaviorslist Object

    Last updated 12/8/2009 EXTENDING FIREWORKS HTML export objects Property (read-only) Data type Notes string is set to 9 (Popup Menu), specifies the menu text textOverColor action color for the over state. integer is set to 9 (Popup Menu), specifies the point size for textSize action the menu text.
  • Page 278 Last updated 12/8/2009 EXTENDING FIREWORKS HTML export objects Property (read-only) Data type Notes string Specifies how the background image repeats as X, Y, Repeat backgroundRepeat (Both) and No Repeat. The background image URL, which is expressed as file:///URL. string backgroundURL bottomMargin long Specifies the bottom margin of the page.
  • Page 279 Last updated 12/8/2009 EXTENDING FIREWORKS HTML export objects Property (read-only) Data type Notes string File that the HTML is being written to, including the filename, htmlOutputPath which is expressed as file://URL; for example, "file:///C|/top/nav/navbar.htm" imagename string Name of the image that is being exported, without the extension;...
  • Page 280: Imagemap Object

    Last updated 12/8/2009 EXTENDING FIREWORKS HTML export objects ImageMap object The following table lists the properties and methods of the ImageMap object, along with their data types and, where appropriate, acceptable values and notes. All ImageMap object properties are read-only. Property (read-only) or Method Data type Notes...
  • Page 281: Sliceinfo Object

    Last updated 12/8/2009 EXTENDING FIREWORKS HTML export objects SliceInfo object The following table lists the properties and methods of the SliceInfo object, along with their data types and, where appropriate, acceptable values and notes. All SliceInfo object properties are read-only. Property (read-only) or method Data type Notes...
  • Page 282 Last updated 12/8/2009 EXTENDING FIREWORKS HTML export objects Property (read-only) or method Data type Notes string The URL link for this slice, which is expressed as href file://URL. string Text for a text-only slice. htmlText imagemap object ImagemapList object containing the image map information for this slice (see “ImagemapList object”...
  • Page 283: Slices Object

    Last updated 12/8/2009 EXTENDING FIREWORKS HTML export objects Slices object Slices is an object that has some properties and is also a two-dimensional array of SliceInfo objects (see “SliceInfo object” on page 277). For example, is the slice information for the first cell at row 0, column 0. The first Slices[0][0] array is rows;...
  • Page 284 Last updated 12/8/2009 EXTENDING FIREWORKS HTML export objects Property (read-only) Data type Notes string Relative URL to the shim GIF file; for example, shimPath "images/shim.gif" Boolean Specifies if the table is nested. tableNested width string Specifies the slice width.
  • Page 285: Chapter 7: Cross-Product Extensions

    Fireworks functionality. They may use JavaScript APIs for adding image-editing functionality to those applications as well as custom Fireworks panels developed in Adobe Flash to enhance the functionality of Fireworks. For example, a developer may want to create an ActionScript command so that a user can replace text in an image without leaving the current movie.
  • Page 286 Last updated 12/8/2009 EXTENDING FIREWORKS Cross-Product Extensions Fireworks RPC transactions pass XML between an RPC client and the Fireworks RPC server built in to Fireworks. The RPC client is any supported program that connects to Fireworks through a TCP stream on port 12124. The Fireworks RPC server is the internal code that listens on TCP port 12124 and then handles client requests.
  • Page 287 Last updated 12/8/2009 EXTENDING FIREWORKS Cross-Product Extensions • The operation sets the object properties. The operation can contain only the attributes and name exactly one parameter. The parameter must be the same data type as the data type of the property being set, or Fireworks will return an error.
  • Page 288 Last updated 12/8/2009 EXTENDING FIREWORKS Cross-Product Extensions Data node The data node is the most important type of XML node in RPC. Methods called through the operation need to func act on actual data or references to server objects identified in data nodes. The data nodes are used as parameters and parts of replies.
  • Page 289: Error Codes

    If the client is written in ActionScript or C++, then the client can use the generated client stubs provided by Adobe. Client stubs generated by Adobe know about all methods and properties of every class accessible through RPC.
  • Page 290 Generating stubs for nonstandard client types If the client is not written in one of the languages for which Adobe provides a client RPC library, the client implementer must create or generate the stubs. For information about how to do this, see “The Fireworks Object...
  • Page 291 Last updated 12/8/2009 EXTENDING FIREWORKS Cross-Product Extensions DOM data type RPC data type Example Description matrix dictionary A matrix is a dictionary that contains one <dict> subelement key: matrix . A matrix is an array of <array key="matrix"> nine float elements. The elements start at the top row and go in row-major order.
  • Page 292 290. These functions are defined in the supporting RPCMethods.as stubs file available for download from the Adobe website at www.adobe.com/go/fireworks_documentation. Note: ActionScript remote procedure calls for Fireworks are not ActionScript 1 compatible, and must be written in ActionScript 2.0 (using Flash MX 2004 or later).
  • Page 293 Last updated 12/8/2009 EXTENDING FIREWORKS Cross-Product Extensions Description Starts the auto-release block. RPCMethods.DestroyAutoReleasePool() Usage RPCMethods.DestroyAutoReleasePool() Arguments None. Returns Nothing. Description Ends the auto-release block and frees all allocated remote objects in the current auto-release block function. RPCMethods.AddToAutoReleasePool() Usage RPCMethods.AddToAutoReleasePool(proxyObject) Arguments The object to add to the current pool.
  • Page 294 Last updated 12/8/2009 EXTENDING FIREWORKS Cross-Product Extensions RPCMethods.ReleaseObject() Usage RPCMethods.ReleaseObject(Object) Arguments The name of the object to release from memory. Object Returns Nothing. Description Releases an object from memory. This function searches the specified object and all its properties for proxy objects. If proxy objects are found, they are released from memory.
  • Page 295 To build a Flash application that uses RPC to create a Fireworks object: Download the supporting ActionScript stub files (a series of supporting ActionScript files) from the Adobe website, you need to put them in your working directory (where the new FLA file will reside).
  • Page 296: Flash Panels

    Fireworks contains Adobe Flash Player, which plays Shockwave files as panels and commands in the Fireworks interface. You can also add a Adobe API wrapper extension to Adobe Flash for creating Shockwave files that communicate with the Fireworks API. By leveraging the new API communication between Adobe Flash and Fireworks, Fireworks extension developers can create command interfaces and dialog boxes that go beyond the dialog boxes supported in previous versions.
  • Page 297 Fireworks interface. Embedding API commands You can call any part of the Fireworks API by embedding the API commands in the following functions. These functions communicate directly with Adobe Flash Player, which is distributed with Fireworks. MMExecute() Usage...
  • Page 298 MMExecute() MMEndCommand() be used in conjunction with them. After it is installed, the API wrapper appears in the Adobe Flash interface. This wrapper simplifies the writing of Fireworks commands. Instead of having to embed every Fireworks function in , you can use a series of functions in the ActionScript.
  • Page 299 Last updated 12/8/2009 EXTENDING FIREWORKS Cross-Product Extensions • To improve the appearance and positioning of a modeless panel, turn off scaling and align the panel contents with the upper-left corner of the Stage. You can make these changes with the following ActionScript code: Stage.align = "TC";...
  • Page 300 Publishing When testing your script, use the File > Publish menu option in Adobe Flash. The Shockwave file is in the same place as the FLA file after publishing.
  • Page 301 Shockwave file passes to the Fireworks API during execution. Place these debug functions around the suspect code in your Adobe Flash ActionScript to turn the debugging functions on or off as needed. Be careful to use these functions only around “suspect” code; otherwise, you might encounter a long series of dialog box statements.
  • Page 302: Chapter 8: Auto Shapes

    Auto Shapes are vector objects that contain information about how the user can interact with them on the screen. Auto Shapes appear in the Adobe Fireworks user interface as “Auto Shapes” but are programmatically called smartShape objects in the JavaScript code that constructs them. For example, a spiral shape consists of relationships among several smaller objects.
  • Page 303 Last updated 12/8/2009 EXTENDING FIREWORKS Auto Shapes Defining the shape The following code creates the initial shape, a rectangle (a more concise way of creating an initial shape follows this example): function InsertSmartShapeAt() smartShape.elem.elements[0] = new Path; smartShape.elem.elements[0].contours[0] = new Contour; smartShape.elem.elements[0].contours[0].nodes[0] = new ContourNode;...
  • Page 304 Last updated 12/8/2009 EXTENDING FIREWORKS Auto Shapes You can then simplify the function with the new helper function: InsertSmartShapeAt() function InsertSmartShapeAt() var elem = smartShape.elem; var newPath = new Path; elem.elements[0] = newPath; newPath.contours[0] = new Contour; var contour = newPath.contours[0]; var i = 0;...
  • Page 305 Last updated 12/8/2009 EXTENDING FIREWORKS Auto Shapes Fireworks sends this message every time the mouse moves during a drag operation (as long as smartshape.getsDragEvents is set to ). For more information, see “SmartShape object” on page 265. true • "EndDragInsert" Fireworks sends this message on a event after a drag operation.
  • Page 306 Last updated 12/8/2009 EXTENDING FIREWORKS Auto Shapes Function Description Tells Fireworks what to do when the user clicks and holds the mouse button on a control point. BeginDragControlPoint() Fireworks can change the object as the user moves the mouse (for example, using the RegisterMove method of the SmartShape object;...
  • Page 307 Last updated 12/8/2009 EXTENDING FIREWORKS Auto Shapes switch(smartShape.operation) { case "BeginDragInsert": case "InsertSmartShapeAt": InsertSmartShapeAt(true); break; case "BeginDragControlPoint": BeginDragControlPoint(); break; case "DragControlPoint": DragControlPoint(); break; case "EndDragControlPoint": EndDragControlPoint(); break; case "SmartShapeEdited": PlaceControlPoints(); break; You don’t need a response for every message Fireworks sends; but you do need to make sure the statement switch handles the responses required by your shape.
  • Page 308: Chapter 9: Rich Symbols

    Symbol Properties panel. Beginning with Fireworks CS3, you can also export common library assets as known components for use in Adobe Flex™ Builder.™ The MXML export feature allows you to create a Flex application layout in Fireworks, leveraging Flex common library assets as MXML for loading into Flex Builder.
  • Page 309 Last updated 12/8/2009 EXTENDING FIREWORKS Rich symbols function setDefaultValues() var currValues = new Array(); //to build symbol properties currValues.push({name:"Selected", value:"true", type:"Boolean"}); Widget.elem.customData["currentValues"] = currValues; function applyCurrentValues() var currValues = Widget.elem.customData["currentValues"]; // Get symbol object name var Check = Widget.GetObjectByName("Check"); Check.visible = currValues[0].value; switch (Widget.opCode) case 1: setDefaultValues();...
  • Page 310 Last updated 12/8/2009 EXTENDING FIREWORKS Rich symbols Attributes Type element.left integer element.width integer element.height integer element.pixelRect rect(left,top,roght,bottom) element.visible boolean element.opacity integer element.blendmode string element.effectList object element.name string element.mask object element.pathattrs.burshColor color element.pathattrs.fillColor color element.pathattrs.brush object element.pathattrs.fill object element.pathattrs.brushTexture object element.pathattrs.fillTexture object element.pathattrs.fillHandle1 point...
  • Page 311 Last updated 12/8/2009 EXTENDING FIREWORKS Rich symbols Attributes Type element.pathattrs.fill.webDitherTransparent boolean element.pathattrs.fill.shape string element.pathattrs.fill.gradient object element.pathattrs.fill.pattern object element.pathattrs.fill.gradient.name string element.pathattrs.fill.gradient.nodes object element.pathattrs.fill.gradient.opacityNodes object element.pathattrs.fill.gradient.color color element.pathattrs.fill.gradient.position integer element.pathattrs.fill.gradient.isOpacityNode boolean element.pathattrs.fill.pattern.name string element.pathattrs.fill.pattern.image object element.pathattrs.brush.category string element.pathattrs.brush.name string element.pathattrs.brush.angle long element.pathattrs.brush.aspect integer element.pathattrs.brush.diameter long...
  • Page 312 Last updated 12/8/2009 EXTENDING FIREWORKS Rich symbols Attributes Type element.pathattrs.brush.tipSpacingMode string element.pathattrs.brush.tipColoringMode string element.pathattrs.brush.numDashes long element.pathattrs.brush.dashOnSize1 long element.pathattrs.brush.dashOffSize1 long element.pathattrs.brush.dashOnSize2 long element.pathattrs.brush.dashOffSize2 long element.pathattrs.brush.dashOnSize3 long element.pathattrs.brush.minSize integer element.pathattrs.brush.dashOffSize3 long element.pathattrs.mask.element object element.pathattrs.mask.owner object element.pathattrs.mask.linkled boolean element.pathattrs.mask.enabled boolean element.pathattrs.mask.mode string element.pathattrs.mask.showAttrs boolean element.pathattrs.mask.autoExpandImages boolean...
  • Page 313: Mxml Export

    The Flex application framework consists of MXML, ActionScript 3.0, and the Flex class library. Developers use MXML to declaratively define the application user interface elements and use ActionScript for client logic and procedural control. Developers write MXML and ActionScript source code using the Adobe Flex Builder™ IDE or a standard text editor.
  • Page 314 Last updated 12/8/2009 EXTENDING FIREWORKS Rich symbols Format flexClassName = "WhichClass"; When this property is present in a Fireworks element, the MXML and Images export process exports the element as a specific MXML tag and not as an image. Its value indicates the tag name of the MXML class generated. Example element.customData["flexClassName"] = "ComboBox";...
  • Page 315 Last updated 12/8/2009 EXTENDING FIREWORKS Rich symbols Example margin = {top:5, right:5, bottom:5, left:5}; padding Rectangle. Defines the area within the element that determines if another element can be seen as being a child of that element. If defined, any other element whose bounds are completely within the area marked by padding and arranged above the current element will be a child element within the resulting MXML.
  • Page 316 Last updated 12/8/2009 EXTENDING FIREWORKS Rich symbols attributeProperties Array. A list of property names that will become attributes in the exported MXML tag. By default, all rich symbol properties (defined as ) are considered attribute properties. By defining this list, you currentValues customValues can restrict which properties are used as attributes.
  • Page 317 Last updated 12/8/2009 EXTENDING FIREWORKS Rich symbols textOnly String. If defined, this represents the entire MXML output to be used for the export. If this is defined, no other properties need to be set within the definition. Any properties set are ignored. Example textOnly = "<mx:ColorPicker id=\"cp\"...
  • Page 318 Last updated 12/8/2009 EXTENDING FIREWORKS Rich symbols <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="660" height="440" layout="absolute" backgroundGradientColors="[#FFFFFF]" xmlns:ns="http://www.example.com/2007/mxml"> <mx:Style> Star { color:#FFFFFF; </mx:Style> <ns:Star x="146" y="120" width="157" height="138" name="star name" staticValue="static"/> </mx:Application> With the definition of , the element in Fireworks exports as a MXML tag.
  • Page 319: Chapter 10: Additional Fireworks Functions

    Chapter 10: Additional Fireworks Functions This chapter lists additional JavaScript functions supported by Adobe Fireworks that let you create useful Fireworks extensions and customized Fireworks menus. Almost any task that the user can accomplish in Fireworks with the menus, tools, or floating panels can be done programmatically using JavaScript.
  • Page 320 Last updated 12/8/2009 EXTENDING FIREWORKS Additional Fireworks Functions Description Makes the Property inspector window invisible. fw.isPIExpanded() Availability Fireworks MX. Usage fw.isPIExpanded() Arguments None. Returns A Boolean value: if expanded; otherwise. true false Description Determines whether the Property inspector window is currently expanded or minimized fw.isPIVisible() Availability Fireworks MX.
  • Page 321 Last updated 12/8/2009 EXTENDING FIREWORKS Additional Fireworks Functions Arguments None. Returns Nothing. Description Expands the Property inspector window. fw.shrinkPIWindow() Availability Fireworks MX. Usage fw.shrinkPIWindow() Arguments None. Returns Nothing. Description Minimizes the Property inspector window. fw.setPIPosition() Availability Fireworks MX. Usage fw.setPIPosition(pt) Arguments A point in screen coordinates.
  • Page 322: History Panel Functions

    Last updated 12/8/2009 EXTENDING FIREWORKS Additional Fireworks Functions fw.getPIPosition() Availability Fireworks MX. Usage fw.getPIPosition() Arguments None. Returns A point object that is formatted as , y: (see “Point data type” on page 8 for syntax details), which float float} contains the location of the Property inspector. Description Retrieves the location, in screen coordinates, of the upper-left corner of the Property inspector window.
  • Page 323 Last updated 12/8/2009 EXTENDING FIREWORKS Additional Fireworks Functions Usage fw.historyPalette.copySteps(array of indexes) Arguments A zero-based array that specifies which steps from the History panel should be copied. If it is array of indexes , the currently selected steps are used. null Returns Nothing.
  • Page 324 Last updated 12/8/2009 EXTENDING FIREWORKS Additional Fireworks Functions fw.historyPalette.getStepsAsJavaScript() Availability Fireworks 3. Usage fw.historyPalette.getStepsAsJavaScript(array of indexes) Arguments A zero-based array that specifies which steps from the History panel should be returned as array of indexes JavaScript. If the argument is , the currently selected steps are returned.
  • Page 325 Last updated 12/8/2009 EXTENDING FIREWORKS Additional Fireworks Functions fw.historyPalette.replaySteps() Availability Fireworks 3. Usage fw.historyPalette.replaySteps(array of indexes) Arguments A zero-based array that specifies which steps from the History panel should be returned as array of indexes JavaScript and executed. If the argument is , the currently selected steps are used.
  • Page 326: Static Document Functions

    Last updated 12/8/2009 EXTENDING FIREWORKS Additional Fireworks Functions fw.historyPalette.setSelection() Availability Fireworks 3. Usage fw.historyPalette.setSelection(array of indexes) Arguments Specifies which steps in the History panel are selected. Values are zero-based. For example, to array of indexes select the first, third, and sixth steps in the History panel, pass [ Returns Nothing.
  • Page 327 Last updated 12/8/2009 EXTENDING FIREWORKS Additional Fireworks Functions document.findExportFormatOptionsByName() Availability Fireworks 3. Usage document.findExportFormatOptionsByName(name) Arguments A string that specifies the name of the set of export settings to find. name Returns If there is a set of export settings with the specified name, the argument returns an object that represents it; otherwise, it returns null Description...
  • Page 328: Index

    Last updated 12/8/2009 Index appendPointToSlice() 47 clipCopyJsToExecute() 56 ActionScript 292 applyCharacterMarkup() 48 clipCut() 56 cross-product extensions 281 applyCurrentFill() 48 clipPaste() 57 addBehavior() 30, 31 applyEffects() 48 clipPasteAsMask() 57 addElementMask() 34 applyFontMarkup() 49 clipPasteAttributes() 58 addFrames() 35 applyStyle() 49 clipPasteFromChannelToChannel() 59 addGuide() 35 arrange() 50 clipPasteInside() 59...
  • Page 329 EXTENDING FIREWORKS Last updated 12/8/2009 Index dom.addNewLayer() 38 dom.convolveSelection() 64 data types dom.addNewLine() 39 dom.copyHtmlWizard() 65 color string 7 dom.addNewOval() 39 dom.copyToHotspot() 65 mask 7 dom.addNewRectangle() 40 dom.cropSelection() 66 matrix 8 dom.addNewRectanglePrimitive() 41 dom.deleteAllInDocument() 66 non-standard 7 dom.addNewSinglePointPath() 41 dom.deleteFrames() 66 point 8 dom.addNewStar() 42 dom.deleteLayer() 67...
  • Page 330 EXTENDING FIREWORKS Last updated 12/8/2009 Index dom.getParentLayerNum() 86 dom.moveSelectionToLayer() 107 dom.selectAll() 129 dom.getPixelMask() 86 dom.moveSelectionToNewLayer() 108 dom.selectAllOnLayer() 130 dom.getSelectionBounds() 87 dom.pageName() 108 dom.selectChildren() 130 dom.getShowGrid() 87 dom.pathCrop() 109 dom.selectFeather() 131 dom.getShowGuides() 88 dom.pathExpand() 109 dom.selectInverse() 131 dom.getShowRulers() 88 dom.pathInset() 110 dom.selectNone() 131 dom.getSnapToGrid() 89 dom.pathIntersect() 110...
  • Page 331 EXTENDING FIREWORKS Last updated 12/8/2009 Index dom.setExportOptions() 150 dom.setSliceGuideColor() 173 duplicateSelectionToFrameRange() 75 dom.setExportSettings() 150 dom.setSliceHtml() 173 duplicateSelectionToFrames() 76 dom.setFill() 151 dom.setSliceIsHtml() 173 duplicateSymbol() 76 dom.setFillColor() 151 dom.setSliceType() 171 duplicateSymbolForAlias() 76 dom.setFillEdgeMode() 151 dom.setSnapToGrid() 174 dom.setFillNColor() 152 dom.setSnapToGuides() 174 dom.setFillNColorNTexture() 152 dom.setSymbolProperties() 175 EAppAlreadyRunning 16 dom.setFillPlacement() 153...
  • Page 332 EXTENDING FIREWORKS Last updated 12/8/2009 Index ENotImplemented 16 finding and replacing fw.enableFlashDebugging() 200 ENotMyType 16 colors 21 fw.exportAndCopyHTMLCode() 200 enterPaintMode() 79 effects 21 fw.exportCSSLayers() 201 EOutOfMem 16 fills 21 fw.exportDirectorAsLayers() 201 EResourceNotFound 16 fonts and styles 19 fw.exportDirectorAsSlices() 202 error 285 strokes 21 fw.exportDocumentAs() 202 Errors object (core object) 16...
  • Page 333 EXTENDING FIREWORKS Last updated 12/8/2009 Index fw.locateDocDialog() 217 getFloaterGroupings() 211 historyPalette.getUndoState() 320 fw.makeRGBColor() 218 getFloaterPosition() 212 historyPalette.replaySteps() 321 fw.moveFocusToDoc() 219 getFloaterVisibility() 212 historyPalette.saveAsCommand() 321 fw.openDocument() 219 getFontMarkup() 85 historyPalette.setSelection() 322 fw.openMultiDocument() 220 getGreen() 213 historyPalette.setUndoState() 322 fw.popupColorPicker() 220 getHideAllFloaters() 213 Hotspot object 250 fw.popupColorPickerOverMouse() 221 getHTMLFileForScript() 214...
  • Page 334 EXTENDING FIREWORKS Last updated 12/8/2009 Index moveSelectionTo() 106 SingleTextRun 265 knifeElementsFromPoint() 96 moveSelectionToFrame() 107 SliceHotspot 250 knifeElementsFromPoints() 97 moveSelectionToLayer() 107 SliceInfo 277 moveSelectionToNewLayer() 108 Slices 279 Style 266 launchApp() 216 Text 251 launchBrowserTo() 217 new features 2 TextAttrs 267 Layer object 261 null values 8 TextRuns 268 layerIndex argument 8...
  • Page 335 EXTENDING FIREWORKS Last updated 12/8/2009 Index resolution data type 8 setAnimInstanceLoopCount() 134 quit() 221 restoreJPEGMask() 123 setAnimInstanceNumFrames() 135 quitApplication() 222 restoreSelection() 124 setAnimInstanceOffsetDist() 135 reversePathTextDirection() 124 setAnimInstanceRotationAmount() 136 revertDocument() 224 setAnimInstanceScaleAmount() 136 readNthTable() 222 rotateDocument() 125 setAnimInstanceStartEndOpacity() 137 readPanelStateFromFile() 222 rotateSelection() 125 setAnimInstanceStartFrame() 137 rebuildColorTable() 113...
  • Page 336 EXTENDING FIREWORKS Last updated 12/8/2009 Index setFloaterPosition() 230 setSnapToGrid() 174 SWF, exporting as 207 setFloaterVisibility() 9, 230 setSnapToGuides() 174 syntax conventions 30 setGradientName() 154 setSymbolProperties() 175 setGridColor() 155 setTextAlignment() 175 setGridOrigin() 154 setTextAntiAliasing() 175 templates 270 setGridSize() 155 setTextAutoKern() 176 Text object 251 setGroupType() 156 setTextCharSpacing() 176...

This manual is also suitable for:

Fireworks cs4

Table of Contents