The Nature of Class Files


The Dreamweaver API, as you should know by now, includes a wide range of custom JavaScript objects for handling different scripting tasks . From the dw and dom objects, which we've been using throughout this book, to the site object, to much more specialized objects such as SWFFile and FWLaunch , there are dozens of custom objects comprising thousands of methods and properties to help us extend Dreamweaver functionality.

In addition to these objects that are built into the API, however, the Macromedia engineers have used JavaScript to write a whole series of custom object classes that build on the API. These classes are defined in JavaScript files in the Configuration/Shared folder, with the most commonly used files being found in the Configuration/Shared/Common subfolder. The dwscripts .js file, for instancewhich we have used throughout this bookdefines the dwscripts class to hold its utility functions. Link your extension file to this file, and access the dwscripts utilities at will.

This chapter focuses on using classes that extend our ability to control the interfaces of our extensions. These include ListControls, ImageButtons, and TabControls.

SHARE-IN-MEMORY and Shared JavaScript Files

Some of Macromedia's shared JavaScript filessuch as dwscripts.js and most of the class filesinclude a directive as the first line of the file: //SHARE-IN-MEMORY=true . This directive means that, once any HTML extension file links to that file and uses any of its contents, that JavaScript file is stored in memory until the next time the user quits Dreamweaver. Any other HTML extension file can then reference functions and variables stored in that JavaScript file without explicitly linking to it (without having to include the <script src="... etc... "></script> tag in its code). So, strictly speaking, you don't have to link to commonly used shared files like dwscripts.js or ListControlClass.js before using their utility functions or implementing ListControl elements. Just remember, thoughevery time the user launches Dreamweaver, the first HTML extension to need the shared JavaScript file must explicitly link to it; just in case your extension is first in line to use the shared functionality, it's safer to always add the <script src="etc"></script> tag to your extension files whenever you want to use shared files. The purpose of the SHARE-IN-MEMORY directive is to speed up Dreamweaver rather than to save you the trouble of creating links.



Dreamweaver MX Extensions
Dreamweaver MX Extensions
ISBN: 0735711828
EAN: 2147483647
Year: 2001
Pages: 141
Authors: Laura Gutman

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net