Adobe 65011817 Extended User Guide - Page 11
Fireworks Object Model calls and API calls, Formatting nonstandard data types
UPC - 883919157368
View all Adobe 65011817 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 11 highlights
Last updated 12/8/2009 EXTENDING FIREWORKS 7 The Fireworks Object Model fw.documents[2].brushes[4].shape = "square"; The preceding example includes the following properties: • documents is a property of the Fireworks object and contains an array of Document objects. • brushes is a property of the Document object and contains an array of Brush objects. • shape is a property of the Brush object. Note: Throughout this manual, optional arguments are enclosed in {braces}. Fireworks Object Model calls and API calls In some cases, you can use Fireworks Object Model calls or API calls to perform the same operations. In other cases, a certain function might be available in either the Fireworks Object Model or the API, but not in both. For example, if the first open document is the current document, the first code fragment has the same effect as the second and third code fragments. The fw.getDocumentDOM() function references the current document (for more information, see "Accessing a Fireworks document" on page 6). fw.getDocumentDOM().setDocumentResolution({pixelsPerUnit:72, units:"inch"}); fw.documents[0].resolution =72; fw.documents[0].resolutionUnits ="inch"; 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 objects. For more information, see "The Fireworks Object Model" on page 6. • Some functions accept a string in a specific format. Others accept value types that are not Fireworks objects but are JavaScript object types that are specific to Fireworks. These types of arguments are described next, in alphabetical order. Color string data type Functions that accept colors as arguments use the HTML syntax "#rrggbb". You can specify a color with an alpha (transparency) component by passing a longer string of the form "#rrggbbaa". Mask data type The format for a mask is {maskBounds:rectangle, maskKind:string, maskEdgeMode:string, featherAmount:int, maskData:hex-string}. • maskBounds specifies the bounding rectangle of the mask area. • Acceptable values for maskKind are "rectangle", "oval", "zlib compressed", "rle compressed", or "uncompressed". • If the value of maskKind is "rectangle" or "oval", the maskData string is ignored, and a mask of the right shape is constructed that fills maskBounds and that has the edge specified by maskEdgeMode and featherAmount. • If the value of maskKind is "zlib compressed", "rle compressed", or "uncompressed", the maskData string is presumed to contain 8-bit mask data in hexadecimal format that precisely matches the maskBounds to define the mask.