Working with Sprites

   

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.

graphics/03fig08.gif

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.

graphics/03fig09.gif

To create a sprite in the Score:

  1. 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.

    graphics/03fig10.gif

  2. 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.

    graphics/03fig11.gif

    Figure 3.12. The new sprites appear in the Score. Director is smart enough to drop sounds in the sound channel.

    graphics/03fig12.gif

    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.

    graphics/03fig13.gif

To create a sprite by dragging cast members to the Stage:

  1. Select one or more cast members.

  2. In the Score, click the frame in which you want to place a sprite or group of sprites.

  3. Drag the cast-member selection from the Cast window to the Stage ( Figure 3.14 ).

    Figure 3.14. Drag cast members to the Stage.

    graphics/03fig14.gif

    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.

    graphics/03fig15.gif

    Figure 3.16. Visual cast members appear on the Stage at the location to which they were dragged.

    graphics/03fig16.gif

graphics/tick.gif Tip

  • 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:
  1. 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.

    graphics/03fig17.gif

  2. Enter a value for the Span Duration option.

    or

    Choose Width of Score Window to have new sprites span the width of the Score.

  3. 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.

Selecting sprites

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.)

graphics/03fig18.gif

To select an entire sprite:
  • Click the horizontal line ( not the keyframe or end frame) within a sprite in the Score ( Figure 3.19 ).

    Figure 3.19. Click the horizontal line within a sprite to select the entire sprite.

    graphics/03fig19.gif

    or

    Click the sprite on the Stage.

graphics/tick.gif Tip

  • 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).

    graphics/03fig20.gif

    or

    Move the playhead in the Score to the desired frame, then Alt+click (Windows) or Option+click (Mac) the desired sprite on the Stage.

graphics/tick.gif Tips

  • 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:
  • Ctrl+Alt+click (Windows) or Command+Option+Click (Mac) to select multiple nonadjacent frames.

    or

    Shift+Alt+click (Windows) or Shift+Option+click (Mac) to select a continuous range of frames.

To select multiple sprites:
  • Drag to select multiple sprites either in the Score ( Figure 3.21 ) or on the Stage.

    Figure 3.21. select multiple sprites in the Score. (You can do this on the Stage as well.)

    graphics/03fig21.gif

    You need not enclose a sprite completely within the selection rectangle to select all of it.

graphics/tick.gif Tip

  • You can select a continuous range of sprites in the Score by clicking the first sprite and then Shift+clicking (Windows) or Command+clicking (Mac) the last sprite. Ctrl+click (Windows) or Command+click (Mac) to select multiple sprites that are not adjacent.


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:
  1. In the Score, click a sprite ( Figure 3.22 ).

    Figure 3.22. Click a sprite.

    graphics/03fig22.gif

  2. 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.

    graphics/03fig23.gif

  3. 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:
  1. In the Score, select the sprite or range of sprites.

  2. Choose Edit > Cut Sprites, or Edit > Copy Sprites.

  3. Click the cell in the Score where you want to paste the sprite selection.

  4. Choose Edit > Paste Sprites.

    If the placement of the sprite selection threatens to overwrite any existing sprites, the Paste Options dialog box appears.

  5. 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.

    graphics/03fig24.gif

graphics/tick.gif Tips

  • 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:
  1. 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.

    graphics/03fig25.gif

  2. 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.

    graphics/03fig26.jpg

    This step repositions the entire sprite (all of the frames in its span).

graphics/tick.gif Tip

  • You can reposition selected frames of a sprite. First, select sprite frames (as described in "To select one frame in a sprite" earlier in this chapter); then reposition the sprite.


To change the length of a sprite's span:
  • Drag the first or last frame of the sprite to a new frame ( Figure 3.27 ).

    Figure 3.27. Change a sprite's span by dragging the frame at either end.

    graphics/03fig27.gif

graphics/tick.gif Tip

  • You can also change a sprite's span by entering new values in the Start or End fields in the Sprite toolbar, or in the Sprite tab of the Property Inspector ( Figure 3.28 ). (See "To toggle the display of the Sprite toolbar" later in this chapter.)

    Figure 3.28. Change a sprite's span by entering new values in the Sprite toolbar or the Property Inspector.

    graphics/03fig28.gif


To extend a sprite:
  1. Select a sprite in the Score ( Figure 3.29 ).

    Figure 3.29. Select a sprite.

    graphics/03fig29.gif

  2. 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.

    graphics/03fig30.gif

    Director repositions the playhead in the selected frame.

  3. 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.

    graphics/03fig31.gif

graphics/tick.gif Tip

  • You can use the same process to shorten a sprite. Click a frame within the sprite to reposition the playhead where you want the sprite to end. When you choose Modify > Extend Sprite, the sprite shortens.


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:
  1. 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.

    graphics/03fig32.gif

  2. Choose Modify > Join Sprites.

    The sprites merge into a single sprite ( Figure 3.33 ).

    Figure 3.33. The sprites merge into a single sprite.

    graphics/03fig33.gif

To split a sprite:
  1. 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.

    graphics/03fig34.gif

    The playhead jumps to the frame that you clicked.

  2. 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.

    graphics/03fig35.gif

To make sprite frames individually editable:
  1. In the Score, click a sprite.

  2. 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 .

    graphics/03fig36.gif

graphics/tick.gif Tip

  • You can return the sprite to its normal state by selecting any frame in the sprite and then choosing Edit > Edit Entire Sprite.


To insert frames into the Score:
  1. Click the frame in the Score where you want to insert one or more frames.

  2. 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.

    graphics/03fig37.gif

  3. 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:
  1. Click the single frame that you want to remove ( Figure 3.38 ).

    Figure 3.38. Click the single frame you want to remove.

    graphics/03fig38.gif

    Note that the selected frame will be removed from sprites in all channels.

  2. 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.

    graphics/03fig39.gif

graphics/tick.gif Tip

  • Keyframes are not removed by Insert > Remove Frame. If the keyframe of a sprite falls within the frame that's being removed, the first frame following the keyframe will be removed from that sprite.


Reordering sprites

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.

graphics/03fig40.gif

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.

graphics/03fig41.gif

To change the order of overlapping sprites:
  1. 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.

    graphics/03fig42.gif

  2. 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.

    graphics/03fig43.gif

    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 .

graphics/tick.gif Tip

  • 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.


   


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