The Fireworks CS5 Object Model

The Fireworks CS5 Object Model | If you want to enlarge the functionality of Adobe Fireworks CS5 by modifying a JavaScript extensibility file, you have to become recognizable with the objects that Fireworks makes obtainable through JavaScript. The hierarchy of these objects contains the Fireworks Object Model, which includes the following main components:
  1. 6 global techniques that are accessible from any part of the application and need not be declared as methods of a particular object. see "Global Methods on Adobe Fireworks"
  2. Core objects: Dialogs, Document, pngText, Errors, Files, Find, and System.
  3. The Fireworks object
  4. Numerous objects connected with Fireworks documents, such as ExportOptions, Guides, Path, Image, and Text.
  5. A set of objects that you can use to identify the format of HTML code when exporting from Fireworks.
Using the Fireworks Object Model

When scripting extensions for Fireworks, you write JavaScript commands that send calls to the Fireworks Object Model to decide or modify the current settings for a Fireworks document. For illustration, the following command calls the Fireworks object (fw) to obtain the path to the Export Settings directory (appExportSettingsDir), which is expressed as a file://URL.

In other words, fw references the Fireworks global object, of which appExportSettingsDir is a property (for more information, see “The Fireworks Object” on page 191), so a JavaScript command can assign the resulting value to a variable, as follows:
var expSetDir = fw.appExportSettingsDir;

Accessing a Fireworks document

All the functions listed in “Property inspector functions” on page 321 are techniques of the Document object, which symbolized a Fireworks document. To execute a function on a Document object, you must first get the Document Object Model (DOM) of the document. You then call the functions as methods of that DOM.

When accessing a Fireworks document, think about the following points:
  1. To use a DOM function with a document other than the active document, use the following syntax; note that documentIndex is a zero-based index that specifies which document the command will affect.
  2. fw.documents[documentIndex].functionName();
  3. To use a DOM function with the active document, use fw.getDocumentDOM().functionName() (for more information, see fw.getDocumentDOM()).



You are now reading an article/news about The Fireworks CS5 Object Model, and you can find this article (The Fireworks CS5 Object Model) with this url "http://fireworkslovers.blogspot.com/2010/12/fireworks-cs5-object-model.html". If you like, you can bookmark this article "The Fireworks CS5 Object Model", and dont forget to bookmark it with this link : The Fireworks CS5 Object Model.

No comments:

Subscribe via email

Enter your email address:

Delivered by FeedBurner