Streaming is the process that allows users to view the beginning of a movie (or hear the beginning of a sound) while the rest of it downloads from the Web. Streaming greatly improves the viewing/listening experience by engaging the user right from the start. Unfortunately, though any Shockwave movie can technically be made to stream, not every Shockwave movie works well as a streaming movie. A streaming Shockwave movie downloads in two stages. The Score and Lingo scripts, which comprise a relatively small amount of data, are downloaded first. Then the cast members are downloaded, one by one, in the order in which their sprites appear in the Score. Here's where the problems come in: Unless you specify otherwise , a streaming movie begins to play as soon as the Score and Lingo information has been downloaded. The Shockwave Player then plays every frame of the movie, regardless of whether the necessary cast members have had a chance to download. If a sprite is supposed to appear on the Stage, but its cast member hasn't been downloaded yet, users see a big empty space where the sprite should have been ( Figure 17.49 ). Figure 17.49. If the cast members needed for a frame haven't been downloaded by the time the Shockwave Player arrives at the frame, the movie gets played without them. One way to make sure the necessary cast members are present is to use the "Download __ Frames Before Playing" feature in the Movie Playback Properties dialog box. (See "To convert a movie into a streaming Shockwave movie," later in this section.) This feature causes the movie to delay playing until the specified number of framesincluding their cast membersis downloaded. For example, if all of the cast members for the first part of the movie appear in the first 10 frames, you might set the number of frames to 10. The drawback to this option is that the user is stuck looking at an empty screen and a progress bar while he or she waits for the specified number of frames to download. (Depending on the size of the cast and the speed of the Internet connection, this wait might be anywhere from a few seconds to a few minutes.) Therefore, many Shockwave movie authors use a different strategy: They construct their movie so that the introductory portion is relatively simple, requiring only a few very small (primarily vector or text) cast members. These cast members can be downloaded very quicklyperhaps in the first frameand can hold the viewer's attention while the cast members for the remainder of the movie are being downloaded ( Figure 17.50 ). Figure 17.50. Many Shockwave movies begin with a short, quickly downloadable scene called a preloader that lets the user know that the main part of the movie is about to begin. The preloader loops continuously while other cast members are being downloaded. To make this strategy work, Director's Library palette offers an assortment of behaviors to control the loading of cast members in a streaming movie ( Figure 17.51 ). These behaviors are of two types: Figure 17.51. These behaviors are available in the Library palette to control the loading of cast members in a streaming movie. -
Loop: These behaviors cause the Shockwave movie to loop back to a particular frame (the current frame, the first frame of the movie, or anything in between) until a specified condition is met. That condition could be that a certain cast member has been downloaded, or that all the cast members for a particular frame have been downloaded. You can attach one of these behaviors to the last frame of your introductory sequence, allowing the sequence to repeat as many times as necessary until the next portion of the movie is ready to be seen. -
Jump: These behaviors cause the Shockwave movie to jump to a particular frame when a specified condition is met. (The conditions are similar to those used with the "loop" behaviors.) If you attach a "jump" behavior to the last frame of your introductory sequence, the movie will pause at that frame until the next portion of the movie is ready to be played. Of course, it's also possible to write your own behaviors that will detect when certain cast members are downloaded and direct the movie accordingly . Analyze the Lingo in the supplied behaviors and use that as your starting point. To convert a movie into a streaming Shockwave movie: -
Open the movie in Director. -
Choose Modify > Movie > Playback. The Movie Playback Properties dialog box opens ( Figure 17.52 ). Figure 17.52. The Movie Playback Properties dialog box is where you set streaming options for a movie. -
Select the Play While Downloading Movie check box. This check box is essentially the on/off switch for streaming. When it's selected, streaming is turned on for the movie. -
Type a value in the Download __ Frames Before Playing field to specify the number of complete frames to download before starting to play the movie ( Figure 17.53 ). Figure 17.53. Type the number of frames that you want the Shockwave Player to download before the movie starts to play. If you enter 5, for example, your movie starts playing after all the cast-member mediaboth internal and linkedused in the first five frames of the score have completely downloaded. By default, this value is set to 1 frame. You'll have to experiment to find the best value for each movie. (See the "Tips for Effective Streaming" sidebar.) -
Choose the Show Placeholders option if you want rectangular placeholders to appear in place of cast members that have not yet been downloaded ( Figure 17.54 ). Figure 17.54. If you choose the Show Placeholders option, placeholders like this one appear in place of cast members that have not yet been downloaded. These placeholders are useful for testing streaming movies, but you probably don't want them to show up in a movie that anyone will actually see. -
Save the movie. -
Follow the steps in "To convert a movie to Shockwave format," earlier in this chapter, to publish the Shockwave movie. To loop or pause a movie until specific cast members have been downloaded: -
Open the movie in Director ( Figure 17.55 ). Figure 17.55. In this example, we want the playhead to loop between frames 1 and 8 until the large cast member in frame12 is loaded, then we want it to begin playing Scene 1. -
Choose Window > Library Palette to display the Library palette. -
Choose Internet > Streaming from the Library List pop-up menu. -
Decide which of the streaming behaviors is most appropriate for the situation: -
Loop Until Next Frame is Available causes the playhead to loop back repeatedly to a specified frame until all cast members required for the next framethat is, the frame following the one to which the behavior has been assignedhave been downloaded. -
Loop Until Member is Available causes the playhead to loop back repeatedly to a specified frame until a cast member you specify has been downloaded. -
Loop Until Media in Frame is Available causes the playhead to loop back repeatedly to a specified frame until all cast members required for another specified frame have downloaded. -
Loop Until Media in Marker is Available causes the playhead to loop back repeatedly to a specified frame until all cast members required by frames between the marker you specify and the next marker have been downloaded. -
Jump When Member is Available causes the playhead to pause at a specified frame until a cast member you specify has been downloaded. -
Jump When Media in Frame is Available causes the playhead to pause at a specified frame until all cast members required for another specified frame have downloaded. -
Jump When Media in Marker is Available causes the playhead to pause at a specified frame until all cast members required by frames between the marker you specify and the next marker have been downloaded. -
Drag the desired behavior from the Library palette to the Score, and drop it in the appropriate frame in the script channel. If you're using a "loop" behavior, drop it in the later of the two frames between which you want the playhead to loop ( Figure 17.56 ). Figure 17.56. The Loop Until Media in Frame is Available behavior is dropped into the script channel in frame 8 (the last frame in the looping sequence). If you're using a "jump" behavior, drop it in the frame at which you want the playhead to pause. A Parameters dialog box appears. -
Set the parameters for the behavior ( Figure 17.57 ). Figure 17.57. These parameters will cause the playhead to loop back to frame 1 repeatedly until the cast members for frame 12 are loaded, and then continue playing the movie. -
Click OK to close the dialog box. -
If you haven't already done so, follow the steps in the preceding task, "To convert a movie into a streaming Shockwave movie." Tips for Effective Streaming If you're creating a streaming Shockwave movie, careful planning can increase its chances of streaming smoothly: -
Try to prevent users from jumping far ahead in a movie. If you're using scripts or behaviors to jump around in the scorebecause you're offering navigational controls to the user, for examplerestrict the user to short hops. Because Director downloads cast-member data in frame order, a sudden jump over many frames means waiting for all intervening cast members to load, even if the users never see those cast members. -
Don't waste pixels. Make sure the dimensions of your bitmapped cast members are no larger than they'll be when the bitmap appears on the Stage. If possible, scale and crop each image in Photoshop before importing it into Director. -
Avoid using large sound filesloop small ones instead. -
Where possible, create motion by means of tweening rather than frame-by-frame animation, to limit the number of cast members that must be downloaded. -
"Recycle" cast members to reduce file size. For example, if your movie includes several buttons , use one cast member for all the button sprites and superimpose different text on each sprite. If your movie includes a cloudy sky, make multiple sprites from a single cloud cast member, and rotate and skew each one to make them look different. -
If your movie requires large, memory-hungry cast members, such as QuickTime movies or 32-bit bitmaps, start the movie with a simple scene that uses compact cast members; then use one of Director's streaming behaviors to loop the scene until the bigger media have downloaded fully. The looping scene can entertain the user immediately while the movie continues to load in the background. -
Instead of looping, you can try to time animations using the tempo channel to allow the process of downloading media to stay ahead of the end of the animation sequence. Estimating the time required is guesswork, but you can safely assume that a 56K modemwhich is the slowest Internet connection that members of your audience are likely to havedownloads at an average rate of at least 4 kilobytes per second. This means that if you have 40 kilobytes' worth of compressed cast-member media to download for the next scene, you try to make the current animated sequence about 10 seconds long. -
Experiment with the Download __ Frames Before Playing value in the Movie Playback Properties dialog box to find a reasonable compromise between streaming and letting the user wait for downloading. If the value is too low, too many sprites will be missing from your movie. If the value is too high, the user may give up and surf elsewhere. | |