Working with Video Sprites

   

Working with Video Sprites

You place a video cast member in your movie by dragging it to the Stage or Score, just as you would any cast member. Thereafter, you can treat it as you would any other sprite. Though you can't rotate or skew a digital video sprite, you can move it, resize it, or tween it ( Figure 10.9 ). You can also apply ink effects to it or change its blend percentage, unless the Direct to Stage option is selected (see "Setting Digital Video Properties," later in this chapter). Be aware that doing any of these things may take a toll on playback performance. (See the sidebar "Reducing Processor Load with Video Sprites" later in this chapter.)

Figure 10.9. As you can see by its motion path , this video sprite has been tweened across the Stage.

graphics/10fig09.gif

To understand the behavior of a video sprite in a Director movie, it's useful to think of the sprite as a little TV set. When you tween the sprite or change its properties, you're affecting only the TV setyou're not changing what's playing on the TV screen. If what's playing on the TV is a 60-minute videotape, the running time of the tape will always be 60 minutes, regardless of whether the TV gets moved around, gets bigger or smaller, or is taken out of the room.

The same is true of the video content of your sprite. Every video cast member that you import has a specific duration. When you drag the cast member to the Stage, you create a sprite. You can keep the sprite on the Stage for as many or as few frames as you want, and do whatever you want with it during that time, but the duration of the sprite's video content will always be the same.

When you play a tape in a VCR, you can continue to watch the tape until the TV is turned off or the tape runs out, whichever comes first. The same is true in Director. When the playhead enters a video sprite in the Score, the sprite's video content begins to play. It continues to play until either the playhead leaves the sprite or the duration of the video file is reached, whichever comes first.

The relationship between the time-based content of a video sprite and the frame-based Score can sometimes be complex. The following are examples of the more common tasks that you might want to accomplish with video sprites. In some cases, the behavior of the video sprite may not be what you expect, but it will begin to make more sense after some experimentation.

To display a video sprite for a fixed amount of time (regardless of the length of its content):

  1. Decide how long you want the sprite to remain on the Stage.

    For this example, let's assume you want the sprite to be visible for 3 seconds.

  2. Multiply the number of seconds from step 1 by the current tempo of the movie. (See "Setting a Movie's Tempo" in Chapter 5)

    Let's assume the current tempo is 10 frames per second (fps). In that case, 3 times 10 equals 30.

  3. Extend the video sprite in the Score to span the number of frames you arrived at in step 2.

    In this case, you'd make the video sprite 30 frames long.

  4. Play the movie.

    When the playhead enters the video sprite, the sprite appears on the Stage, shows 3 seconds of video content, then disappears.

    If the sprite's video file has a duration of more than 3 seconds, only the first 3 seconds of the content is seen ( Figure 10.10 ).

    Figure 10.10. A 3-second sprite in a movie whose tempo is 10 fps. If the sprite's video file is 6 seconds long, only half of the video content will be seen.

    graphics/10fig10.gif

    If the sprite's video file has a duration of less than 3 seconds, the content of the video file is seen in its entirety. For the remainder of the time, the last frame of the video file is displayed in the sprite ( Figure 10.11 ).

    Figure 10.11. A 3-second sprite in a movie whose tempo is 10 fps. If the sprite's video file is 1 second long, the video content will be seen in its entirety, followed by 2 seconds in which the video file's last frame is displayed in the sprite.

    graphics/10fig11.gif

To loop a sprite's video content (QuickTime and AVI only):

  1. In the Score, extend the sprite so that its duration is longer than that of the sprite's video content.

    The longer the sprite, the more times the video content will repeat.

  2. In the Cast window, select the cast member represented by the video sprite.

  3. In the Property Inspector, click the QuickTime tab (for a QuickTime cast member) or the AVI tab (for an AVI cast member).

  4. Select the Loop option in the Property Inspector ( Figure 10.12 ).

    Figure 10.12. The Loop option on the QuickTime tab in the Property Inspector. (This option is also available on the AVI tab).

    graphics/10fig12.gif

  5. Play the movie.

    The sprite's video content loops repeatedly for as long as the sprite is on the Stage ( Figure 10.13 ).

    Figure 10.13. A 3-second sprite in a movie whose tempo is 10 fps. If the sprite's video file is 1 second long, and the Loop option is selected, the video content will play 3 times.

    graphics/10fig13.gif

To make a sprite's video content play through just once:

  • For a QuickTime or AVI sprite:

    In the Score, place a Wait for Cue Point command in the tempo channel in the video sprite's last frame ( Figure 10.14 ). (See the "Using Cue Points" sidebar in Chapter 5.)

    Figure 10.14. This Wait for Cue Point command will cause the Director movie to pause until the video sprite has played in its entirety.

    graphics/10fig14.jpg

    or

  • For any type of video sprite:

  1. Find out the duration of the video cast member in either of the following ways.

    • Open the cast member's linked external file in an external player (such as the QuickTime Player, the RealOne Player, or the Windows Media Player) and read the duration from the player's display.

    • If the cast member is a RealMedia cast member, select it in the Cast window and read the duration from the RealMedia tab in the Property Inspector ( Figure 10.15 ).

      Figure 10.15. The duration of the selected cast member can be found on the RealMedia tab of the Property Inspector.

      graphics/10fig15.gif

  2. Multiply the duration of the video file (in seconds) by the tempo of the Director movie (in frames per second) to get the number of frames the video sprite needs to span in the Score.

  3. Extend the sprite in the Score to span the number of frames you arrived at in step 2.

graphics/tick.gif Tip

  • Remember that Director movies often play at less than the intended tempo. Therefore, don't design your movie with the expectation that the length of a sprite will correspond exactly with the duration of a video file. If you do need the sprite to disappear precisely when the video content ends, use a cue point.


Reducing Processor Load with Video Sprites

If the mere presence of a video sprite on the Stage puts a heavy load on the computer's processor, changing any of the sprite's propertiesparticularly its dimensions increases those processing demands significantly. If your movie is played on an insufficiently powerful computer, its playback tempo may slow drastically, and the video itself may hesitate and sputter.

You can reduce the processor load in the following ways:

  • Eliminate unnecessary property changes. (For example, keep the video sprite at its actual size instead of resizing it on the Stage.)

  • Eliminate unnecessary tweening.

  • Use video files with smaller dimensions (for example, 240 by 180 pixels instead of 320 by 240).

  • Have only one video sprite on the Stage at a time.

  • Use the Direct to Stage option (see "Setting Digital Video Properties" on the following page).

   


Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
ISBN: 1847193439
EAN: N/A
Year: 2003
Pages: 139

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