Summary of DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER

  • Page 1

    Extending fireworks.

  • Page 2

    Trademarks afterburner, appletace, attain, attain enterprise learning system, attain essentials, attain objects for dreamweaver, authorware, authorware attain, authorware interactive studio, authorware star, authorware synergy, backstage, backstage designer, backstage desktop studio, backstage enter...

  • Page 3: Contents

    3 contents chapter 1: extending fireworks overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 installing an extension. . . . . . . . . . . . . . . . . . . . ...

  • Page 4

    4 contents.

  • Page 5: Chapter 1

    5 chapter 1 extending fireworks overview to extend macromedia fireworks mx 2004, 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...

  • Page 6

    6 chapter 1: extending fireworks overview installing an extension as you start learning the process of writing extensions, you might want to explore the extensions and resources already available through the macromedia exchange website (www.Macromedia.Com/exchange) . By installing an existing extens...

  • Page 7

    Additional resources for extension writers 7 conventions used in this guide the following typographical conventions are used in this guide: • code font indicates code fragments and api literals, including class names, method names, function names, type names, scripts, sql statements, and html and xm...

  • Page 8

    8 chapter 1: extending fireworks overview.

  • Page 9: Chapter 2

    9 chapter 2 the fireworks object model if you want to extend the functionality of macromedia fireworks mx 2004 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 makes up...

  • Page 10

    10 chapter 2: the fireworks object model accessing a fireworks document all the functions listed in “document functions” on page 104 are methods of the document object, which represents a fireworks document. To perform a function on a document object, you must first get the document object model (do...

  • Page 11

    Using the fireworks object model 11 formatting nonstandard data types in addition to the standard data types that can be passed to functions as arguments, or used as properties, such as integer, string, and so on, fireworks accepts other data types. • some functions accept values that are fireworks ...

  • Page 12

    12 chapter 2: the fireworks object model resolution data type the format for resolution is {pixelsperunit: float, units: string} . Acceptable values for units are " inch " or " cm ". For instance, dom.Setdocumentresolution (resolution) could look like the following example: fw.Getdocumentdom().Setdo...

  • Page 13

    Core objects 13 document object the following table lists the properties of the document object, along with their data types, acceptable values and notes. Read-only properties are marked with a bullet (•). You can also use many api calls to work with documents. For more information, see “document fu...

  • Page 14

    14 chapter 2: the fireworks object model frameloopingcount integer –1 — don’t repeat 0 — repeat forever > 0 — repeat this number of times frames • array array of frame objects in the document (see “frame object” on page 52 ). Gammapreview boolean if set to true , the document should be previewed in ...

  • Page 15

    Core objects 15 lastexportdirectory string the path to the last directory to which the file was exported, which is expressed as file:// url, or null if the file was never exported. For instance, if the document was last exported to " file:///files/current/ logo.Gif" , it returns "file:///files/ curr...

  • Page 16

    16 chapter 2: the fireworks object model the pngtext object fireworks maintains the following fields for use with the pngtext object: you can edit these or add your own fields, and they will be preserved across file saves. The pngtext object corresponds directly to the 'text' chunk of the document’s...

  • Page 17

    Core objects 17 here is an alphabetical list of the properties of the errors object: eappalreadyrunning, eappnotserialized, earrayindexoutofbounds, ebadfilecontents, ebadjsversion, ebadnesting, ebadparam, ebadparamtype, ebadselection, ebuffertoosmall, echarconversionfailed, edatabaseerror, edeleting...

  • Page 18

    18 chapter 2: the fireworks object model deletefileifexisting (docordir) string deletes the specified file or directory. Returns true if successful; false if the file or directory cannot be deleted. Unlike deletefile() , this method returns true if the file or directory does not exist. Enumfiles(doc...

  • Page 19

    Core objects 19 makepathfromdirandfile(dirname, plainfilename) string, string the first argument must be expressed as file:/ /url. Concatenates the two arguments to return a file url that references the specified filename in the specified directory. For example, files.Makepathfromdirandfile("file://...

  • Page 20

    20 chapter 2: the fireworks object model find object there are several ways to specify a find object, depending on what you want to find and replace. Use the whattofind property to specify the type of find operation, along with the properties that are associated with each legal value for whattofind ...

  • Page 21

    Core objects 21 finding and replacing colors, fills, strokes, and effects finding and replacing urls finding and replacing non-websafe colors with the closest websafe color property data type notes whattofind string in the format: "color" find string a color string that specifies the color to find (...

  • Page 22

    22 chapter 2: the fireworks object model the fireworks object the fireworks object is a global object, which you can use to set or retrieve properties that relate to the current operating environment. (the app object that was used in fireworks 3 is supported for backward compatibility, but its use i...

  • Page 23

    The fireworks object 23 appname • string the name of the application ( "fireworks mx 2004" ). This attribute is part of the common api, so it also appears as app.Appname (as implemented in macromedia dreamweaver). Apppatternsdir • string the path to the patterns directory, which is expressed as file...

  • Page 24

    24 chapter 2: the fireworks object model currentscriptdir string the path to the directory of the currently running script, which is expressed as a file:// url (or could be null ). This path goes to the directory in which the script resides, not a full file path to the script itself (it excludes the...

  • Page 25

    The fireworks object 25 selection array array of the selected objects in the active document. If nothing is selected, it returns an array of length zero. If no document is open, it returns null . Selectedmask object if a single item is selected and that item is a mask, this property returns an eleme...

  • Page 26

    26 chapter 2: the fireworks object model objects within fireworks documents this section 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” on page 10...

  • Page 27

    Objects within fireworks documents 27 diameter integer 0 to 1000 feedback string acceptable values are "none" , "brush" , and "background" . Flowrate float 0 to 100 maxcount integer 0 to 64 minsize float 0 to 100 name string the name of the brush, which is visible in the stroke panel. Numdashes inte...

  • Page 28

    28 chapter 2: the fireworks object model sense_random_size float sense_speed_angle float sense_speed_blackness float sense_speed_hue float sense_speed_lightness float sense_speed_opacity float sense_speed_saturation float sense_speed_scatter float sense_speed_size float sense_vdir_angle float sense_...

  • Page 29

    Objects within fireworks documents 29 contour object the following table lists the properties of the contour object, along with their data types and, where appropriate, acceptable values and notes. Contournode object the following table lists the properties of the contournode object, along with thei...

  • Page 30

    30 chapter 2: the fireworks object model the following table lists the methods of the contournode object, along with their parameters. Succy float the y coordinate of the contour node’s following control point. X float the x coordinate of the contour node’s main control point. Y float the y coordina...

  • Page 31

    Objects within fireworks documents 31 contournodedynamicinfo object the following table lists the properties of the contournodedynamicinfo object, along with their data types and, where appropriate, acceptable values and notes. Controlpoint object the following table lists the properties of the cont...

  • Page 32

    32 chapter 2: the fireworks object model effect object each fireworks effect (bevel, drop shadow, etc.) has a unique set of attributes. So, each effect object has its own set of properties that can be set (instead of a common set of properties for all effect objects). The properties for various effe...

  • Page 33

    Objects within fireworks documents 33 beveltype integer sets a bevel as inner, outer, raised embossed, inset embossed, or glow effect, as follows: innerbevel = 0 outerbevel = 1 raiseemboss = 2 insetemboss = 3 gloweffect = 4 bevelwidth integer the width of the bevel, in pixels. Buttonstate integer be...

  • Page 34

    34 chapter 2: the fireworks object model blur object blur more object brightness/contrast object masksoftness integer the feather amount on the glow edge, in pixels. Outerbevelcolor string a color string that specifies the color of the outer bevel effect (see “color string data type” on page 11 ). S...

  • Page 35

    Objects within fireworks documents 35 convert to alpha object curves object drop shadow object effectisvisible boolean if set to false , the effect is included but temporarily hidden. The default value is true . Effectmoaid string "{3439b08c-1921-11d3-9bde00e02910d580}" property data type notes effe...

  • Page 36

    36 chapter 2: the fireworks object model find edges object gaussian blur object hue/saturation object inner shadow object property data type notes effectisvisible boolean if set to false , the effect is included but temporarily hidden. The default value is true . Effectmoaid string "{fc7093f1-f95c-1...

  • Page 37

    Objects within fireworks documents 37 invert object levels object shadowdistance integer the offset of the shadow, in pixels. Shadowtype integer 0 = normal shadow 1 = knockout shadow property data type notes effectmoaid string "{d2541291-70d6-11d1-8c8000a024cdc039}" effectisvisible boolean if set to...

  • Page 38

    38 chapter 2: the fireworks object model sharpen object sharpen more object unsharp mask object effectlist object the following table lists the properties of the effectlist object, along with their data types and, where appropriate, acceptable values and notes. Gamma_rgb float these gamma* values ar...

  • Page 39

    Objects within fireworks documents 39 element object element is an abstract or base class; nothing of class element ever exists. However, it is useful for simplifying the other class descriptions. Read-only properties are marked with a bullet (•). Property data type notes blendmode string acceptable...

  • Page 40

    40 chapter 2: the fireworks object model the following table lists the methods of the element object, along with their parameters. Group object group is a subclass of the base class element and contains the following properties in addition to those in element (see “element object” on page 39 ). The ...

  • Page 41

    Objects within fireworks documents 41 image object image is a subclass of the base class element (see “element object” on page 39 ). It contains no properties or methods other than those in element. Instance object instance is a subclass of the base class element and contains the following propertie...

  • Page 42

    42 chapter 2: the fireworks object model hotspot object a hotspot converts to an image map during html export. Hotspot is a subclass of the base class element and contains the following properties in addition to those in element (see “element object” on page 39 ). Slicehotspot object a slice hotspot...

  • Page 43

    Objects within fireworks documents 43 path object path is a subclass of the base class element and contains the following properties in addition to those in element (see “element object” on page 39 ). Text object text is a subclass of the base class element and contains the following properties in a...

  • Page 44

    44 chapter 2: the fireworks object model texture object texture is a subclass of the base class element and contains the following read-only property in addition to those in element (see “element object” on page 39 ). Orientation string acceptable values are "horizontal left to right" (the default),...

  • Page 45

    Objects within fireworks documents 45 elementmask object the following table lists the properties of the elementmask object, along with their data types and, where appropriate, acceptable values and notes. Exportframeinfo object the following table lists the properties of the exportframeinfo object,...

  • Page 46

    46 chapter 2: the fireworks object model exportoptions object note: when this object is used to set properties, the only required property is exportformat . If other properties are not specified, their default values are used. Use the following information to understand the rules for determining sca...

  • Page 47

    Objects within fireworks documents 47 colormode string acceptable values are "indexed" (the default) , "24 bit" , and "32 bit" . Crop boolean the default value is false. Cropbottom integer the default value is 0 . Cropleft integer the default value is 0 . Cropright integer the default value is 0 . C...

  • Page 48

    48 chapter 2: the fireworks object model exportpaletteinfo object the following table lists the properties of the exportpaletteinfo object, along with their data types and, where appropriate, acceptable values and notes. Palettemode string acceptable values are "adaptive" (the default), "custom" , "...

  • Page 49

    Objects within fireworks documents 49 exportsettings object the following table lists the properties of the exportsettings object, along with their data types and, where appropriate, acceptable values and notes. Property data type notes basename string the name from which all automatically named sli...

  • Page 50

    50 chapter 2: the fireworks object model sliceautonaming1 through sliceautonaming6 string used to generate a name by concatenating six strings. If you need fewer than six strings, fill in the remaining strings with "none" . Acceptable values are: "none" — generates nothing. "row_col" — generates a u...

  • Page 51

    Objects within fireworks documents 51 fill object the following table lists the properties of the fill object, along with their data types and, where appropriate, acceptable values and notes. Sliceframenaming1 and sliceframenaming2 string used to generate a name by concatenating two strings; the res...

  • Page 52

    52 chapter 2: the fireworks object model frame object the following table lists the properties of the frame object, along with their data types and, where appropriate, acceptable values and notes. Read-only properties are marked with a bullet (•). Framenlayerintersection object the following table l...

  • Page 53

    Objects within fireworks documents 53 gradient object the following table lists the properties of the gradient object, along with their data types and, where appropriate, acceptable values and notes. Gradientnode object the following table lists the properties of the gradientnode object, along with ...

  • Page 54

    54 chapter 2: the fireworks object model 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 (•). Pathattrs object the following table lists the prope...

  • Page 55

    Objects within fireworks documents 55 pattern object the following table lists the property of the pattern object, along with its data type and notes. Rectangleprimitive object the following table lists the properties and methods of the rectangleprimitive object, along with their data types and, whe...

  • Page 56

    56 chapter 2: the fireworks object model registermoveparms object the following table lists the properties of the registermoveparms object, along with their data types and, where appropriate, acceptable values and notes. Property data type notes constrainangles boolean determines whether dragging th...

  • Page 57

    Objects within fireworks documents 57 constrain45key string the key value that you want to use to constrain movement to the nearest 45º increment. Can be one of the following: "none" , "shiftkey" , "ctrlcmdkey" , "altoptkey" . A key value of "none" means dragging will not be constrained, "shiftkey" ...

  • Page 58

    58 chapter 2: the fireworks object model deltaxtox float the ratio of mouse movement to the movement of the referenced point’s x coordinate. For example, 1.0 means that when the mouse moves 1 pixel to the right, the referenced point also moves 1 pixel to the right. Deltaxtoy float the ratio of mouse...

  • Page 59

    Objects within fireworks documents 59 singletextrun object the following table lists the properties of the singletextrun object, along with their data types and, where appropriate, acceptable values and notes. Maxx float the maximum value the x coordinate can move. Maxy float the maximum value the y...

  • Page 60

    60 chapter 2: the fireworks object model smartshape object the following table lists the properties of the smartshape object, along with their data types and, where appropriate, acceptable values and notes. Property data type notes altoptkeydown • boolean indicates whether the alt/option key is pres...

  • Page 61

    Objects within fireworks documents 61 the following table lists the method of the smartshape object, along with its parameter. Style object the following table lists the properties of the style object, along with their data types and, where appropriate, acceptable values and notes. All style object ...

  • Page 62

    62 chapter 2: the fireworks object model textattrs object the following table lists the properties of the textattrs object, along with their data types and, where appropriate, acceptable values and notes. Use_fill boolean if set to true , applies the fill property of the pathattrs object when applyi...

  • Page 63

    Objects within fireworks documents 63 textruns object the following table lists the properties of the textruns object, along with their data types and, where appropriate, acceptable values and notes. Kerning float also known as pair kerning, kerning specifies the percentage of an em square by which ...

  • Page 64

    64 chapter 2: the fireworks object model 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 ...

  • Page 65

    Html export objects 65 behaviorslist object the behaviorslist object is an array of behaviorinfo objects that describe the behaviors in an image map (see “behaviorinfo object” on page 64 ). The behaviorslist object does not occur by itself. That is, all occurrences of behaviorslist objects are membe...

  • Page 66

    66 chapter 2: the fireworks object model exportdoc object the following table lists the properties of the exportdoc object, along with their data types and, where appropriate, acceptable values and notes. All exportdoc properties are read-only. Note: this object type does not start with a capital le...

  • Page 67

    Html export objects 67 generateheader boolean set to true if an html file is generated; false if the output goes to the clipboard. Hasalttext boolean set to true if the fireworks document has an alternate text description. Hasbackgroundlink boolean set to true if the fireworks document has a backgro...

  • Page 68

    68 chapter 2: the fireworks object model 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. Tablealignment string a string that con...

  • Page 69

    Html export objects 69 imagemaplist object the imagemaplist object is an array of imagemap objects that describe the areas in an image map (see “imagemap object” on page 68 ). To access imagemap objects, use the imagemaplist array, as shown below: var curimagemap = imagemaplist[i]; the imagemaplist ...

  • Page 70

    70 chapter 2: the fireworks object model getframefilename (frameindex) zero-based index returns a string that is the filename for the slice on the specified frame, without directory or extension information. For example, when exporting a file base named button , slices[0][0].Getframefilename(0) retu...

  • Page 71

    Html export objects 71 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 69 ). For example, slices[0][0] is the slice information for the first cell at row 0, column 0. The first array is rows; the seco...

  • Page 72

    72 chapter 2: the fireworks object model the following table lists the properties of the slices object, along with their data types and, where appropriate, acceptable values and notes. All slices object properties are read-only. Working with selected objects when an object is selected, either progra...

  • Page 73

    Working with selected objects 73 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. Note: th...

  • Page 74

    74 chapter 2: the fireworks object model working with specific properties for selected elements some elements have specific properties that can be returned and set in addition to those that can be set for selected objects (see “working with properties for any selected object” on page 73 ). These spe...

  • Page 75

    Working with selected objects 75 group • elements • grouptype 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 instanc...

  • Page 76

    76 chapter 2: the fireworks object model rectangleprimitive • roundness • pathattributes note: for the complete list of path attributes properties, see “pathattributes” on page 76 . • originalsides • transform to return the roundness setting for the currently selected rectangle, type the following c...

  • Page 77: Chapter 3

    77 chapter 3 cross-product extensions cross-product extensions include any fireworks-related extensions developed for, or in, another macromedia application. These cross-product extensions include those written for other tools, such as macromedia dreamweaver mx 2004 that leverage existing fireworks ...

  • Page 78

    78 chapter 3: cross-product extensions fireworks rpc transactions pass xml between an rpc client and the fireworks rpc server built into fireworks mx 2004. 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 ...

  • Page 79

    Cross-product architecture 79 the rpc client sends four types of requests, specified in the xml tag name of the envelope: • get the get operation retrieves the current object properties. The get operation can contain only the obj and name attributes and no subelements. In this example, the client re...

  • Page 80

    80 chapter 3: cross-product extensions fireworks has four reserved object ids: • "0" this is the invalid object id, used for nonexistent or invalid objects. It is not frequently used for the rpc client, but it is used in several places for the rpc server. • "fw" this is the fireworks application obj...

  • Page 81

    Cross-product architecture 81 dictionary dict value="5.0" /> key="bar" value="fred" / > value="5.0" /> key="bar" value="fred" / > key="bar" value="fred" / > a dictionary data type. Like the array data type, it is simply a container for other data nodes. Each direct child node of a dictionary node mu...

  • Page 82

    82 chapter 3: cross-product extensions parameters parameters are simply data nodes with an order attribute. The order attribute identifies the order in which the parameters should be processed for the server. In this way, the rpc client can use any xml client library to build parameters in any order...

  • Page 83

    Cross-product architecture 83 rpc and the fireworks javascript dom the rpc server does not allow for self-discovery of the server classes and their methods. Instead the client must know the methods and properties of a given class of objects beforehand. If the client is written in actionscript or c++...

  • Page 84

    84 chapter 3: cross-product extensions date dictionary value="2002" /> value="9" /> value="3" /> value="20" /> value="15" /> value="32" /> a date is a dictionary with the following subelement keys: year, month, day, hour, minutes, and seconds. All six elements are integer data types. Dictionary dict...

  • Page 85

    Cross-product architecture 85 security the rpc server restricts some operations to make sure that a client cannot use the rpc server maliciously to damage the user’s system. The first security mechanism is that the rpc server binds to the loopback address, 127.0.0.1. This means all clients must run ...

  • Page 86

    86 chapter 3: cross-product extensions rpcmethods.Createautoreleasepool() usage rpcmethods.Createautoreleasepool() arguments none. Returns nothing. Description starts the auto-release block. Rpcmethods.Destroyautoreleasepool() usage rpcmethods.Destroyautoreleasepool() arguments none. Returns nothing...

  • Page 87

    Cross-product architecture 87 rpcmethods.Removefromautoreleasepool() usage rpcmethods.Removefromautoreleasepool(proxyobject) arguments proxyobject the object to remove from the current pool. Returns nothing. Description removes an object from the current auto-release pool so that it can be used in a...

  • Page 88

    88 chapter 3: cross-product extensions accessing proxy objects if you want to access a proxy object outside of an auto-release block, you must use the removefromautoreleasepool() function. The removefromautoreleasepool() function manually removes an object reference from the auto-release pool before...

  • Page 89

    Cross-product architecture 89 //create new doc var fwdoc = fw.Createfireworksdocument(size, res, "#0033ff"); //define a rectangle object the short way var rect = {left:10, top:10, right:210, bottom:210}; //add rectangle fwdoc.Addnewrectangleprimitive(rect,0.20); //set its color fwdoc.Setfillcolor("#...

  • Page 90

    90 chapter 3: cross-product extensions flash panels fireworks contains macromedia flash player, which plays shockwave files as panels and commands in the fireworks interface. You can also add a macromedia api wrapper extension to macromedia flash for creating shockwave files that communicate with th...

  • Page 91

    Flash panels 91 description declares a set of javascript code to pass to the fireworks api, allowing flash authors to embed fireworks api commands in a frame of a flash movie. Note: mmexecute supersedes the fwjavascript command. However, the fwjavascript command still works in the current version of...

  • Page 92

    92 chapter 3: cross-product extensions to install the api wrapper, make sure you have the macromedia extension manager installed and double-click the extension file. In macromedia flash, the wrapper appears in the components window as fwcommandcomponents. The following example shows a command withou...

  • Page 93

    Flash panels 93 creating event handlers to create an event handler, implement a function with the corresponding event name. Currently, fireworks supports the following events for flash panels: note: the event handler must be implemented in the global namespace. Any events that are in the swf file bu...

  • Page 94

    94 chapter 3: cross-product extensions example function onfwdocumentnamechange() { // your code goes here } example _global.Onfwdocumentnamechange = function () { // your code goes here } both examples show how to implement a handler for the document name changed event. However, the second example w...

  • Page 95: Chapter 4

    95 chapter 4 auto shapes auto shapes are vector objects that contain information about how the user can interact with them onscreen. Auto shapes appear in the macromedia fireworks mx 2004 user interface as “auto shapes” but are programmatically called “smartshape” objects in the javascript code that...

  • Page 96

    96 chapter 4: auto shapes creating an auto shape to create an auto shape, you need to define a series of properties for the shape, define the shape’s control points, and write functions that tell fireworks how to handle the auto shape as the user interacts with the object (see “handling the user int...

  • Page 97

    Creating an auto shape 97 // set the new point's values node.X = node.Predx = node.Succx = x; node.Y = node.Predy = node.Succy = y; } you can then simplify the insertsmartshapeat() function with the new helper function: function insertsmartshapeat() { var elem = smartshape.Elem; var newpath = new pa...

  • Page 98

    98 chapter 4: auto shapes fireworks messages fireworks passes the following messages to the smartshape object as the user interacts with (inserts, moves, or changes) the shape: • "insertsmartshapeat" fireworks sends this message when the user selects the shape from the tools panel and clicks on the ...

  • Page 99

    Creating an auto shape 99 the following table lists all of the available fireworks message handler functions you can create (although, you don’t have to write a response to every fireworks message, only the ones important to your auto shape): function description insertsmartshapeat() draws the initi...

  • Page 100

    100 chapter 4: auto shapes these functions correspond directly with the messages listed in “fireworks messages” on page 98 . To invoke your own function names in response to fireworks messages, you need to write a switch() statement. Switch statements if you take a look at some existing auto shapes ...

  • Page 101

    Creating an auto shape 101 supporting functions and methods since the auto shape file is written in javascript, your functions can use global variables, common functions, and the fireworks javascript api. The auto shape javascript file contains the definition of the shape’s points, and a series of f...

  • Page 102

    102 chapter 4: auto shapes.

  • Page 103: Chapter 5

    103 chapter 5 fireworks javascript api this chapter lists javascript functions supported by macromedia fireworks mx 2004 that enable you to create useful fireworks extensions and customized fireworks menus. Almost any task that the user can accomplish in fireworks with the menus, tools, or floating ...

  • Page 104

    104 chapter 5: fireworks javascript api palette or panel several api functions reference the history panel (see “history panel functions” on page 278 ). Throughout the fireworks documentation and online help, the term “palette” is reserved for discussions of a color palette, and the term “panel” is ...

  • Page 105

    Document functions 105 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() using the dom.Addbehavior() function the following code shows the...

  • Page 106

    106 chapter 5: fireworks javascript api mm_nbgroup [highlight] availability fireworks 3. Arguments type, target, swapframe, filename, preload, downhighlight, downhighlightframe, downhighlightfilename • pass "over" for type . • target specifies the slice to which the behavior is attached. Pass –1 for...

  • Page 107

    Document functions 107 description sets a navigation bar image behavior. Example fw.Getdocumentdom().Addbehavior("mm_nbgroup(\'all\',1,0)", "onmouseover", -1); mm_nbgroup [out] availability fireworks 3. Arguments type pass "out" for type . Description sets a navigation bar restore behavior. Example ...

  • Page 108

    108 chapter 5: fireworks javascript api example fw.Getdocumentdom().Addbehavior("mm_statusmessage(\"status message!\")", "onmouseover", -1); mm_swapimage availability fireworks 3. Arguments target, swapframe, filename, preload, restoreonmouseout • target specifies the slice to which the behavior is ...

  • Page 109

    Document functions 109 dom.Addelementmask() availability fireworks 4. Usage dom.Addelementmask(mode, {bentermaskeditmode} arguments mode acceptable values for mode are " reveal all", "hide all", "reveal selection", and "hide selection" . If the user is not in bitmap mode, or if there is no pixel sel...

  • Page 110

    110 chapter 5: fireworks javascript api example the following command adds one frame after the current frame but does not change the active frame. Fw.Getdocumentdom().Addframes(1, "after current", false); dom.Addguide() availability fireworks 3. Usage dom.Addguide(float position, guidekind) argument...

  • Page 111

    Document functions 111 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.Addnewimag...

  • Page 112

    112 chapter 5: fireworks javascript api 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 firewor...

  • Page 113

    Document functions 113 dom.Addnewline() availability fireworks 3. Usage dom.Addnewline(startpoint, endpoint) arguments startpoint and endpoint points that specify the x,y coordinates between which the path is added (see “point data type” on page 11 ). Returns nothing. Description adds a new path bet...

  • Page 114

    114 chapter 5: fireworks javascript api dom.Addnewrectangle() availability fireworks 3. Usage dom.Addnewrectangle(boundingrectangle, roundness) arguments boundingrectangle a rectangle that specifies the bounds within which the new rectangle is added (see “rectangle data type” on page 11 ). Roundness...

  • Page 115

    Document functions 115 description adds a new rectangle primitive that fits in the specified bounds. The rectangle primitive uses the document’s current default path attributes, is added on the current frame and layer, and has several editable properties, such as corner roundness and transformation....

  • Page 116

    116 chapter 5: fireworks javascript api dom.Addnewstar() availability fireworks 3 usage dom.Addnewstar(numsides, spikiness, bisstar, centerpoint, outsidepoint) arguments numsides an integer that specifies the number of sides of the new path. Spikiness a floating-point value that controls the regular...

  • Page 117

    Document functions 117 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 text to the library and places an instance of it in the document. F...

  • Page 118

    118 chapter 5: fireworks javascript api returns true if the swap image behavior was added; false if no suitable hotspot was at the specified location. Description if a single hotspot or slice is selected, this function adds to it a swap image behavior from the hotspot or slice located at where in th...

  • Page 119

    Document functions 119 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. Usage dom.Align(alignmode) arguments alignmode ...

  • Page 120

    120 chapter 5: fireworks javascript api dom.Appendpointtopath() availability fireworks 3. Usage dom.Appendpointtopath(ontourindex, pttoinsertbefore, controlpointfirst, mainpoint, controlpointlast) arguments contourindex an zero-based index value that specifies the contour to which the bézier point i...

  • Page 121

    Document functions 121 description appends a point to the selected unclosed polygon slice. If an unclosed polygon slice is not selected, then a new polygon slice is created with the single point that passed in. Dom.Applycharactermarkup() availability fireworks 3, enhanced in 4. Usage dom.Applycharac...

  • Page 122

    122 chapter 5: fireworks javascript api dom.Applyeffects() availability fireworks 3. Usage dom.Applyeffects(effectlist) arguments effectlist an effectlist object (see “effectlist object” on page 38 ). If effectlist is null , this function removes all effects from the selection. Returns nothing. Desc...

  • Page 123

    Document functions 123 dom.Applystyle() availability fireworks 3. Usage dom.Applystyle(stylename, styleindex) arguments stylename a string that specifies the style name to be applied. Styleindex an index to the style to apply. This is usually zero. However, if there are multiple styles with the same...

  • Page 124

    124 chapter 5: fireworks javascript api dom.Attachtexttopath() availability fireworks 3. Usage dom.Attachttexttopath() arguments none. Returns nothing. Description attaches the selected text to the selected path. If no text and path are selected, no action occurs. Example when two items are selected...

  • Page 125

    Document functions 125 dom.Changesliceguide() availability fireworks mx. Usage dom.Changesliceguide(currentposition, newposition, guidekind, ismagneticdrag) arguments currentposition a floating-point value that specifies the current position of the slice guide to be moved. Newposition a floating-poi...

  • Page 126

    126 chapter 5: fireworks javascript api returns nothing. Description clears the “selective jpeg mask” for the document. Dom.Clipcopy() availability fireworks 3. Usage dom.Clipcopy() arguments none. Returns nothing. Description copies the selection to the clipboard. Example the following command copi...

  • Page 127

    Document functions 127 dom.Clipcopyformats() availability fireworks mx. Usage dom.Clipcopyformats(format) arguments format the graphics format for the selection. For example, "aicb" is the adobe illustrator format. Returns nothing. Description copies the selection to the clipboard using the specifie...

  • Page 128

    128 chapter 5: fireworks javascript api arguments whatifresolutiondifferent an optional string that specifies how resampling should be done if the resolution of the clipboard contents doesn’t match the resolution of the document. Acceptable values for whatifresolutiondifferent are "resample" , "do n...

  • Page 129

    Document functions 129 returns nothing. Description pastes the clipboard contents into the document as an element mask. Only one element can be selected when calling this function. If more than one element (or none) is selected when this function is called, fireworks throws an exception. An exceptio...

  • Page 130

    130 chapter 5: fireworks javascript api description pastes the specified color channel on the clipboard into each of the rgb channels of a new image or into the specified channel of the selected image, if any. Example the following command copies the red data from the clipboard into the red channel:...

  • Page 131

    Document functions 131 dom.Cloneselection() availability fireworks 3. Usage dom.Cloneselection() arguments none. Returns nothing. Description makes exact duplicates of the selection, placing the duplicated items directly on top of the original items. Example the following command copies the selected...

  • Page 132

    132 chapter 5: fireworks javascript api dom.Convertanimsymboltographicsymbol() availability fireworks 4. Usage dom.Converanimsymboltographicsymbol() arguments none. Returns nothing. Description if a single animation symbol is selected, this function converts it from an animation symbol to a graphics...

  • Page 133

    Document functions 133 description converts the selected item(s) to a new animation symbol. See also dom.Convertanimsymboltographicsymbol() , dom.Converttosymbol() , dom.Setaniminstancenumframes() dom.Converttopaths() availability fireworks 3. Usage dom.Converttopaths() arguments none. Returns nothi...

  • Page 134

    134 chapter 5: fireworks javascript api 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() avail...

  • Page 135

    Document functions 135 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. Usage dom.Copytohotspot(hotspottype, {wh...

  • Page 136

    136 chapter 5: fireworks javascript api arguments boundingrectangle a rectangle that specifies the bounds within which the selection should be cropped (see “rectangle data type” on page 11 ). Returns nothing. Description crops the selection to the specified rectangle. Dom.Deleteallindocument() avail...

  • Page 137

    Document functions 137 dom.Deletelayer() availability fireworks 3. Usage dom.Deletelayer(layerindex) arguments layerindex an integer value that specifies the the layer to be deleted, starting with 0 (although, to specify the current layer, pass –1 here). Returns nothing. Description deletes a layer....

  • Page 138

    138 chapter 5: fireworks javascript api dom.Deleteselection() availability fireworks 3. Usage dom.Deleteselection(bfilldeletedarea) arguments bfilldeletedarea this argument is ignored if fireworks is not in bitmap mode. If fireworks is in bitmap mode and bfilldeletedarea is true , the deleted pixels...

  • Page 139

    Document functions 139 example the following command deletes the selected symbols from the library as well as any active instances from the document. Fw.Getdocumentdom().Deletesymbol(null); dom.Detachinstancefromsymbol() availability fireworks 3. Usage dom.Detachinstancefromsymbol() arguments none. ...

  • Page 140

    140 chapter 5: fireworks javascript api returns nothing. Description distributes the selection along a vertical or horizontal dimension. Dom.Distributelayertoframes() availability fireworks 3. Usage dom.Distributelayertoframes(layerindex) arguments layerindex an integer value that specifies the laye...

  • Page 141

    Document functions 141 dom.Dragcontrolpoint() availability fireworks mx 2004. Usage dom.Dragcontrolpoint(index, newloc, shiftkeydown, ctrlcmdkeydown, altoptkeydown) arguments index the index of the control point to move. Newloc specifies the new location of the point. Shiftkeydown specifies whether ...

  • Page 142

    142 chapter 5: fireworks javascript api example the following command makes one copy of the current frame and places the new frame after the current frame. Fw.Getdocumentdom().Duplicateframe(-1, 1, "after current", false); dom.Duplicatelayer() availability fireworks 3. Usage dom.Duplicatelayer(layer...

  • Page 143

    Document functions 143 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() availability fire...

  • Page 144

    144 chapter 5: fireworks javascript api dom.Duplicatesymbol() availability fireworks 3. Usage dom.Duplicatesymbol(symbol) arguments symbol the symbol to duplicate. • to duplicate all selected symbols in the library (not the document), pass a null value. • duplicating a linked symbol results in a non...

  • Page 145

    Document functions 145 arguments where specifies which rectangle to check for elements. To find the elements under a single point (similar to selecting with the subselection tool), set left equal to right and top equal to bottom. To find elements within a rectangle (similar to drag-selecting with th...

  • Page 146

    146 chapter 5: fireworks javascript api arguments antialias a boolean value to turn anti-aliasing on ( true ) or off (false ). Returns nothing. Description turns anti-aliasing on or off for the selected blocks of text. Dom.Enterelementmaskeditmode() availability fireworks 4. Usage dom.Enterelementma...

  • Page 147

    Document functions 147 dom.Exitelementmaskeditmode() availability fireworks 4. Usage dom.Exitelementmaskeditmode() arguments none. Returns nothing. Description takes fireworks out of element-mask edit mode. If fireworks is not in this mode, this function has no effect. Dom.Exitpaintmode() availabili...

  • Page 148

    148 chapter 5: fireworks javascript api returns true if the file is read successfully; false if the file is not the expected format or is not read successfully for any other reason. Description replaces the values in dom.Exportoptions.Paletteentries with those in the specified gif or act file. This ...

  • Page 149

    Document functions 149 returns true if the file is successfully exported; false otherwise. Description exports the document as specified. Dom.Fillselectedpixels() availability fireworks 3. Usage dom.Fillselectedpixels(clickpt, p1, p2, p3, bfillselectiononly, tolerance, edgemode, featheramt) argument...

  • Page 150

    150 chapter 5: fireworks javascript api dom.Filterselection() availability fireworks 3. Usage dom.Filterselection(liveeffect) arguments liveeffect an effect object (see “effect object” on page 32 ). Returns nothing. Description applies the specified pixel filter to the selection. Items that are not ...

  • Page 151

    Document functions 151 dom.Findexportformatoptionsbyname() availability fireworks 3. Usage dom.Findexportformatoptionsbyname(name) arguments name a string that specifies the name of the set of export settings to find. Returns if there is a set of export settings with the specified name, the argument...

  • Page 152

    152 chapter 5: fireworks javascript api returns nothing. Description flattens the entire document into a single pixel image. This is the same behavior as the merge layers command. Dom.Flattenselection() availability fireworks 3. Usage dom.Flattenselection() arguments none. Returns nothing. Descripti...

  • Page 153

    Document functions 153 dom.Getpixelmask() availability fireworks 3, deprecated in 4. Usage dom.Getpixelmask() arguments none. Returns the mask for the current pixel selection. Returns null if fireworks is not in bitmap mode, or if there is no pixel selection. For information on the format of mask va...

  • Page 154

    154 chapter 5: fireworks javascript api returns true if the grid is visible; false otherwise. Description determines whether the grid is visible. Dom.Getshowrulers() availability fireworks 3. Usage dom.Getshowrulers() arguments none. Returns true if the rulers are visible; false otherwise. Descripti...

  • Page 155

    Document functions 155 arguments none. Returns one of the following strings: "left" , "center" , "right" , "justify" , "stretch" , "vertical left" , "vertical center" , "vertical right" , "vertical justify" , or "vertical stretch" . Returns null if the text has multiple alignments or if the selectio...

  • Page 156

    156 chapter 5: fireworks javascript api returns true if the text has the specified character markup; false if it does not or if only part of the text has the markup. Description determines whether the selected text has the specified character markup. Dom.Hideselection() availability fireworks 3. Usa...

  • Page 158

    158 chapter 5: fireworks javascript api description e xtracts the component elements from the selected symbol and places copies of those elements in the document. This function is similar to the dom.Importsymbol api. Dom.Importsymbol places an instance of a symbol in your document—for example, when ...

  • Page 159

    Document functions 159 returns nothing. Description inserts a bézier point in the selected path. This function is similar to dom.Appendpointtopath() but includes a tparameter argument, which lets you control where the point is inserted. See also dom.Appendpointtopath() dom.Insertsmartshapeat() avail...

  • Page 160

    160 chapter 5: fireworks javascript api description tests to see if the selected object(s) are directly above a bitmap object. The selection does not need to be contiguous, although at least one item in the selection must be directly above a bitmap. Dom.Joinpaths() availability fireworks 3. Usage do...

  • Page 161

    Document functions 161 dom.Knifeelementsfrompoints() availability fireworks 3. Usage dom.Knifeelementsfrompoints(from, to, tolerance) arguments from a point that specifies the x,y coordinates of the point where the user clicked and started to drag (see “point data type” on page 11 ). To a point that...

  • Page 162

    162 chapter 5: fireworks javascript api description links or unlinks the element mask on the selected element. If more than one element (or no elements) are selected when this function is called, fireworks throws an exception. An exception is also thrown if the element has no element mask. Dom.Makef...

  • Page 163

    Document functions 163 dom.Makeactive() availability fireworks 3. Usage dom.Makeactive() arguments none. Returns nothing. Description makes the selected document active for editing. Dom.Mergedown() availability fireworks mx. Usage dom.Mergedown() arguments none. Returns nothing. Description merges s...

  • Page 164

    164 chapter 5: fireworks javascript api controlpointfirst , mainpoint , and controlpointlast points that specify the x,y coordinates of the preceding control point, the main point, and the following control point of the new point (see “point data type” on page 11 ). Dreapplyattrs if dreapplyattrs is...

  • Page 165

    Document functions 165 arguments whichpath a zero-based index that specifies an index into the list of selected items, indicating which item contains the bézier handles to move. Contourindex a zero-based index that specifies the contour that contains the handles to move. For paths with multiple cont...

  • Page 166

    166 chapter 5: fireworks javascript api arguments delta a point that specifies the x,y coordinate values by which the handle is moved (see “point data type” on page 11 ). For example, passing ({x : 1 , y : 2}) specifies a location that is right by 1 pixel and down by 2 pixels. Whichhandle specifies ...

  • Page 167

    Document functions 167 dom.Movepixelmaskby() availability fireworks 4. Usage dom.Movepixelmaskby(delta) arguments delta a point that specifies the x,y coordinate values by which the bitmap mode selection is moved (see “point data type” on page 11 ). For example, passing ({ x : 1 , y : 2 })moves the ...

  • Page 168

    168 chapter 5: fireworks javascript api dom.Movepointonhotspotbywithflags() availability fireworks mx. Usage dom.Movepointonhotspotbywithflags(pttomodifyindex, delta, flags) arguments pttomodifyindex a zero-based index that specifies which point on the path is to move. Delta a point that specifies t...

  • Page 169

    Document functions 169 dom.Moveselectionby() availability fireworks 3. Usage dom.Moveselectionby(delta, bmakecopy, dosubsel) arguments delta a point that specifies the x,y coordinate values by which the selection moved (see “point data type” on page 11 ). For example, passing ({x : 1 , y : 2}) moves...

  • Page 170

    170 chapter 5: fireworks javascript api dom.Moveselectionto() availability fireworks 3. Usage dom.Moveselectionto(location, bmakecopy, dosubsel) arguments location a point that specifies the x-,y-coordinate values of the location to which the selection is moved or copied (see “point data type” on pa...

  • Page 171

    Document functions 171 dom.Moveselectiontolayer() availability fireworks 3, enhanced in 4. Usage dom.Moveselectiontolayer(layerindex, bmakecopy, {whatifmultipleselected}, {elementindex}) arguments layerindex an integer value that specifies the layer to which the selection should be moved or copied, ...

  • Page 172

    172 chapter 5: fireworks javascript api dom.Pathcrop() availability fireworks 3. Usage dom.Pathcrop() arguments none. Returns nothing. Description performs a crop operation on the selected paths. Dom.Pathexpand() availability fireworks 3. Usage dom.Pathexpand(width, miter, cap, join) arguments width...

  • Page 173

    Document functions 173 arguments width a floating-point value that specifies the new width of the selected paths, in pixels. Miter a floating-point value that specifies the new miter angle of the selected paths, in pixels. This argument is ignored if the value of join is not "miter" . Join acceptabl...

  • Page 174

    174 chapter 5: fireworks javascript api dom.Pathsimplify() availability fireworks 3. Usage dom.Pathsimplify(limit) arguments limit is a floating-point value that specifies how much to simplify. This value corresponds to the value in the modify > alter path > simplify dialog box. Returns nothing. Des...

  • Page 175

    Document functions 175 description previews the document in the primary or secondary 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...

  • Page 176

    176 chapter 5: fireworks javascript api returns nothing. Description forces the document to redraw itself immediately. This function is useful for providing feedback during complicated commands. Dom.Reflectselection() availability fireworks 3. Usage dom.Reflectselection(bhoriz, bvert, opts) argument...

  • Page 177

    Document functions 177 dom.Removebehavior() availability fireworks 3. Usage dom.Removebehavior({event}, {eventindex}) arguments event an optional argument specifying the event that triggers the behavior. This argument is ignored by fireworks. Eventindex an integer value that specifies the location o...

  • Page 178

    178 chapter 5: fireworks javascript api dom.Removecharactermarkup() availability fireworks 3. Usage dom.Removecharactermarkup(tag) arguments tag acceptable values are "b" , "i" , and "u" , for bold, italic, and underline. Returns nothing. Description reapplies the default value for the specified mar...

  • Page 179

    Document functions 179 returns nothing. Description reapplies the default value for the specified font attribute to the text in the selection. Dom.Removefill() availability fireworks 3. Usage dom.Removefill() arguments none. Returns nothing. Description sets the fill of the selection to none. Dom.Re...

  • Page 180

    180 chapter 5: fireworks javascript api dom.Removetransformation() availability fireworks 3. Usage dom.Removetransformation() arguments none. Returns nothing. Description removes the transformations, if any, from the selected text or instances. Dom.Reorderframe() availability fireworks 3. Usage dom....

  • Page 181

    Document functions 181 dom.Reorderlayer() availability fireworks 3. Usage dom.Reorderlayer(layertomove, layertoputitbefore, bmakecopy) arguments layertomove a zero-based index that specifies which layer to move or copy. Layertoputitbefore a zero-based index that specifies where to place the layer to...

  • Page 182

    182 chapter 5: fireworks javascript api dom.Replacebuttontextstringsininstances() availability fireworks 3. Usage dom.Replacebuttontextstringsininstances(newstring, uniformattrs) arguments newstring specifies the string to be used as replacement text. Uniformattrs if uniformattrs is false , each cha...

  • Page 183

    Document functions 183 dom.Resizeselection() availability fireworks 3. Usage dom.Resizeselection(width, height) arguments width and height integers that specify the new width and height, in pixels. Returns nothing. Description resizes the selection to the specified pixel width and height, keeping th...

  • Page 184

    184 chapter 5: fireworks javascript api returns nothing. Description restores the selection that is specified in dom.Saveselection(). See also dom.Saveselection() dom.Reversepathtextdirection() availability fireworks 3. Usage dom.Reversepathtextdirection() arguments none. Returns nothing. Descriptio...

  • Page 185

    Document functions 185 dom.Rotateselection() availability fireworks 3. Usage dom.Rotateselection(rotationdegrees, opts) arguments rotationdegrees a floating-point value that specifies the number of degrees to rotate the selection. Opts acceptable values are "transformattributes" , "autotrimimages" ,...

  • Page 186

    186 chapter 5: fireworks javascript api dom.Savecopyas() availability fireworks 3. Usage dom.Savecopyas(fileurl) arguments fileurl a string, which is expressed as a file://url, that specifies the directory and name under which the copy should be saved. Returns true if the save operation is successfu...

  • Page 187

    Document functions 187 returns nothing. Description stores the current selection in bitmap mode as the saved selection. Use dom.Restoreselection() to restore the selection. See also dom.Restoreselection() dom.Scaleselection() availability fireworks 3. Usage dom.Scaleselection(xscaleamount, yscaleamo...

  • Page 188

    188 chapter 5: fireworks javascript api arguments whattodo acceptable values are "expand" , "contract" , "border" , and "smooth" . • use "expand" to expand the pixel selection outward by the number of pixels that are specified by amount . • use "contract" to reduce the pixel selection inward by the ...

  • Page 189

    Document functions 189 returns nothing. Description selects all the items on the given layer in the current frame. This function deselects objects on other layers. If the only element on the layer is a bitmap, fireworks will enter paint mode on the bitmap. Dom.Selectchildren() availability fireworks...

  • Page 190

    190 chapter 5: fireworks javascript api dom.Selectinverse() availability fireworks 3. Usage dom.Selectinverse() arguments none. Returns nothing. Description if fireworks is in bitmap mode and a pixel selection is active, this function inverts the pixel selection. Dom.Selectnone() availability firewo...

  • Page 191

    Document functions 191 description selects the parents, if any, of the selection. That is, if all the members of a group are selected, the individual members are deselected, and the group is selected. See also dom.Selectchildren() dom.Selectsimilar() availability fireworks 3. Usage dom.Selectsimilar...

  • Page 192

    192 chapter 5: fireworks javascript api arguments where a point that specifies the x,y coordinates of the pixel whose color is used to calculate the new mask (see “point data type” on page 11 ). Tolerance an integer between 0 and 255, inclusive, that specifies the tolerance for selecting pixels. Edg...

  • Page 193

    Document functions 193 dom.Setalllayersdisclosure() availability fireworks 4. Usage dom.Setalllayersdisclosure(bdisclosed) arguments bdisclosed if bdisclosed is true , all the elements on all layers appear in the layers list. If false , only layer names appear on the list. Returns nothing. Descripti...

  • Page 194

    194 chapter 5: fireworks javascript api returns nothing. Description sets the number of frames to animate the currently selected animation element. See also dom.Converttoanimsymbol() dom.Setaniminstanceoffsetdist() availability fireworks 4. Usage dom.Setaniminstanceoffsetdist(offsetdistpt) arguments...

  • Page 195

    Document functions 195 description sets the rotation amount, in degrees, to animate the currently selected animation element. See also dom.Converttoanimsymbol() dom.Setaniminstancescaleamount() availability fireworks 4. Usage dom.Setaniminstancescaleamount(scaleamount) arguments scaleamount a positi...

  • Page 196

    196 chapter 5: fireworks javascript api dom.Setaniminstancestartframe() availability fireworks 3, deprecated in 4 in favor of placing the animation symbol on the frame in which it should start. Usage dom.Setaniminstancestartframe(startframe) arguments startframe an integer that corresponds to the st...

  • Page 197

    Document functions 197 returns nothing. Description sets the selection to the specified brush. See also dom.Setbrushcolor() , dom.Setbrushname() , dom.Setbrushncolorntexture() , dom.Setbrushplacement() dom.Setbrushcolor() availability fireworks 3. Usage dom.Setbrushcolor(color) arguments color a col...

  • Page 198

    198 chapter 5: fireworks javascript api dom.Setbrushncolorntexture() availability fireworks 3. Usage dom.Setbrushncolorntexture(brush, color, texture-name) arguments brush a brush object (see “brush object” on page 26 ). Color a color string (see “color string data type” on page 11 ). Texture-name t...

  • Page 199

    Document functions 199 arguments bautoslice if bautoslice is true , automatic slicing is turned on. If bautoslice is false , it is turned off. Returns nothing. Description if the user is editing a button document, this function turns automatic slicing on or off. Dom.Setbuttonincludedownstate() avail...

  • Page 200

    200 chapter 5: fireworks javascript api dom.Setbuttonshowdownonload() availability fireworks 3. Usage dom.Setbuttonshowdownonload(bshowdownonload) arguments bshowdownonload if bshowdownonload is true , the down-state-on-load is shown in the button. If bshowdownonload is false , it is not. Returns no...

  • Page 201

    Document functions 201 dom.Setdefaultbrushandfillcolors() availability fireworks 3. Usage dom.Setdefaultbrushandfillcolors() arguments none. Returns nothing. Description resets the document’s brush and fill color to the default. Dom.Setdefaultfillvector() availability fireworks 3. Usage dom.Setdefau...

  • Page 202

    202 chapter 5: fireworks javascript api description sets the canvas color of the document to the specified color. Example the following command sets the canvas color to blue. Fw.Getdocumentdom().Setdocumentcanvascolor("#0000ff"); dom.Setdocumentcanvassize() availability fireworks 3. Usage dom.Setdoc...

  • Page 203

    Document functions 203 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() dom.Setdocumentcanvassizetoselection(...

  • Page 204

    204 chapter 5: fireworks javascript api dom.Setdocumentresolution() availability fireworks 3. Usage dom.Setdocumentresolution(resolution) arguments resolution specifies the resolution for the document (see “resolution data type” on page 12 ). Returns nothing. Description sets the resolution of the d...

  • Page 205

    Document functions 205 returns nothing. Description sets the rendering mode on the selected element’s element mask. Only one element can be selected when calling this function. If more than one element (or no elements) are selected when this function is called, fireworks throws an exception. Firewor...

  • Page 206

    206 chapter 5: fireworks javascript api dom.Setelementvisible() availability fireworks 4. Usage dom.Setelementvisisble(frameindex, layerindex, elementindex, bshow) arguments frameindex an integer value that specifies the frame that contains the element(s) to be shown or hidden, starting with 0 (alth...

  • Page 207

    Document functions 207 description shows or hides all the elements with the specified name. If no element has the specified name, an exception is thrown. If the elements are hidden because they are on a hidden layer or frame, for example, this function does not show them. See also dom.Findnamedeleme...

  • Page 208

    208 chapter 5: fireworks javascript api arguments fill a fill object (see “fill object” on page 51 ). Returns nothing. Description sets the selection to the specified fill. Dom.Setfillcolor() availability fireworks 3. Usage dom.Setfillcolor(color) arguments color a color string (see “color string da...

  • Page 209

    Document functions 209 dom.Setfillncolor() availability fireworks mx. Usage dom.Setfillncolor(fill, color) arguments fill a fill object (see “fill object” on page 51 ). Color a color string (see “color string data type” on page 11 ). Returns nothing. Description sets the selection to the specified f...

  • Page 210

    210 chapter 5: fireworks javascript api dom.Setfillplacement() availability fireworks 3. Usage dom.Setfillplacement(placement) arguments placement acceptable values are "top" and "bottom" . Returns nothing. Description sets the fill placement for selected items with fills. Dom.Setfillvector() availa...

  • Page 211

    Document functions 211 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. Dom.Setgradientname() availability fireworks 3. Usage dom.Setgradientname(urrentname, newname) argumen...

  • Page 212

    212 chapter 5: fireworks javascript api arguments gridsize a point that specifies the x,y coordinates that are used for the document’s grid size (see “point data type” on page 11 ). Returns nothing. Description sets the grid size for the document. Dom.Setgridcolor() availability fireworks 3. Usage d...

  • Page 213

    Document functions 213 dom.Setguidecolor() availability fireworks 3. Usage dom.Setguidecolor(guidecolor) arguments guidecolor a color string (see “color string data type” on page 11 ). Returns nothing. Description sets the color that is used to display normal (nonslice) guides. To set the color of s...

  • Page 214

    214 chapter 5: fireworks javascript api dom.Sethotspotcolor() availability fireworks 3. Usage dom.Sethotspotcolor(whattoset, color) arguments whattoset acceptable values are "hotspots" , "slices" , and "hotspots and slices" . Color a color string (see “color string data type” on page 11 ) . Returns ...

  • Page 215

    Document functions 215 dom.Sethotspotshape() availability fireworks 3. Usage dom.Sethotspotshape(whattoset, shape) arguments whattoset acceptable values are "hotspots" , "slices" , or "hotspots and slices" . Shape acceptable values are "rectangle" , "oval" , or "polyline" . Returns nothing. Descript...

  • Page 216

    216 chapter 5: fireworks javascript api description sets the hotspot text to the specified value for the hotspots and slices in the selection. Arguments whattoset acceptable values are "hotspots" , "slices" , or "hotspots and slices" . Textstring a string that specifies the text to be used for the h...

  • Page 217

    Document functions 217 description specifies whether the elements on a specified layer appear in the layers list. Disclosure affects the layer, regardless of which frame appears. See also dom.Setalllayersdisclosure() dom.Setlayerlocked() availability fireworks 3. Usage dom.Setlayerlocked(layerindex,...

  • Page 218

    218 chapter 5: fireworks javascript api returns nothing. Description renames the specified layer. Layers aren’t required to have unique names, so no duplicate checking occurs. Dom.Setlayersharing() availability fireworks 3. Usage dom.Setlayersharing(layerindex , sharedstatus, bunsharecopiestoallfram...

  • Page 219

    Document functions 219 arguments layerindex an integer value that specifies the layer that should be shown or hidden, starting with 0 (although, to specify the current layer, pass –1 here). To show or hide all the layers on a frame, use the balllayers argument. Frameindex an integer value that speci...

  • Page 220

    220 chapter 5: fireworks javascript api dom.Setpixelmask() availability fireworks 3, deprecated in 4 in favor of dom.Setselectionmask() . Usage dom.Setpixelmask(mask, howtocombinemasks) arguments mask a mask variable that specifies the mask to be applied (see “mask data type” on page 11 ). If mask i...

  • Page 221

    Document functions 221 dom.Setopacity() availability fireworks 3. Usage dom.Setopacity(opacity) arguments opacity a float variable between 0 and 100, inclusive. Returns nothing. Description sets the opacity of the selection to the specified value. Example the following command sets the selected item...

  • Page 222

    222 chapter 5: fireworks javascript api example the following command performs the transform operation on the selection within the specified points: fw.Getdocumentdom().Setquadrangle({x:-0.300884962, y:0.207964599}, {x:1, y:0.207964599}, {x:1, y:0.792035401}, {x:-0.300884962, y:0.792035401}, "autotr...

  • Page 223

    Document functions 223 dom.Setselectionbounds() availability fireworks 3. Usage dom.Setselectionbounds(boundingrectangle, opts) arguments boundingrectangle a rectangle that specifies the new location and size of the selection (see “rectangle data type” on page 11 ). Opts acceptable values are "trans...

  • Page 224

    224 chapter 5: fireworks javascript api dom.Setshowedges() availability fireworks 3. Usage dom.Setshowedges(bshowedges) arguments bshowedges if bshowedges is true , the show edges option is turned on. If bshowedges is false , the option is turned off. Returns nothing. Description specifies whether t...

  • Page 225

    Document functions 225 returns nothing. Description specifies whether the grid is visible. Dom.Setshowguides() availability fireworks 3. Usage dom.Setshowguides(bshow) arguments bshow if bshow is true , the normal guides are visible. If bshow is false , they are not visible. Returns nothing. Descrip...

  • Page 226

    226 chapter 5: fireworks javascript api arguments bshow if bshow is true , the slice guides are visible. If bshow is false , they are not visible. Returns nothing. Description specifies whether slice guides are visible. Dom.Setshowsliceoverlay() availability fireworks 3. Usage dom.Setshowsliceoverla...

  • Page 227

    Document functions 227 dom.Setsliceexportoptions() availability fireworks 3. Usage dom.Setsliceexportoptions(exportoptions) arguments exportoptions an exportoptions object (see “exportoptions object” on page 46 ). Returns nothing. Description sets the export options for the selected slices. Dom.Sets...

  • Page 228

    228 chapter 5: fireworks javascript api 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() dom.Setslicehtml() availability fireworks 3. Usage dom.Setslicehtml(htmltext) arguments htmltext a string...

  • Page 229

    Document functions 229 arguments bsnap if bsnap is true , the tools snap to the grid. If bsnap is false , they do not. Returns nothing. Description specifies whether tools snap to the grid. Dom.Setsnaptoguides() availability fireworks 3. Usage dom.Setsnaptoguides(bsnap) arguments bsnap if bsnap is t...

  • Page 230

    230 chapter 5: fireworks javascript api dom.Settextalignment() availability fireworks 3. Usage dom.Settextalignment(alignment) arguments alignment acceptable values alignment are "left" , "center" , "right" , "justify" , "stretch" , "vertical left" , "vertical center" , "vertical right" , "vertical ...

  • Page 231

    Document functions 231 arguments bkern if bkern is true , automatic kerning is on for the selected text items. If bkern is false , it is off. Returns nothing. Description specifies whether automatic kerning is on or off for the selected text items. Dom.Settextcharspacing() availability fireworks mx....

  • Page 232

    232 chapter 5: fireworks javascript api dom.Settextcustomantialiassharpness() availability fireworks mx 2004. Usage dom.Settextcustomantialiassharpness(sharpness) arguments sharpness an integer from 0 to 255. Returns nothing. Description sets the sharpness value used to anti-alias text in custom mod...

  • Page 233

    Document functions 233 returns nothing. Description sets the horizontal flow direction of the selected text items. Dom.Settexthorizontalscale() availability fireworks mx. Usage dom.Settexthorizontalscale(horizscale) arguments horizscale a floating-point number that describes how much to scale the te...

  • Page 234

    234 chapter 5: fireworks javascript api dom.Settextonpathmode() availability fireworks 3. Usage dom.Settextonpathmode(mode) arguments mode acceptable values are "rotate" , "vertical" , "skew vertical" , and "skew horizontal" . Returns nothing. Description determines how the selected text-on-a-path i...

  • Page 235

    Document functions 235 returns nothing. Description sets the horizontal/vertical text orientation of the selected text items. Dom.Settextparaindent() availability fireworks mx. Usage dom.Settextparaindent(paraindent) arguments paraindent the number of pixels by which to indent the first line of a pa...

  • Page 236

    236 chapter 5: fireworks javascript api dom.Settextparaspacingbefore() availability fireworks mx. Usage dom.Settextparaspacingbefore(paraspacebefore) arguments paraspacebefore the number of pixels to move down before starting a new paragraph. Returns nothing. Description sets the before-paragraph sp...

  • Page 237

    Document functions 237 arguments mode acceptable values are "paths" and "pixels" . Returns nothing. Description sets the transform mode for the selected text, instance items, or both. Dom.Settextrectangle() availability fireworks 3. Usage dom.Settextrectangle(boundingrectangle) arguments boundingrec...

  • Page 238

    238 chapter 5: fireworks javascript api dom.Settextrectangleautofrompoint() availability fireworks 3. Usage dom.Settextrectangleautofrompoint(anchorpoint) arguments anchorpoint a point that specifies the x,y coordinates of the location at which the text box should be anchored (see “point data type” ...

  • Page 239

    Document functions 239 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. Usage dom.Swapbrushandfillcolors() ...

  • Page 240

    240 chapter 5: fireworks javascript api returns nothing. Description transforms the selection using the specified three-by-three matrix. Dom.Tween() availability fireworks 3. Usage dom.Tween() arguments numsteps an integer that specifies how many new instances are generated. Bdistribute if bdistribu...

  • Page 241

    Fireworks functions 241 dom.Updatesymbol() availability fireworks 3. Usage dom.Updatesymbol(name) arguments name the name of a symbol in the library. If more than one symbol exists with a name of name , then only the first symbol with that name is updated. If null is passed in for name , then all th...

  • Page 242

    242 chapter 5: fireworks javascript api fw.Browsedocument() availability fireworks 3. Usage fw.Browsedocument(url) arguments url the url of the page appear in the browser. Any legal url (including http://, ftp://, and so on) can be passed. Fireworks does not check this argument for syntax; if you pa...

  • Page 243

    Fireworks functions 243 arguments title an optional string that specifies a title for the dialog box that appears. If it is omitted or null , a default title appears. Startfolder an optional string that serves as the root directory for the dialog box that appears. If it is omitted or null , the brow...

  • Page 244

    244 chapter 5: fireworks javascript api fw.Choosebrowser() availability fireworks mx. Usage fw.Choosebrowser(primarybrowser) arguments primarybrowser a boolean value that indicates which browser to select. If primarybrowser is true , fireworks prompts the user to set the primary browser; if the argu...

  • Page 245

    Fireworks functions 245 fw.Closedocument() availability fireworks 3. Usage fw.Closedocument(document, {bprompttosavechanges}) arguments document a document object that specifies the document to close (see “document object” on page 13 ). Bprompttosavechanges an optional boolean argument. If bpromptto...

  • Page 246

    246 chapter 5: fireworks javascript api fw.Createdocumentwithdialog() availability fireworks mx 2004. Usage fw.Createdocumentwithdialog() arguments none. Returns the document object for the newly created document (see “document object” on page 13 ). Description shows the new document dialog box and ...

  • Page 247

    Fireworks functions 247 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() on page 247...

  • Page 248

    248 chapter 5: fireworks javascript api arguments none. Returns nothing. Description turns on debugging messages for flash commands. When flash debugging is enabled, fireworks displays the command string in a dialog box every time a flash command calls mmexecute() . The fw.Enableflashdebugging() fun...

  • Page 249

    Fireworks functions 249 returns a boolean value: true if successful; false otherwise. Description exports the specified document to the specified file as layers to be imported into macromedia director. Fw.Exportdirectorasslices() availability fireworks mx. Usage fw.Exportdirectorasslices(document, f...

  • Page 250

    250 chapter 5: fireworks javascript api description exports the specified document to the specified file. See also fw.Exporthtmlandimages() fw.Exportframes() availability fireworks 4. Usage fw.Exportframes(docobject, directoryurl) arguments docobject a document object that specifies the document tha...

  • Page 251

    Fireworks functions 251 returns a boolean value: true if successful; false otherwise. Description exports one image if the document contains no slice objects and multiple images if the document contains one or more slice objects. It also optionally exports html. The document is exported using the cu...

  • Page 252

    252 chapter 5: fireworks javascript api arguments docobject a document object that specifies the document that contains the layers to export (see “document object” on page 13 ). To export layers from the current document, pass null . Directoryurl the directory in which the images will be placed, whi...

  • Page 253

    Fireworks functions 253 example the photoshop 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. Var prevwarn = fw.Getpref("psdexport_warn100"); // bool fw.Setpref...

  • Page 254

    254 chapter 5: fireworks javascript api example the macromedia 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. Var prevmaintainobjeditable = fw.Getpref("s...

  • Page 255

    Fireworks functions 255 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\currentvers...

  • Page 256

    256 chapter 5: fireworks javascript api fw.Getdocumentdom() availability fireworks 3. Usage fw.Getdocumentdom({which-string}) arguments which-string an optional string that is included for compatibility with dreamweaver. If specified here, it must be "document" . Returns the document object for the ...

  • Page 257

    Fireworks functions 257 returns an array like the one in the following example: [ [ "stroke", "fill", "effect" ], [ "layers", "frames", "object" ], [ "mixer", "options", "swatches", "info" ], [ "styles", "library" ], [ "find", "project log" ], [ "url" ], [ "optimize", "optimized colors" ], [ "behavi...

  • Page 258

    258 chapter 5: fireworks javascript api arguments panelname acceptable values are "find" , "project log" , "object" , "info" , "url" , "effect" , "history" , "mixer" , "fill" , "stroke" , "swatches" , "layers" , "frames" , "behaviors" , "optimize" , "library" , "styles" , "optimized colors" , "optio...

  • Page 259

    Fireworks functions 259 fw.Getnumberoftables() availability fireworks mx. Usage fw.Getnumberoftables(filename) arguments filename the name of the file that contains the tables to be counted. Returns a long integer that represents the number of tables in the document. Description returns the number o...

  • Page 260

    260 chapter 5: fireworks javascript api arguments apppath a file url that specifies the executable to start. Typically, this value can be obtained by calling fw.Findapp() . Filepathstoopen an array of file urls to open in the executable to start. It is safe to pass an empty array. Returns a boolean ...

  • Page 261

    Fireworks functions 261 formatlist a list of acceptable file types to open. The formatlist argument is an array of strings such as the ones shown in the following example: ["formatname1","formatname2","formatname3",…"formatnamen"] the following table lists acceptable values for formatname and the fi...

  • Page 262

    262 chapter 5: fireworks javascript api returns if any of the files can be opened, returns the document object for each file. Returns null if none of the documents can be opened. Description opens the specified files in new document windows. If a file is already open, it opens again; to avoid redund...

  • Page 263

    Fireworks functions 263 allowtransparent a boolean value that lets the user select a transparent color; set to true for transparent, false otherwise. Forceweb216 a boolean value that forces the chosen color to fall within the web216 panel; set to true to force the color change, false otherwise. Retu...

  • Page 264

    264 chapter 5: fireworks javascript api fw.Readnthtable() availability fireworks mx. Usage fw.Readnthtable(filename, tablenumber) arguments filename a fileurl for the file that contains the desired table. Tablenumber a long integer that specifies the desired table; the tables are zero-indexed. Retur...

  • Page 265

    Fireworks functions 265 returns the number of items that are replaced, or –1 if there are items in the document that remain to be searched. Description verifies that the selection matches the current search string and replaces it with the replacement string. See also fw.Setupfindreplace() fw.Replace...

  • Page 266

    266 chapter 5: fireworks javascript api returns nothing. Description restores the specified document to its previously saved version. Fw.Runscript() availability fireworks 3. Usage fw.Runscript(filename) arguments filename the name of the script file to execute. If filename is not a file url (that i...

  • Page 267

    Fireworks functions 267 fw.Savedocument() availability fireworks 3. Usage fw.Savedocument(document, {fileurl}) arguments document a document object, for example, fw.Documents[2] , that specifies the document to be saved. If document is null , the active document is saved. Fileurl the name of the sav...

  • Page 268

    268 chapter 5: fireworks javascript api fw.Savedocumentcopyas() availability fireworks 3. Usage fw.Savedocumentcopyas(document, fileurl) arguments document a document object, for example, fw.Documents[2] , that specifies the document to be saved. If document is null , the active document is saved. F...

  • Page 269

    Fireworks functions 269 fw.Setactiveviewscale() availability fireworks mx. Usage fw.Setactiveviewscale(scale, center) arguments scale a floating-point number where 1.0 is 100%, or normal view, and 1.5 is 150%. Default is 6%. Center a point that defines the location in the document at which the view ...

  • Page 270

    270 chapter 5: fireworks javascript api fw.Setfloatergrouping() availability fireworks 3. Usage fw.Setfloatergrouping(panelnametomove, panelnametoreceive) arguments panelnametomove a lowercase string that specifies the panel to be moved. Panelnametoreceive a lowercase string that specifies the panel...

  • Page 271

    Fireworks functions 271 arguments panelname acceptable values are "find" , "project log" , "object" , "info" , "url" , "effect" , "history" , "mixer" , "fill" , "stroke" , "swatches" , "layers" , "frames" , "behaviors" , "optimize" , "library" , "styles" , "optimized colors" , "options" , and "toolb...

  • Page 272

    272 chapter 5: fireworks javascript api fw.Sethideallfloaters() availability fireworks 3. Usage fw.Sethideallfloaters(bhide) arguments bhide if bhide is true , the panels are hidden. If bhide is false , the panels are visible. Returns nothing. Description shows or hides the panels. This behavior is ...

  • Page 273

    Fireworks functions 273 returns nothing. Description sets up a search. Fw.Togglefloater() availability fireworks 3. Usage fw.Togglefloater(panelname) arguments panelname acceptable values are "find" , "project log" , "object" , "info" , "url" , "effect" , "history" , "mixer" , "fill" , "stroke" , "s...

  • Page 274

    274 chapter 5: fireworks javascript api description replaces selected primitive objects with their equivalent paths. The new objects have all the attributes (mask, stroke, fill, and so on) of the replaced ones. See also dom.Addnewrectangleprimitive() fw.Updatehtml() availability fireworks 4. Usage f...

  • Page 275

    Property inspector functions 275 returns nothing. Description writes out the panel states (location, size, open or closed, and so on), toolbox state, and property inspector state to an xml file that is specified by the argument. Fw.Yesnodialog() availability fireworks mx. Usage fw.Yesnodialog(prompt...

  • Page 276

    276 chapter 5: fireworks javascript api returns nothing. Description opens the property inspector. Fw.Hidepiwindow() availability fireworks mx. Usage fw.Hidpiwindow() arguments none. Returns nothing. Description makes the property inspector window invisible. Fw.Ispiexpanded() availability fireworks ...

  • Page 277

    Property inspector functions 277 arguments none. Returns a boolean value: true if visible; false otherwise. Description determines whether the property inspector window is currently hidden or shown. Fw.Growpiwindow() availability fireworks mx. Usage fw.Growpiwindow() arguments none. Returns nothing....

  • Page 278

    278 chapter 5: fireworks javascript api fw.Setpiposition() availability fireworks mx. Usage fw.Setpiposition(pt) arguments pt a point in screen coordinates. Returns nothing. Description moves the upper left corner of the property inspector window to the specified location. Fw.Getpiposition() availab...

  • Page 279

    History panel functions 279 arguments none. Returns nothing. Description clears the undo and redo stack. Fw.Historypalette.Copysteps() availability fireworks 3. Usage fw.Historypalette.Copysteps(array of indexes) arguments array of indexes a zero-based array that specifies which steps from the histo...

  • Page 280

    280 chapter 5: fireworks javascript api fw.Historypalette.Getstepcount() availability fireworks 3. Usage fw.Historypalette.Getstepcount() arguments none. Returns the number of steps in the history panel (not a zero-based value). Description gets the number of steps in the history panel. Fw.Historypa...

  • Page 281

    History panel functions 281 returns the string to use with fw.Historypalette.Setundostate() . Description returns a string that indicates the current undo state to be used for later calls to fw.Historypalette.Setundostate() . This string is designed to be used internally by fireworks only and might ...

  • Page 282

    282 chapter 5: fireworks javascript api arguments array of indexes indicates which steps from the history panel should be saved. For example, to save the first, third, and sixth steps in the history panel, pass [ 0 , 2 , 5 ]. If this argument is null , the currently selected steps are used. Filename...

  • Page 283

    Using the common api 283 description performs the correct number of undo or redo operations to arrive at the selected state. See also fw.Historypalette.Getundostate() using the common api you can use the common macromedia api if you want commands to use a common syntax (and thus run a single command...

  • Page 284

    284 chapter 5: fireworks javascript api.

  • Page 285: Index

    285 index a actionscript 90 cross-product extensions 77 addbehavior() 104, 105 addelementmask() 109 addframes() 109 addguide() 110 addnewhotspot() 110 addnewimage() 111, 112 addnewimageviacopy() 111 addnewimageviacut() 112 addnewlayer() 112 addnewline() 113 addnewoval() 113 addnewrectangle() 114 add...

  • Page 286

    286 index clipcopyaspaths() 126 clipcopyformats() 127 clipcut() 127 clippaste() 127 clippasteasmask() 128 clippasteattributes() 129 clippastefromchanneltochannel() 129 clippasteinside() 130 cloneselection() 131 close() 131 closedocument() 245 color string 11 colors, finding and replacing 21 common a...

  • Page 287

    Index 287 dom.Applyfontmarkup() 122 dom.Applystyle() 123 dom.Arrange() 123 dom.Attachtexttopath() 124 dom.Changeguide() 124 dom.Changesliceguide() 125 dom.Clearjpegmask() 125 dom.Clipcopy() 126 dom.Clipcopyaspaths() 126 dom.Clipcopyformats() 127 dom.Clipcut() 127 dom.Clippaste() 127 dom.Clippasteasm...

  • Page 288

    288 index dom.Moveselectiontoframe() 170 dom.Moveselectiontolayer() 171 dom.Moveselectiontonewlayer() 171 dom.Pathcrop() 172 dom.Pathexpand() 172 dom.Pathinset() 172 dom.Pathintersect() 173 dom.Pathpunch() 173 dom.Pathsimplify() 174 dom.Pathunion() 174 dom.Previewinbrowser() 174 dom.Rebuildcolortabl...

  • Page 289

    Index 289 dom.Setguidecolor() 213 dom.Sethotspotalttag() 213 dom.Sethotspotcolor() 214 dom.Sethotspotrectangle() 214 dom.Sethotspotshape() 215 dom.Sethotspottarget() 215 dom.Sethotspottext() 215 dom.Setlayerdisclosure() 216 dom.Setlayerlocked() 217 dom.Setlayername() 217 dom.Setlayersharing() 218 do...

  • Page 290

    290 index egenericerroroccurred 17 egroupdepth 17 eillegalthreadaccess 17 einternalerror 17 element object 39 elementmask object 45 elements, changing 10 elementsat() 144 elowonmem 17 enableelementmask() 145 enableflashdebugging() 247 enabletextantialiasing() 145 end-of-line character 12, 19 enddrag...

  • Page 291

    Index 291 fw and fireworks class names 241 fw.Browsedocument() 242 fw.Browseforfileurl() 242 fw.Browseforfolderurl() 242 fw.Browsehelp() 243 fw.Checkfwjsversion() 243 fw.Choosebrowser() 244 fw.Choosescripttargetdialog() 244 fw.Closedocument() 245 fw.Createdocument() 245 fw.Createdocumentwithdialog()...

  • Page 292

    292 index gethideallfloaters() 258 gethtmlfileforscript() 258 getnumberoftables() 259 getpiposition() 278 getpixelmask() 153 getpref() 259 getrootdirectory() 283 getselection() 279 getselectionbounds() 153 getshowgrid() 153 getshowrulers() 154 getsnaptogrid() 154 getstepcount() 280 getstepsasjavascr...

  • Page 293

    Index 293 mergedown() 163 metafile.Htt 64 methods,global 12 mm_nbgroup (down) 105 (highlight) 106 (image) 106 (out) 107 mm_simplerollover 107 mm_statusmessage 107 mm_swapimage 108 mm_swapimgrestore 108 mmendcommand() 91 mmexecute() 90 modifypointonpath() 163 motionblurselection() 164 movebezierhandl...

  • Page 294

    294 index pathcrop() 172 pathexpand() 172 pathinset() 172 pathintersect() 173 pathpunch() 173 pathsimplify() 174 pathunion() 174 pattern object 55 photoshop document, exporting as 252 pngtext 16 point 11 popupcolorpicker() 262 popupcolorpickerovermouse() 262 previewinbrowser() 174 primitive 115 prom...

  • Page 295

    Index 295 selectinverse() 190 selectnone() 190 selectparents() 190 selectsimilar() 191 selectsimilarfrompoint() 191 sendemail() 192 set 79 setactiveviewscale() 269 setactivewindow() 269 setalllayersdisclosure() 193 setaniminstanceloopcount() 193 setaniminstancenumframes() 193 setaniminstanceoffsetdi...

  • Page 296

    296 index setsnaptogrid() 228 setsnaptoguides() 229 setsymbolproperties() 229 settextalignment() 230 settextantialiasing() 230 settextautokern() 230 settextcharspacing() 231 settextcustomantialiasoversample() 231 settextcustomantialiassharpness() 232 settextcustomantialiasstrength() 232 settextflow(...