Adding JavaScript to Extend Functionality


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.

To add JavaScript to a box or a button

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.

Tips

  • The example shown earlier in Figure 7.14 is very basic. You can copy and paste complex code into the JavaScript input box from other sources, such as word processing applications.

  • 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.




Macromedia Captivate for Windows. Visual QuickStart Guide
Macromedia Captivate for Windows. Visual QuickStart Guide
ISBN: 321294173
EAN: N/A
Year: 2003
Pages: 130

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net