Javascript Source For Actions; Layout Grid - Adobe GoLive CS2 Programmer's Manual

Hide thumbs Also See for GoLive CS2:
Table of Contents

Advertisement

SDK Programmer's Guide
Parameter type
GLActionSceneParam
GLActionStringParam
GLActionURLParam

JavaScript Source for Actions

The JavaScript source icon in Layout view represents the JavaScript code in the .action file that is
executed by the action when it is triggered by the specified event. To edit the JavaScript, double-click the
icon to open the script editor and show the source code.
You can include any number of JavaScript code snippets in this area, either by creating your own or by
including some of the .scpt files included in the Actions folder.
The OpenAlertWindow.action example uses this function:
function CSOpenAlert(action) {Window.alert(action[1]); }
The .action file includes the file name of the JavaScript file that actually contains this code,
OpenAlertWindow.scpt . The function name used in the script must be identical to the function name
specified in the <csactionclass> tag's function attribute, in this case, " CSOpenAlert ".
This function calls the
action[1] for the message, you pass the value of the first data input field in your action — in this case it
is the text in the "msg" box that is specified by the type="GLActionStringParam" parameter of the
<csactionparam> tag.
In this example, a <csactionparam> of type GLActionStringParam identifies a single parameter,
named msg . The <csactioncntrl> tag with the same name in the layout grid specifies the display of
the user input field for the msg string parameter.
According to the order of the csactionparam tags, the input parameters become array elements which
can be referenced by their array element number in any function. The first array element, action[0]
(JavaScript is zero-based), refers to the function itself and should not be used. Thus, an action with four
csactionparam tags for four user parameters would use action[1] – action[4] to reference the
parameters.

Layout Grid

The layout grid defined in the .action file provides a way to edit or customize the parameter entry
controls for your custom actions (created by the <csactionparam> tag). The box object in this layout grid
has the same name as the parameter whose value it sets.
Adobe GoLive CS2 SDK
Description
Popup menu that lists all
scenes (Timeline) of the
current document
Editable text field
Control to define a URL
Window
Class's static alert method to display the alert box. By specifying
Extending GoLive Actions
Action Palette Component
Example:
Multimedia\Play Scene.action
Example:
Message\Open Alert Window.action
Example:
Image\Set Image URL.action
163

Advertisement

Table of Contents
loading

Table of Contents