JavaScript is a common coding language for interactivity on the Web and elsewhere. For example, ActionScript, Flash's coding language, is an implementation of JavaScript. As well, Macromedia Director MX 2004, has added JavaScript as a coding alternative to its native object-oriented language, Lingo. It should not come as any great surprise, then, to discover you can write your own JavaScript code to drive many of the interactive objects and features of this application, providing the movie is destined for playback through a browser.
1. | Open a movie and double-click the slide to which a button or box will be added. The Edit View panel opens. |
2. | Add a click box, button, or text entry box. |
3. | Click the properties tab for your object and select the JavaScript option to determine what happens if the user clicks inside or outside of the box. |
4. | Click the Change button (it has three dots). The JavaScript dialog box opens. |
5. | Enter the JavaScript into the text box. |
6. | Click OK. The JavaScript dialog box closes. |
7. | Determine what happens, including using JavaScript, if the user clicks outside of the object. |
8. | Click OK. |
You can add JavaScript to objects that have already been added to a slide. Simply double-click the object and, when the object's dialog box opens, select JavaScript from the Success or Failure areas. Then enter or copy and paste the JavaScript into the JavaScript dialog box.