Using External Libraries; About External Libraries - Adobe GoLive CS2 Programmer's Manual

Hide thumbs Also See for GoLive CS2:
Table of Contents

Advertisement

A

Using External Libraries

Adobe GoLive CS2 SDK extensions can call JavaScript and C functions provided by one or more optional
external libraries. Similarly, external JavaScript and C libraries can interoperate with the JavaScript
environment GoLive provides. This appendix describes how to create and use external libraries:

About External Libraries

You can provide function definitions in an external file written in JavaScript, C, or C++.
You can simply include an
of the <script> tag.
An external library written in C must be compiled specifically for the Mac OS or Windows platform on
which it is to run. The compiled library is called an
The use of an external library is entirely optional. Most extensions do not use an external library. The only
time an extension actually requires the use of an external binary is when it must perform tasks for which
JavaScript is not suitable, such as hiding the implementation of the code. However, extensions often use
external libraries for other benefits they offer, such as:
Convenience of Reuse
If you have a common set of functions you would like to use in multiple extensions, you can package
them in an external library that all of the extensions can call, rather than duplicating them in the source
code of each extension that uses them.
Reduced Code Size
Using external libraries can reduce an extension's source code size, although it does not reduce the
extension's overall memory requirements—every module loads its own copy of the library when
GoLive starts.
C-language Programming and Performance Improvements
If you prefer to program in C, an external binary library provides a means of doing so.
Because compiled code runs faster than interpreted code, you may realize performance improvements
by implementing some functions in C rather than in JavaScript.
Implementation Hiding
JavaScript provides no data-hiding capabilities. To hide the implementation of proprietary code, you
can implement it in C as a compiled external library.
Cross-Platform Deployment of Compiled Code
External libraries enable you to deploy C functions to GoLive extensions running on Mac OS and
Windows platforms. It is possible to create platform-independent source code from which you can
build a platform-specific binary file for each supported platform.
external JavaScript library
in your extension's code, using the src attribute
external binary
library.
178

Advertisement

Table of Contents
loading

Table of Contents