Add a Script Action to an Object

A Script action can be added to any object that appears on a page. Like any other action, a Script action must be assigned to a trigger; for example, a script may be triggered by a Left Mouse Click trigger or an On Show trigger. Any object that contains a Script action can also contain other actions; a Script action can also be part of a simultaneous action.

To add a Script Action to an Object

  1. Select the object on the page – the bounding box will surround it.

  2. Open the object’s Actions dialog by double right-clicking on the object.

  3. Select the Trigger for this action e.g. if you want the script to run when the left-mouse button is clicked, double click the Left Mouse Click icon in the Trigger tab of the Actions dialog.

  4. Select the Programming tab in the Actions dialog and highlight the Script icon in the Programming menu.

  5. Click and drag the Script icon over to the Trigger in the left-hand column, alternatively double-click on the Script icon. The Script icon will be added underneath the Trigger and a new Script tab will appear after the Programming tab.

  6. Select the Script tab, if it is not already selected, and type your script in the Script Editor window.

Note:
Certain commonly used functions can be quickly inserted using the EasyCode drop down box. Select the code from the drop down list and then press the image\EasyCode_Button.jpg button to place it at the current cursor position. This will place a skeleton code with the correct syntax so that you can quickly and appropriately complete it.

  1. When you have completed your script, press the Apply button to save the changes.

Note:
The script will only be run when the action is triggered.

Related Topics:

Add a Script Object to a page

Script Objects versus Script Actions