Adobe GoLive CS2 Programmer's Manual page 25

Hide thumbs Also See for GoLive CS2:
Table of Contents

Advertisement

SDK Programmer's Guide
The following example shows very simple implementations of the initializeModule , startModule , and
terminateModule functions.
// Main.html file for Hello example
<html>
<body>
</body>
</html>
In this example, the initializeModule and startModule functions simply display messages in the
JavaScript Debugger window before the extension runs. The body of these functions consist of a writeln
statement that uses the name property of the module object to identify the currently executing extension.
When you start GoLive and it loads this extension (along with all other extensions), the text is displayed in
the Output panel in the GoLive JavaScript Debugger or in the ExtendScript Toolkit:
For the terminateModule function, you might not see such a display before GoLive quits. To make sure
you see this message, the example function displays the text in a user alert like this one:
To do this, the function uses a globally available static function of the Window class:
function terminateModule() {
}
GoLive does not unload this extension and complete the exit process until you click
dialog.
<jsxmodule name="HelloModule" debug>
<script>
// functions that provide your extension's behavior go here
function initializeModule() {
writeln ("Loading the " + module.name + " extension.");
}
function startModule() {
writeln ("Starting the " + module.name + " extension.");
}
function terminateModule() {
Window.alert ("Unloading the " + module.name + "extension.")
}
</script>
// Tags that define your extension's data go here.
Window.alert ("Unloading the " + module.name + "extension.")
Adobe GoLive CS2
How to Create an Extension
in the user alert
OK
25

Advertisement

Table of Contents
loading

Table of Contents