home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeWeb Design in a NutshellSearch this book

26.8. Adding Shockwave Movies to a Web Page

<> Like Flash, Director Shockwave files are added to an HTML document with the <embed> or <object> tags. Internet Explorer for Windows uses the <object> tag, which enables them to automatically download the ActiveX controls for playing Shockwave media. Netscape Navigator for Windows and all Mac browsers recognize the <embed> tag. To code your page so it is accessible to the maximum number of users, use a combination of the <embed> and <object> tags.

The easiest way to place a Shockwave movie in an HTML document is to rely on Director's Publish feature to generate the code for you. The following sample code shows the minimal code for placing the .dcr file on the page and redirecting the browser to missing plug-ins or ActiveX controls

<OBJECT CLASSID="clsid:166B1BCA-3F9C-11CF-8075-444553540000"
    CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/
    director/sw.cab#version=8,0,0,0"
    ID=mymovie WIDTH=640 HEIGHT=480>
<PARAM NAME=src VALUE="mymovie.dcr">

   <EMBED SRC="$MO" WIDTH=$WI HEIGHT=$HE TYPE="application/x-director"
   PLUGINSPAGE="http://www.macromedia.com/shockwave/download/"></EMBED>

</OBJECT>

The width and height values are mandatory and specify the dimensions of the movie in pixels. Note that the values for classid, codebase, and pluginspage must be copied exactly as shown above in order to work correctly.

Within the Publish Settings dialog box, there are a number attributes and parameters settings for controlling the display of control buttons with the movie, how the movie scales in the browser, and dozens of other functions. A complete list of the parameters (and attributes) are listed on the Macromedia web site at http://www.macromedia.com/support/director/how/shock/objembed.html.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.