Releasing Memory; Handling Events - Adobe GoLive CS2 Programmer's Manual

Hide thumbs Also See for GoLive CS2:
Table of Contents

Advertisement

SDK Programmer's Guide
To set the global variable, type the following into the command line:
myGlobal = "Hartford, Hereford, and Hampshire."
Then run the function from the command line:
fabFour();
The function prints the changed string to the output window, using the new value of the global variable.
You might think you could access another module's variable by evaluating module.var or some similar
JavaScript expression, but it is not that simple. You can use the
extensions if necessary, although most extensions do not need to do so; see

Releasing Memory

For optimum performance, you should release unused memory as soon as possible. You can set unneeded
JavaScript variables to null to make them available for garbage collection.
Before it unloads your extension, GoLive calls the
outside the JavaScript environment, your implementation of this function can be used to release them.

Handling Events

GoLive 8 implements a WC3-compliant event-handling mechanism, which defines event objects of various
types which encapsulate information about events, and event targets, GoLive objects in which events can
occur. The following GoLive objects act as event targets:
app
module
document
box
menu
menuItem
window
control
Each of these objects inherits the
for a type of event that can occur in that object. When the event occurs in that object, your handler is
passed a single argument, one of the
event, such as where and when it occurred.
For example, a menuSignal event can occur in a menuItem object, and you can register a handler for
that event that responds to the selection of a menu item that your extension added. Your handler is
passed a
Your handlers for the
functionality. See
examples.
Register handlers with the
Register handlers with the
opens or creates a new document.
Terminating the GoLive application generates the
handler for this event to do any cleanup that your extension requires.
menuEvent
object.
menuSignal
Chapter 4, "Menus and
document Object
app Object
Adobe GoLive CS2 SDK
terminateModule
function, which allows you to register a handler
addEventListener
Event Object
Types, which encapsulates information about the
and control events such as
Toolbars" and
for document events such as
for the
opened
appterm
The JavaScript Environment
common Object
to share data among
Sharing
function. If you allocate any resources
onClick
will implement much of the UI
Chapter 5, "Windows and
selection
and
new
events, which occur when the user
event in the
app
Object. You can register a
32
Data.
Controls," for
and save.

Advertisement

Table of Contents
loading

Table of Contents