• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Lesson 14. Fonts and Menus > Animating with Blends

Animating with Blends

Now that you have the text cast member created, you need to place it on the stage. Rather than just having it appear, you will use the Blend setting for the sprite.

Click channel 3, frame 126, of the score. Drag the ExitText cast member from the cast to the upper right of the stage.

The ExitText sprite now appears at frame 126, the frame following the frame location where the other two sprites have reached their final positions.

Extend the ExitText sprite out to frame 170.

Figure .

The black text on the white background is a lot less subtle than other elements of the project. In keeping with the overall theme, you will change the foreground and background colors of the sprite so that the text is white on a black background.

With the ExitText sprite selected, use the foreground color chip to set the foreground color to white. Use the background color chip to set the background color to black.

As you learned earlier in this lesson, you can set foreground and background colors using the color chips in the tool palette, the Property Inspector, or the sprite toolbar.

Figure .


Setting foreground and background colors works well with text, field, and shape sprites, but you need to be careful about applying the foreground and background colors to bitmap sprites. Setting the foreground and background colors of bitmap sprites with a color depth greater than 1-bit can lead to unpredictable results, such as unpredictable coloring. Setting the background color to match a sprite's background, as you did earlier in this lesson, will generally work. For anything more complicated, you may find it better to modify the artwork rather than attempt to use foreground and background coloring.

Choose Modify > Sprite > Tweening.

The Sprite Tweening dialog box opens. The top seven check boxes determine which sprite properties Director will automatically tween. By default, all of the check boxes are selected.

Figure .

Make sure the Blend box is selected. Click OK to close the Sprite Tweening dialog box.

Now Director will automatically tween blend values that are set for the keyframes of a sprite. A blend value controls a sprite's transparency—that is, the degree to which the background shows through the sprite. For example, when a sprite's blend value is 80%, you see 20% of the background showing through the sprite.

When a sprite's blend value is 100%, no background shows through; when a sprite's blend value is 0%, the sprite is no longer visible, and you see just the background. By starting a sprite's blend value at 0% and tweening it over a range of frames to 100%, you can make the sprite appear to fade onto the stage.

In the next steps, you'll insert a keyframe in the ExitText sprite and set blend values for the keyframes to produce the fade-in effect.

Click frame 165 of the ExitText sprite and then choose Insert > Keyframe (Windows Ctrl+Alt+K, Macintosh Command+Option+K).

This is the frame at which you want the sprite to be fully visible. In the sprite toolbar at the top of the score (or in the Property Inspector), notice the blend percentage in the menu to the right of the Ink menu. It shows 100% as the blend for the sprite in the keyframe.

Figure .

To start the fade-in, you will set the blend value at the keyframe at the beginning of the ExitText sprite.

Click frame 126 of the ExitText sprite—make sure that only the keyframe is selected. On the sprite toolbar (or in the Property Inspector), select the blend percentage value, type 0, and press Enter (Windows) or Return (Macintosh).

In frame 126, the first frame of the sprite, the sprite will start out entirely invisible. Note that the blend value pull-down menu has no zero setting, so that you need to type the 0 setting to make the image completely transparent.

Between frames 126 and 165, Director automatically assigns various blend percentages to each frame of the sprite to create the fade-in effect. To see these percentages, you need to use the Sprite Overlay since the Property Inspector and sprite toolbar donshow intermediate values for blends. With the Sprite Overlay visible (choose View > Sprite Overlay > Show Info), click any frame in the sprite between the keyframes you've inserted and inspect the blend value.

The blending of the ExitText sprite is done over a longer range of frames than the animation because the eye and brain see changes in brightness differently than they do animation of location. The brain seems to fill in the steps for location animation to smooth it out. For brightness, the eye tends to be drawn to the jumps, which makes them more apparent.

That should be about it for the sprites visible on the stage. Next you need to provide a means of getting to the Exit scene. That requires a modification of the behavior attached to the Exit button back on the main menu screen. Just as you did previously for the other menu items, you will add the ability to navigate when the mouse is clicked on the Exit item.

Select the ExitDim sprite in channel 10, between frames 15 and 28, to select the entire sprite. Click the Behavior Inspector button on the sprite toolbar or on Director's toolbar.

The Behavior Inspector window opens and shows the events currently handled by the behavior attached to the sprite. You need to add a mouseUp event.

Figure .

Open the Events menu and choose mouseUp. Open the Actions menu and choose Navigation > Go To Marker.

The Specify Marker dialog box appears.

Select Exit as the marker and then click OK to close the Specify Marker dialog box.

Now when the user clicks the Exit menu item, the movie will branch to the Exit marker and the Exit scene.

Figure .

Close the Behavior Inspector. Save your work and then play the movie. Use the Exit menu item to branch to the Exit scene.

The movie stops at frame 170 (unless you have looping on), and if the movie were not running in the authoring environment, the stage would disappear and the user would not have time to read the text. You need to set a tempo to cause the movie to wait for 4 or 5 seconds to give the reader time to view the scene, and then you need to halt the movie. A little music through the Exit scene would also be nice.

Double-click the tempo channel at frame 169 to open the Tempo Frame Properties dialog box. Click the Wait radio button and set the wait period to 5 seconds. Click OK to close the dialog box.

Double-click the behavior channel at frame 170 to open up the Script window. On the middle line, type the command halt. Close the Script window.

Now the movie will halt when it leaves this frame, even if you have looping turned on.

Figure .

Drag the WaterLOOP cast member, member 30, from the Cast to frame 105 of sound channel 1. Extend the sprite's end frame to frame 170.

To ensure that the sound will play for the number of frames it is spanning, you need to make sure that the sound will automatically loop on itself.

With the WaterLOOP sprite selected, click the Property Inspector button. Click the Sound tab and make sure the Loop check box is selected.

Now if the sound reaches its end before the sprite does, the sound will begin playing over again from the beginning. This is a useful technique to provide sound in a movie while keeping the file size to a minimum.

Figure .

Save your work and play the movie again.

Now the user will have time to read the text, and the sound will provide an extra element to round out the scene.


Fade-in and fade-out effects can ease viewers in and out of scenes and add extra depth to a movie. However, blending can be a processor-intensive operation and should be used sparingly. Director builds each frame as the playback head move through the movie. This means that each time you run the movie, Director needs to determine the requirements for each frame. If you use blending, Director must also determine the amount of blend, the color depth, and other color information for each frame. Because Director is busy with all these calculations, less processing power is available for other work, which slows down animation or anything else you've added to the frames where the blend is being tweened. The frames of the Exit screen that involve blending, however, contain only the one image that is changing, so blending will not noticeably slow the display of the frames.

A good technique for handling this processing problem is to apply the blend and then export the frames from Director to PICT images or to QuickTime movies. Then you can reimport the images and replace the sprites you originally blended with the pictures of the blend. Director can display pictures much more quickly than it can display sprites with blend values.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint