Articles Archive
Articles Search
Director Wiki
 

Loading a Shockwave game

January 15, 1998
by Pat McClellan

Dear Multimedia Handyman,

Could you please tell me...how do you get the blinking loading game to show up while you are waiting for a Shockwave game to load? I checked the doc source for the html page, and it's a standard embed src tag for the .dcr. I have seen this done so many times and I have no idea?

Thanks,
Marcia Ganeles


Dear Marcia,

This is actually pretty easy. The first thing to explain is what exactly is going on when you see that "Loading Game..." -- instead of the standard Shockwave logo. As you observed, there's nothing special in the tag. What you're actually seeing is 2 dcrs. Here's how it works.

You need <a href='http://www.macromedia.com/shockwave/'>ShockWave</a> 6 to view this movie!

When the browser is loading the plug-in, you typically see some blank space in the browser window, which coincides with the size of the Shockwave movie. Actually, it coincides with the dimensions specified in the tag, not the stage size of the dcr. So, even though Director constrains you to horizontal dimensions which are multiples of 16, you can control exactly how much of that stage is shown with the dimensions you specify in the html tag. Note: this doesn't scale your movie, it crops it.

After the browser loads the plug-in, it immediately starts displaying that standard Shockwave logo while your dcr loads from the server. You can alter the appearance of that logo (to blend with your page better) by using the BGCOLOR attribute in your tag. For example, if your page background is #0000FF, then put BGCOLOR="#0000FF" inside your embed tag.

The length of time that the logo is displayed depends on how fast your movie loads. And that's the key to what you're asking. (With the streaming technology which is built into Shockwave now, that time can be pretty minimal, depending on how you have your settings.)

Let's say that your dcr is 100K, which should generally take over 30 seconds to load over a 28.8 modem. You don't want your user staring at the Shockwave logo for that period of time, you'd rather have them see your company logo, or simply a screen that says "Game Loading...". What you need to do is create a tiny dcr with nothing but "Game Loading..." displayed, and a script that says gotoNetMovie "mygame.dcr". When I say "tiny", I mean small file size -- not stage size. The dimensions of this "loader.dcr" should be the same as the larger game movie. The dcr of my loader is 2516 bytes -- smaller than many gif images. It could be even smaller without the simple animation I inserted. I've provided the loader.dir file for download (HQX or ZIP).

Your html tag needs to call the loader.dcr, with no concern for the mygame.dcr. (The game gets called from loader.) Now, what will happen is that the generic Shockwave logo will be displayed, but only briefly while the tiny loader.dcr is loaded. You'll have complete control over the logo or "Game Loading" image.

Patrick McClellan is Director Online's co-founder. Pat is Vice President, Managing Director for Jack Morton Worldwide, a global experiential marketing company. He is responsible for the San Francisco office, which helps major technology clients to develop marketing communications programs to reach enterprise and consumer audiences.

Copyright 1997-2024, Director Online. Article content copyright by respective authors.