Scripting Your Own Actions

In addition to the actions NetObjects Fusion provides in the Message menu, experienced JavaScript programmers can script their own actions.

  1. In Page view, select the object you want to trigger the scripted action, and click the plus (+) button on the Actions tab of the Properties palette.

The Set Action dialog appears.

  1. Select Scripted Action from the action type drop-down list.

A text box appears in the dialog.

  1. Enter your scripted action in the text box using JavaScript.

NetObjects Fusion doesn’t verify code you enter, so be sure to use valid syntax. You can use any combination of typing, inserting existing script text from a text file (click Insert Script and open the file from the File Open dialog), or inserting a call to an existing action or function.

To insert a call to an existing action, click Insert Action. A list of the actions you added to the object appears. Select an action to insert and click OK. NetObjects Fusion inserts the action at the insertion point in the text box, in the form $(ActionName).

  1. Click OK in the Set Action dialog.

Note:
If you’re scripting an action and need to define JavaScript functions or other parameters, insert the defining script into the Between Head Tags field of the Layout HTML or Master HTML as appropriate.