interactive scripting - CGR C/092 - fall 2004
Philip van Allen - v a n a l l e n @ a r t c e n t e r . e d u

room 142, Monday 4:00pm-7:00pm
all materials on this web site © copyright 2004, Philip van Allen
 
week 10a - director basics, director scripting basics

director intro : 


Director is a multimedia authoring tool that has sound, graphics, video, Flash, and animation capabilities. In addition, it has a plug-in architecture that enables the user to add capabilities such as the serial communications that can be used to work with sensors, touch screens, etc.



resources : 

 

 

 
main features :  Cast - The Cast is where Director stores all of the elements used in a presentation
Stage - The Stage indicates where a cast member will appear on the screen at a particular point in time
Score - The Score indicates when a cast member will appear on the stage
Sprites - A sprite is one instance of a cast member when it is on the stage

 

 
the cast : 

The Cast is where Director stores all of the elements used in a presentation. The cast can contain all different kinds of media, including video, graphics, text, audio, and scripts (ways to add more complex behavior to the Director movie). There are two primary ways of putting elements into the cast in preparation for using them in the movie: importing, or, inserting newly created cast members.

Media elements that can be in the cast include: .jpeg, .gif, png, .psd, .wav, .aiff, .mov, .swf (yes, Flash movies can be imported).

cast thumbnail view


cast list view


IMPORTING: You can bring media elements (assets) into the Director movie with the following steps:

  • Open the Cast window with Window>Cast
  • Select an empty cast box
  • Select File>Import to browse your disks for assets
  • Find your assets on the disk, and ADD them to the list of assets to be imported
  • Select IMPORT from the dialog box
  • The selected assets will be added to the Cast

Each asset will be in its own cast box. To view (and potentially edit) the asset, double click on the box. To set properties (e.g. if a video loops) of the cast member, select the cast box, then select MODIFY>CAST MEMBER>PROPERTIES (or to open the Property Inspector anytime, select WINDOW>INSPECTORS>PROPERTY)

Note: Most cast members become part of the Director movie when you import them. In other words, the files are inside the Director file. When you can move the Director movie around you do not need separately move the media in the cast.

The exception to this is QuickTime videos. They are not included in the Director movie, and must therefore travel with the movie in the same directory.


INSERT: You can create new graphic and text assets right in Director with the following steps:
  • Open the Cast window with Window>Cast
  • Select an empty cast box
  • Select Insert>Media Element>Bitmap or
  • Select Insert>Media Element>Text
  • This will open up the appropriate editor where you can paint or create text
  • When you've finished editing and close the editor, the asset is added to the cast

The bitmap editor is similar to Photoshop and the text editor is similar to Microsoft Word. See Director's help function for more information, select HELP>DIRECTOR HELP, then select MEDIA and find the media type you want to edit.

WORKING WITH CAST MEMBERS

Once you have cast members imported or inserted, you can work with them in the cast.

Naming: If you click on the cast member box in the Cast window, a text entry window become available at the top of the cast window. Use this to give your asset a name. Naming all of your assets will make finding and working with them later much easier

Deleting: To delete a cast member, click on a cast member and use the Delete key, or select Edit>Clear Cast Members. You can select multiple cast members to delete them all at once.

Moving. You can rearrange the cast members within the cast by clicking and dragging on the cast member. Normally, when you move a cast member, it will be inserted between existing cast members. Note the purple line as you move the cast member around the cast. This indicates where the cast member will be moved to.

 

 
stage and score : 

You create a Director movie by placing cast members on the Stage and Score--this creates a sprite (note that some cast members such as sounds and scripts never appear on the stage, though they can put put into the score)

  • The Stage indicates where a cast member will appear on the screen at a particular point in time.
  • The Score indicates when a cast member will appear on the stage.

You place cast members by simply dragging them from the Cast window onto the Stage or Score. In either case, you need to view both Stage and Score, so that you know both where and when the cast member is placed. First, make sure the Stage and Score windows are open and visible. To view the Stage or Score, select Window>Stage or Window>Score.

Note that once placed, a cast member is always on both the Stage and the Score at some point in time.

 

 
stage : 

The stage serves two functions. First, it is where elements are positioned in the authoring process. Second, it is where the action of the Director movie takes place.

You can adjust the size of the stage by selecting MODIFY>MOVIE>PROPERTIES

 

Selecting a sprite on the stage allows you to change its properties either by dragging, resizing, etc., or by making changes in the Property Inspector.

 

 
score : 

The score is timeline of the Director movie and is composed of frames and channels. Events happen through time in a Director movie depending on how cast members are positioned on the score. If you want the same functionality of the property inspector in the score, the score can be set to display the "Sprite Toolbar" above the channels and frames by selecting: View>Sprite Toolbar.

  • Frames: The movie starts on the left, and proceeds to the right through time one frame at a time. Cast members can occupy one or more frames, thereby staying on the stage for that number of frames. Time passes according to the frame rate of the movie. You set the number frames per second of the movie in the Control Panel. Select Window>Control Panel. Then set the number next the "fps" box in the Control Panel.
  • Channels: The movie's cast members are listed in the Score in channels, from top to bottom. Only one cast member can be in a channel at any one time (frame). You can have multiple cast members on the Stage at the same time by placing them in parallel channels in the Score. Sprites in higher numbered channels are in front of sprites in lower numbered channels.

Two approaches to using the score

In many books and tutorials on Director, you will see discussions about animating sprites using the timeline. Let's call this the graphical animation approach. It involves having the sprites span many frames in the timeline, where the sprite is in different positions on the stage at different keyframes. So as the timeline progresses from one frame to the next, the sprite tweens between each keyframe, cause it to animate around on the stage. The advantage of this approach is that you can see the progress of time and the position of the sprites in a graphic representation. We are not using this approach in this class.

Instead, we're using an approach which we'll call the loop on one frame approach. This method places all sprites on one frame, where the Director movie loops repeatedly. Sprites are moved and manipulated on the stage under software control using behaviors and Lingo scripting. I.e. there is no graphical prepresentation of the animation. We use this method because it's the best way to accomodate an interactive presentation where the objects on the stage respond to unpredictable input from the user. In this approach, the animation and manipulation is different everytime the application runs, and there is no way in a timeline setting to represent this.

The score image above demonstrates a Director movie that uses this approach. In this movie, there are two scenes where each scene has a full set of interactivity indepenent of the other scene. Normally, Director loops on the single frame of the scene (using the loop on frame behavior), and sprites are manipulated with software. Some action by the user calls a script that moves the position on the timeline to the other scene, which has a different set of sprites (and one in common) from the the other scene. The Director movie then loops on the new scene until some action moves the playhead to another scene.

 

 
sprites : 

Sprites are the objects representing when, where, and how cast members appear in the Director movie: i.e. the graphics on the stage. By creating multiple sprites, you can make a single cast member appear in different places and times in a movie. You create a sprite by dragging a cast member to the Stage or Score.

Sprites are similar to instances of movieClips in Flash, in that they are instances of cast members. Creating sprites with their own animation is not as convienient as in Flash, but can be accomplished with the Film Loop capability.

PLACING A SPRITE ON THE STAGE

To place a cast member on the stage thereby creating a sprite, do the following:

  • In the Score window, select a frame and a channel to control when during the movie the cast member will appear
  • In the Cast window, click and drag a cast member onto the stage, which creates the sprite
  • On the Stage, adjust the position of the sprite by dragging it around
  • Adjust the size by selecting the black handles on the sprite
  • In the Score window, extend or contract the sprite bar by clicking and dragging the right hand side
  • Move the sprite through time by clicking and dragging the sprite from the center of the bar

MAKING A SPRITE BACKGROUND TRANSPARENT, CHANGING OPACITY

By default, the background of an image you create is solid. For example, if you create a cast member that has a white background, the white rectangle of that background will be apparent as you put the sprite "in front of" other sprites. If you want this white background to be transparent, perform the following steps on the Sprite (not the cast member):

  1. Select the sprite on the stage
  2. SelectWINDOWS>INSPECTORS>SPRITE
  3. Select the Ink pull-down menu (by default it says Copy), and select Background Transparent

If you want to vary the opacity (i.e. make it translucent) of a sprite on the stage, perform the follow steps:

  1. Select the sprite on the stage
  2. Select WINDOWS>INSPECTORS>SPRITE
  3. Select the Blend pull-down menu (next to the ink menu, by default it says 100%), and select percent of opacity you want (100% means nothing will show through the sprite, 10% means the sprite will be almost completely transparent.
 

all materials on this web site © copyright 2004, Philip van Allen

top