Specifying Scripts
You can specify scripts that will be triggered when specific events occur on an object.
- Click Selection Tool
on the Tool Palette.
- 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.
- Click Add
on the Script tab of the Interactivity window.
- Select the desired event and enter the desired script in the Add Script dialog box and click OK.
- Input the script.
- A script icon will appear to the right of the object’s name in the Layers window.
-
Example of a path object with a script applied:
If a script has more than one line in it, end each line with a semicolon (;).
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.)