Specifying Scripts


You can specify scripts that will be triggered when specific events occur on an object.

  1. Click Selection Tool Namo WebCanvas icon toolpalette select Specifying Scripts on the Tool Palette.
  2. On the Canvas, select the object to which you want to attach a script. If you want to attach a script to the document, click on an empty part of the canvas.
  3. Click Add Namo WebCanvas icon lib add Specifying Scripts on the Script tab of the Interactivity window.
  4. Select the desired event and enter the desired script in the Add Script dialog box and click OK.
     Namo WebCanvas script jsfile define 3 Specifying Scripts
  5. Input the script.
     Namo WebCanvas wc action Specifying Scripts
  6. A script icon will appear to the right of the object’s name in the Layers window.
  7. Example of a path object with a script applied:
    Namo WebCanvas script define 1 Specifying Scripts

Namo WebCanvas reference Specifying Scripts If a script has more than one line in it, end each line with a semicolon (;).

Namo WebCanvas reference Specifying Scripts Scripts only work when a document is saved in the SVG format. You can check if a script works by selecting the [View > Preview SVG in Browser] menu command. (Your browser must have the SVG Viewer installed.)

Namo WebCanvas top Specifying Scripts

Specifying Scripts