Multimedia Programming Lab 4

312-136

Lab 4

Part 1

Due: Tuesday, 11 July, 2000, beginning of class.

Complete the following activities. You may work in pairs. For this lab you must complete the following:

  1. There are 2 activities and you must turn in all of them.

  2. Each activity should have a separate movie. Place these movies into a folder. Label the folder with the last names of the people doing the lab. Drag the lab to the Lab 3 folder which is inside the Turn-In folder on the class account.

  3. Turn in movies . Do not turn in projectors.

  4. There are example projectors for each of the activities in the Material folder on Nova.

Activity 1. This activity will demonstrate the use of several techniques to create animations.

  1. Open the movie birdLoop. Save this movie under your last name(s).

  2. Begin by importing the graphics in the "bird" folder. There should be three graphics of birds in different positions.

  3. Place the three bird graphics on the stage in different channels. Make sure that each sprite only lasts one frame, frame 1. The bird should start with its wings up, then the wings should be level, then they should be down. Now drag the bird with level wings from the cast to the score. There should be two copies of this bird on the stage now. Position it as the last bird in the sequence and make sure that it also lasts exactly one frame. Finally, copy the first bird in the animation (the bird with its wings up) and make it the last bird in the sequence. Note that there are now 5 birds on the stage, forming a sequence of wing positions. Make sure that each bird is background transparent.

  4. Position the birds so that the tail of one bird is over the head of the previous bird. The birds should be moving up and to the right. The first bird in the sequence will be the picture of the bird sitting still on the grass (this bird was already on the stage). The result should look like this picture.

  5. Now select all of the birds in the animation (but not the bird sitting still) and choose Modify->Space to Time. The bird sequence should now be in the first five frames.

  6. Choose Edit->Copy Sprites. Then click in the first free cell after the last bird in your sequence. Choose Edit->Paste Special->Relative.

  7. Play the movie. The animation should last twice as long as it did previously. Note that there is an inflection halfway through the bird animation. This is because the first sprite that is pasted into the score is placed in the exact same position as the last sprite of the previous animation.

  8. repeat this process until the bird flys off the top of the screen.

  9. Now you will use real-time recording to animate the priest.

    1. In the channel in which the priest sprite appears, select the frames that the sprite occupies. All of the frames that contain the priest sprite should be highlighted.

    2. Open the control panel. Set the tempo to 5 fps. This will lessen Director's sensitivity to your mouse movements as you record. Once you have finished recording, you can raise the tempo again.

    3. In the Control Panel, click Selected Frames Only to turn on this option. This is the button in the lower right corner of the control panel. This activates the tempo setting for just the frames you've selected in the score.

    4. Make sure that the loop button in the control panel is turned off.

    5. Select Control->Real-Time Recording. The real time recording indicator appears next to the channel for the sprite being recorded (it's a small red button). The sprite on the stage should have a red hashed line around it.

    6. Drag the priest in a desired path on the stage until he disappears off the right side of the stage. As you move the man, the frames advance at the rate of 5 fps. You can see the playback head moving in the score. Release the mouse button to stop recording.

    7. Play your movie.

  10. Finally, we'll use step recording to make a second bird fly across the stage.

    1. First drag a bird to the stage. We won't bother to make its wings flap. Position it at the left end of the stage and make it last as many frames as the man.

    2. Now select the bird in the score. Make sure that the entire bird is selected.

    3. Click in frame one just above the first channel. You'll be clicking in the row that has the frame numbers. If you have clicked in the correct place, then the entire sprite will still be highlighted, but the line indicating the playback head will be in the first frame.

    4. Make sure that you can see both the control panel and the stage. Then choose Control->Step Recording. Note that a red arrow appears next to the channel holding the bird to indicate that step recording is on. Click on the single frame advance button on the control panel to move to the next frame. Move the bird to its correct position in the next frame.

    5. Now click the single frame advance button again. Position the bird again. Repeat until you've moved the bird off the left side of the frame.

    6. When you finish, click the rewind button on the control panel. You will no longer be in step recording mode. Note that every frame of the bird should be a keyframe.

    7. Play your movie.

Activity 2. This activity will teach you how to use behaviors to control the action in a movie and to allow interactivity.

  1. Hypertext links Hypertext is text in an electronic form with built-in links between information that's connected, similar to links on a web page. Readers of hypertext documents don't need to track down the section heading that contains the cross-reference theyÕre looking for; they need only to click the text that's linked to a related passage, and the passage appears on the screen.

    In Director, a hypertext link works just like a button: when a user clicks the text that's linked with a related passage, a script associated with the text tells Director to go to the frame in the movie where the passage is located.

    There are two ways to set up a hypertext link:

Making an entire text block a button is easy: you write a script for it in exactly the same way you wrote the script for the Start Story button above. The following instructions will show you how to make a single word within a block of text a button.

  1. Open the movie HyperText from the Director Temporary :Lab 5 folder on the Corinth server.

  2. Run the movie to see how hypertext works: click on the word Genji . A screen of text appears with information about The Tale of Genji . Click the Return button in the lower right corner of the screen. The first screen reappears. Stop the movie.

  3. Now make the score active. Notice that there's a marker labeled Genji . The marker identifies the frame that contains the text that appeared on the screen when you clicked the word Genji . If you click just below the marker labeled Genji you will move the playback head to the frame with the text about The Tale of Genji . The text appears on the screen.

  4. Move the playback head to frame 1. The illustration of Genji's departure reappears.

    If you look at the block of text on the screen you can see why you can't make the entire block a hypertext button: two words-- Genji and Rokujo -- are in red. Each has a separate passage related to it, and so each needs its own script to tell Director where to find the passage. Note that Rokujo isn't linked with its passage yet.

    Note that the script linking Genji with its related passage isn't part of the text block's cast member, and the script can't be connected directly with Genji because Genji isn't a separate cast member. Instead, the script for Genji is part of a transparent button that overlays the word Genji .

  5. Now select frame 2 in channel 6. The selection rectangle that appears on the stage makes the button visible. Because the button is completely transparent, it looks as if you're clicking Genji when in fact you're not--you're clicking the button on top of it.

  6. Make sure frame 2 in channel 6 is still selected. Click anywhere in the script preview area to display the script window. You should see a script that reads:

    		on mouseUp
    			play frame "Genji"
    		end
    

    The command play frame Renji works in the same way as the go to frame Start command. The difference is that the command play frame name is always paired with another statement, play done . The purpose of play done is to tell Director to return to the frame it came from.

    The process works like this: You place play frame name at the point in a movie where you want Director to branch to the beginning of a different segment; you place play done at the end of the segment. When Director comes across play frame name it goes to the frame that's named. When it comes across play done it returns automatically to the frame it came from.

    The play done statement is part of the script for the Return button that's on the screen that contains the information about The Tale of Genji.

    You can look at the script for the Return button in the cast: in the cast window select cast member 12. Click on the script button at the top of the cast window. The script reads:

    			on mouseUp
    				play done
    			end
    

    The interactions between the scripts works like this: When you click the word "Genji" on the first screen of the movie, Director branches to the frame that contains the information about The Tale of Genji There's a pause script in the script channel of the frame, so Director simply waits there for further instructions.

    When you click the Return button, Director reads the script there, comes across the play done statement, and returns to the place it came from.

  7. Now create a new sprite and position it over Rokujo:

    1. Select cell 2 in channel 7 of the score.

    2. Drag cast member 10 from the cast window over the word Rokujo on the stage. The new sprite looks blank because it's white like the background.

    3. Go to the score, and select Bkgnd Transparent from the Ink pop-up menu to make the sprite transparent.

  8. Now you must give the transparent button a script similar to the one for Genji , but this script should branch to Rokujo .

    1. Make sure cell 2 in channel 7 is still selected.

    2. Choose New from the Script pop-up menu in the score.

    3. On the second line of the script, type:

      			play frame "Rokujo"
      

    4. Press Enter on the keypad to close the script window.

    5. Now you need to change the frame and sprite scripts in the Rokujo frame.

      1. Go to frame 10. Double click on the cell in the Script channel. You will get a frame script window.

      2. On the second line of this script place the command pause .

      3. Close the window.

      4. Now open the script for the Return button.

      5. In this script delete the command "halt" and then type the command Play Done on the second line and close the script.

    6. Play your movie. When you click on the word "Rokujo" you should jump to that frame. When you click on the return button, you should jump back to the first screen.

PostLab 4

Due: Wednesday, 12 July 2000 at the beginning of class.

Note that you must work individually on the post lab.

Turn in a movie not a projector .

All movies must have an opening sequence that lists the name of the person involved in the lab. Keep a copy of your movie; you will be modifying this movie in a later lab.

  1. Create a movie with an opening scene and two other scenes or "games".

  2. In the opening scene have three buttons, a halt button and two buttons to take the player to the two games.

  3. One game should consist of 4 or 5 moving objects. Every object should move across the stage (up to down, down to up, right to left, or left to right) but no object should have a straight path. Also no object should move at a uniform rate across the stage, ie, objects should speed up or slow down as they move. When the player clicks on an object the movie should play a sound. The sound cannot be the "beep" sound, but must be a sound from the cast. Every object must have a different sound. This game must have a button that takes you back to the opening menu.

  4. The second game should consist of a bowling game. Use a ball and 6 pins. When you drag and toss the ball, it should travel to the pins and force them to disperse. Use a rectangle sprite around the outside of the stage to keep the ball and pins on the stage. This game must have a button that takes you back to the opening menu.

    Creativity will be worth 5% of your grade.