by William Hurley

Creating Sites Using Macromedia Template Movies

I have received quite a few questions about what's the quickest way to add some Shockwave Audio to a site. This week we'll take a look at the quickest way I know of, through the Macromedia template movies. Included with the Shockwave download from the Macromedia site are a pair of template movies. These template movies include sample HTML pages and the Director files to which they make calls. These provide some excellent examples of the streaming capabilities of Shockwave Audio as well as create a great starting point for creating your own movies.

About the Segments of the Macromedia Template Movies

The .SWA Files
These files are referenced by the template movies and were originally exported from SoundEdit 16. These .SWA files will stream to any 28.8 modem or faster connection, and most have been compressed to deliver a 16 kbps stream rate.

The Player Example
The Player example includes the Player.html, Player.dcr, and Player.dir files.

The Player.html file is an HTML page that displays a Director movie that plays an .SWA sound file from a predefined URL specified in the HTML. This URL could have been hard-coded into the shocked movie, but then the original (unburned) movie would have to be edited and reprocessed through Afterburner every time the URL needed to be changed. Additionally, if multiple pages each need to play a unique song, then multiple versions of the movie would need to be created from scratch, causing far more repetition than I could stand. Instead, the movie is designed to read in the URL for the desired .SWA sound from the EMBED tag in the HTML document.

This movie includes an autoplay mode accessible through the EMBED tag. If the EMBED tag has the sw2=1 tag specified, the movie starts playing immediately after it loads into the client-side browser. Using the EMBED tag in this fashion allows a single .DCR movie to be placed on a server, where any number of HTML pages can refer to it. Each page will be able to play its unique song by specifying its own EMBED tag in the HTML code.

Several versions of the HTML page are included with the Macromedia examples. Each page provides a different look for the same movie. Because of the variations in the HTML pages, different functionality appear available to the end-user. The five HTML pages provide the following looks:

Player.html
Displays all elements of the player.

Player2.html
Eliminates the volume controls.

Player3.html
Eliminates the volume controls and the song name display. This look is recommended for a page where the song name is already displayed.

Player4.html
Displays only the Shockwave logo. The end-user can click on the logo to stop and restart the streaming sound.

1by1.html
Displays no user interface. This look simply auto streams a sound. It is recommended for a greeting message when the page is opened.

You will find the source code for Director movies of both template movies (Player.dir and 1by1.dir) is included so Shockwave authors can see examples of how Lingo can be used to control a streaming cast member or to get information (properties) about the streaming cast member.

Try working with the template movies this week and see what you can turn out. Again, if you have any questions just ask and I'll be more than happy to help out with anything that I can.

Past installments of Simply Shocking

http://www.internet.com/