Action Tutorials; Tutorial 1: Customizing The Actions Inspector - Adobe GoLive CS2 Programmer's Manual

Hide thumbs Also See for GoLive CS2:
Table of Contents

Advertisement

SDK Programmer's Guide

Action Tutorials

The following sections guide you through the process of modifying and creating actions. These tutorials
show you how to:
Customize the action inspector for an existing action.
Create an action that will load the previous page in the browser.
Create an action that will resize the browser window to dimensions specified by the GoLive user in the
action Inspector.
For the last two tutorials, you can create actions in two ways:
Using an existing action file. First you duplicate and rename an existing action file, make changes and
save the file, and then place the action file in an appropriate Actions subfolder.
Using a template action file (a template file, JScripts\Template\Template.action , is included
in GoLive). Duplicate and rename the template, make changes, and place it in an appropriate Actions
subfolder.

Tutorial 1: Customizing the Actions Inspector

You can customize this Inspector further by adding additional elements. To see how this works, make a
copy of the Open Alert Window.action file in the same Actions\Messages folder and name it
test.action . Now open the file in GoLive where you will alter its contents. (If you already have it open
from the previous examples, simply Save As under the new name in the
Modules\JScripts\Actions\Message subfolder.)
Click on the field containing the text "Message". Sizing handles will appear on the text and an Inspector
will pop up. Notice the Inspector lists this as an Info Text item with a name of "Message". The name of the
item is the text displayed in the layout. You can change the text displayed in the action layout by changing
its name. If you look at the corresponding source code, you will see that "Message" is the value of the
value attribute of a csactioncntrl tag.
Now click on the entry field containing "msg" and see that this is listed in the Inspector as a Param Name
with a name of "msg". This parameter name must correspond to the name of a csactionparam tag. In
this case there is only one csactionparam tag in the file, and it has this name. If you look at the source
code for this entry field, you will see that " msg " is the value of the name attribute of a csactioncntrl
tag. If you look at the source code for the csactionparam tag, you will see that its name attribute is also
" msg ".
Note:
The Inspector field labeled "Name" corresponds to a csactioncntrl tag's name attribute for
Param Name fields and to the value attribute for Info Text and Static Text fields.
The Param Name makes the connection between the field and the csactionparam tag. The Inspector for
the csactionparam tag shows the name of the tag, "msg", identifies it as a string parameter, and sets a
default value. Anything entered by the GoLive user in this field of the Inspector will become an array value
which gets passed to the JavaScript code. In this example, any string entered here can be referenced in the
script by the array value action[1] .
Now expand the layout grid vertically so that it measures about 75 pixels high. Ctrl-click (Windows) or
Option-click (Mac OS) on the "Message" text and drag it to the bottom of the grid to make a duplicate
copy. Note that you must duplicate these elements to ensure that they are formed using
csactioncntrl tags; you cannot just drag in a new text box.
Adobe GoLive CS2 SDK
Extending GoLive Actions
165

Advertisement

Table of Contents
loading

Table of Contents