Working with Sprites
You begin to construct a Director movie by dragging cast members from the Cast window. You can drop a cast member into a channel in the Score, or you can drop it on the Stage.
What you're actually dropping on the Stage or in the Score is not the cast member itself, but a reference to the cast membera marker that points back to the original that's stored in the Cast window. This reference to the original cast member is known as a sprite .
You can create multiple sprites in your movie based on the same cast member. Every sprite has its own properties, which may be different from those of the original cast member. Except in the case of text, changing a sprite's properties does not alter the cast member ( Figure 3.8 ).
Figure 3.8. The sprite on the Stage has been flipped horizontally and rotated , but these changes in the sprite's properties do not affect the original cast member.
Dragging a visual cast member to the Score or the Stage causes a sprite to appear both in the Score and on the Stage. On the Stage, the sprite looks like the original cast member. In the Score, the sprite takes the form of a colored line spanning a range of frames ( Figure 3.9 ). But both are the same sprite. The Stage and the Score just provide two different ways of looking at the sprite.
Figure 3.9. The same sprite is represented in the Score as a colored line spanning a range of frames.
To create a sprite in the Score:
Select one or more cast members ( Figure 3.10 ).
Figure 3.10. To create a sprite in the Score, you must first select one or more cast members.
Drag the cast-member selection to a cell in the Score.
As you drag, Director outlines the range of cells where sprites will be created ( Figure 3.11 ). Director outlines only cells that can accommodate your cast members (sounds can be dragged only to cells in the sound channels, for example) ( Figure 3.12 ).
Figure 3.11. As you drag the cast-member selection into the Score, Director outlines the range of cells where sprites will be created.
Figure 3.12. The new sprites appear in the Score. Director is smart enough to drop sounds in the sound channel.
When you release the mouse button, images of any visual cast members you dragged to the Score appear in the center of the Stage ( Figure 3.13 ).
Figure 3.13. Visual cast members dragged into the Score appear at the center of the Stage.
To create a sprite by dragging cast members to the Stage:
Select one or more cast members.
In the Score, click the frame in which you want to place a sprite or group of sprites.
Drag the cast-member selection from the Cast window to the Stage ( Figure 3.14 ).
Figure 3.14. Drag cast members to the Stage.
Your new sprites appear in the Score ( Figure 3.15 ). Images of any visual cast members that were part of your selection appear stacked on the Stage in the location you dragged them to ( Figure 3.16 ).
Figure 3.15. The new sprites appear in the Score.
Figure 3.16. Visual cast members appear on the Stage at the location to which they were dragged.
Because a sprite is not a copy of a cast member, but simply a reference to it, sprites take up barely any disk space or memory. Adding cast members to a movie may greatly increase a movie's file size , but adding sprites will not.
Adjusting sprite duration
Each new sprite you create has a default duration of 28 frames. You can change this default to any number of frames you like.
To change the default sprite duration:
Choose Edit > Preferences > Sprite (Windows), or Director > Preferences > Sprite (Mac).
The Sprite Preferences dialog box opens ( Figure 3.17 ).
Figure 3.17. The Sprite Preferences dialog box.
Enter a value for the Span Duration option.
Choose Width of Score Window to have new sprites span the width of the Score.
Check the Terminate at Markers checkbox to have each new sprite end one frame before the next marker. (See "Setting Markers" later in this chapter for details on using markers.)
Flash Talk: Sprite vs. Instance
A sprite in Director is roughly equivalent to an instance of a symbol in Flash. The main difference is that in Director, a sprite may refer to a representation either on the Stage or in the Score. In Flash, only the image on the Stage is called an instance; there's no equivalent term for the frames that the instance occupies in the timeline.
The first frame of a sprite is called a keyframe, represented in the Score by a small circle. (You'll learn about the significance of keyframes in the next chapter.) The last frame of a sprite is indicated by a rectangle ( Figure 3.18 ). The first and last frames are connected by a solid line.
Figure 3.18. The first frame of a sprite is a keyframe, represented by a circle. The last frame of the sprite is represented by a rectangle. (The rectangle will change to a circle if the sprite is tweened. You'll find out about tweening in the next chapter.)
To select an entire sprite:
In the Score, the selected portions of a sprite appear in a darker color. If you intended to select the entire sprite, but most of the sprite still appears in a light color , chances are that you accidentally clicked the keyframe or end frame.
To select one frame in a sprite:
Alt+click (Windows) or Option+click (Mac) the desired frame within the sprite in the Score ( Figure 3.20 ).
Figure 3.20. Select an individual frame in a sprite by Alt+clicking it (Windows) or Option+clicking it (Mac).
Move the playhead in the Score to the desired frame, then Alt+click (Windows) or Option+click (Mac) the desired sprite on the Stage.
If the single frame you want to select is a keyframe or end frame, simply click that frame in the Score. You don't need to hold down the Alt or Option key while you click.
To select individual frames in a sprite without Alt+clicking or Option+clicking, see "To make sprite frames individually editable" later in this chapter.
To select multiple frames within a sprite in the Score:
To select multiple sprites:
Flash Talk: Spanning Frames
In Flash, if you want to place an instance of a symbol on the Stage for multiple frames, you must complete three steps: inserting a keyframe, dragging the symbol to the Stage, and inserting an end frame. In Director, the equivalent operation requires only one step: dragging a cast member to the Stage or to the Score. Director automatically inserts a keyframe, an end frame, and 26 intermediate frames.
Moving sprites within the Score
There are two main reasons why you might want to move a sprite within the Score. To make it appear earlier or later in the movie, you move it horizontally to a lower- or higher-numbered frame. To move the sprite farther from or closer to the foreground of the Stage, you move it vertically to a lower- or higher-numbered channel in the Score. (See "To change the order of overlapping sprites" later in this chapter).
To move a sprite to a new location in the Score:
In the Score, click a sprite ( Figure 3.22 ).
Figure 3.22. Click a sprite.
Drag the sprite to a new frame and/or channel in the Score.
Director outlines the new range of frames for the sprite ( Figure 3.23 ).
Figure 3.23. When you drag the sprite to a new frame and/or channel,you'll see an outline of the new range of frames.
Release the mouse button to place the sprite in the outlined frames.
You can also move sprites in the Score by cutting and pasting.
To cut and paste sprites in the Score:
In the Score, select the sprite or range of sprites.
Choose Edit > Cut Sprites, or Edit > Copy Sprites.
Click the cell in the Score where you want to paste the sprite selection.
Choose Edit > Paste Sprites.
If the placement of the sprite selection threatens to overwrite any existing sprites, the Paste Options dialog box appears.
If the Paste Options dialog box appears, make one of the three choices and then click OK ( Figure 3.24 ).
Figure 3.24. Specify in the Paste Options dialog box how sprites should be pasted.
The third option in the Paste Options is Insert Blank Frames to Make Room. If this is the option you want, you can accomplish the same thing (without seeing the dialog box) by choosing Edit > Paste Special > Insert.
To delete a sprite selection instead of moving it, choose Edit > Clear Sprites in step 2, and ignore the remaining steps.
To reposition a sprite on the Stage:
Select an entire sprite in the Score.
The sprite is highlighted in the Score and on the Stage ( Figure 3.25 ).
Figure 3.25. Selecting a sprite in the Score also highlights it on the Stage.
Drag the sprite to its new position on the Stage ( Figure 3.26 ).
Figure 3.26. Drag the sprite to its new location on the Stage.
This step repositions the entire sprite (all of the frames in its span).
To change the length of a sprite's span:
To extend a sprite:
Select a sprite in the Score ( Figure 3.29 ).
Figure 3.29. Select a sprite.
Click the number of the frame to which you want to extend the sprite ( Figure 3.30 ).
Figure 3.30. In the frame-number bar, click the frame in which you want the extended sprite to end.
Director repositions the playhead in the selected frame.
Choose Modify > Extend Sprite.
Director extends the sprite to meet the playhead ( Figure 3.31 ).
Figure 3.31. After you choose Modify > Extend Sprite, the sprite extends to meet the playhead.
Joining and dividing sprites
It's sometimes convenient to join several short sprites into one long sprite, or to divide one long sprite into several shorter sprites.
To join sprites:
Select two or more sprites in the Score.
The sprites can have gaps between them, but they must all occupy the same channel ( Figure 3.32 ).
Figure 3.32. In a single channel of the Score, select the sprites that you want to join.
Choose Modify > Join Sprites.
The sprites merge into a single sprite ( Figure 3.33 ).
Figure 3.33. The sprites merge into a single sprite.
To split a sprite:
In the Score, click a frame within a sprite ( Figure 3.34 ).
Figure 3.34. Click the frame in a sprite where you want the division to take place.
The playhead jumps to the frame that you clicked.
Choose Modify > Split Sprite.
The sprite divides into two new sprites, dividing at the location of the playhead ( Figure 3.35 ).
Figure 3.35. The sprite divides in two.
To make sprite frames individually editable:
In the Score, click a sprite.
Choose Edit > Edit Sprite Frames.
The appearance of the sprite changes from a continuous span to a series of individual boxes. Now when you click a frame within the sprite, only that single frame is selected ( Figure 3.36 ).
Figure 3.36. The boxy appearance of this sprite shows that its frames have been made individually editable by means of the Edit Sprite Frames command. A single frame of the sprite (frame 11) is selected; the rest remain unselected .
To insert frames into the Score:
Click the frame in the Score where you want to insert one or more frames.
Choose Insert > Frames.
The Insert Frames dialog box opens ( Figure 3.37 ).
Figure 3.37. In the Insert Frames dialog box, type the number of frames you want to insert into the Score.
Enter the number of frames to insert.
If the frame you select contains sprites, Director inserts frames into each sprite, moving their end frames farther to the right. If the frame you select coincides with a keyframe in any sprite, new keyframes are inserted for those sprites.
To remove a frame from the Score:
Click the single frame that you want to remove ( Figure 3.38 ).
Figure 3.38. Click the single frame you want to remove.
Note that the selected frame will be removed from sprites in all channels.
Choose Insert > Remove Frame.
If any sprites span this frame, they are effectively shortened by one frame ( Figure 3.39 ).
Figure 3.39. The frame is deleted.
When sprites overlap on the Stage, the sprite in the higher-numbered channel appears in the foreground ( Figure 3.40 ).
Figure 3.40. When sprites overlap on the Stage, the sprite in the highest-numbered channel appears in the foreground.
If you are animating a character walking down a street, for example, the character may appear to walk in front of buildings ( Figure 3.41 ) but behind parked cars , street lamps, and signposts.
Figure 3.41. Here, the sprite of a car is in the foreground, the woman is in the middle ground, and the buildings are in the background.
To change the order of overlapping sprites:
In the Score, select a sprite to be moved toward the foreground or the background of the Stage ( Figure 3.42 ).
Figure 3.42. Select a sprite to move forward or backward.
Choose Modify > Arrange, and select the appropriate command from the pop-up menu ( Figure 3.43 ).
Figure 3.43. Use the Modify > Arrange menu to change the order of overlapping sprites.
Bring to Front places the selected sprite in front of all other sprites. Move Forward places the sprite one step closer to the foreground. The other two commands accomplish the opposite tasks .
Using Modify > Arrange sometimes leads to undesirable consequences when the sprites being rearranged are of different lengths. Longer sprites may be split into segments residing in different channels. To avoid these problems, it's often more convenient to move sprites to higher- or lower-numbered channels simply by dragging them.