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

Lesson 29. Creating Hypertext > Setting Up Your Movie for Hyperlinks

Setting Up Your Movie for Hyperlinks

In this task, you will create a small hyperlinked document called "Secrets of the Universe." It includes a main page with this title and a short paragraph with links to pages titled "Planets," "Stars," "Galaxies," and "The Sun."

Choose File > Open to open Start.dir in the Start folder within Lesson29 on the CD (Windows Ctrl+O, Macintosh Command+O). Save this file as Secrets.dir in your Projects folder.

Choose Window > Cast to open the Cast window (Windows Ctrl+3, Macintosh Command+3).

The Start file already has text for the page titles, in cast members 6 through 10, and some additional text in cast members 12 through 15, but that's all.

Figure .

The first five cast member slots are empty. If you are working with movie scripts, as you will be in this task, it is often helpful to leave some blank slots at the beginning of the cast to hold the movie scripts. There is no real benefit to having all your cast members side by side, as is the default; in fact, it is often helpful to group similar types together and leave blank spaces in between, to make finding certain cast members easier.

Select cast member 6, the "Secrets of the Universe" text, and drag it to the top of stage, where it can be positioned as a title for the page.

Figure .

Open the Score window. If necessary, adjust the sprite you just created in channel 1to span frames 1through 18.

This 18-frame duration is arbitrary; it was used because it is long enough to show the name of the cast member in the score.

Figure .

Select cast member 7 (Planets) in the Cast window and drag it to channel 1, frame 20, of the score. Adjust the duration of the sprite in the score to span frames 20 through 28.

Because the cast member was dragged into the score, the upper-left corner of the sprite is positioned in the center of the stage.

Select the sprite you just created and position it near the top of the stage.

Figure .

One by one, select cast members 8 through 10in the Cast window and drag each to channel 1of the score so that they span frames 30 through 38, 40 through 48, and 50 through 58, respectively. Click each sprite and make sure it is positioned so that it is visible near the top of the stage.

The actual sprite duration is arbitrary; it is long enough to show the name of the cast member and leave an empty frame between each sprite so that sprites can be easily distinguished. Because you will be using markers to identify the sprites, the actual frame locations don't matter, and because you will be looping on each marked frame, the actual sprite duration doesn't matter, either. The score should look like this:

Figure .

Next you will add markers to the frames where each sprite begins.

Click the marker channel for frame 1and enter Secrets as the marker name.

This sets a marker for that frame. Markers allow you to refer to a frame by name rather than by frame number. This gives you more flexibility in organizing your scripts and makes the score easier to follow. You learned about markers in Lessons 5 and 18.

Figure .

You have just placed a marker named Secrets to represent frame 1. Later you can refer to this marker by name to bring the movie back to this frame.

Place a marker at the beginning of each of the other sprites in the score, in frames 20, 30, 40, and 50, naming the markers Planets, Stars, Galaxies , and Sun , respectively.

Your score should now look like this:

Figure .

Next you need to add Lingo scripts to control looping in the movie. In previous lessons, you used frame scripts, using the go to the frame command to loop on a particular frame. Recall from Lessons 16 and 17, however, that if a message, such as exitFrame, isn't handled by a sprite script, frame script, or cast script, it gets passed to the movie level. This allows you to create one movie script that handles exitFrame events for the whole movie.

In the Cast window, select cast member 1and choose Window < Script to open the Script Editor (Windows Ctrl+ 0 , Macintosh Command+ 0 ).

The Script Editor opens, ready for you to edit a movie script.

Enter the following in the Script window:

on exitFrame   --Do this throughout the entire movie.
  go to the frame

By issuing an instruction in a movie script that tells Director to go to the same frame that it is just exiting, you make the movie loop on whatever frame contains the playback head.

Unless overridden by an exitFrame handler in a frame's behavior channel, this handler will force the playback head to stay in whatever frame it is located. You can still reposition the playback head using Lingo with a go to frame or go to marker instruction, which is how you will achieve the hypertext behavior.

Close the Script Editor and play the movie.

The movie plays, but it doesn't leave the main Secrets of the Universe screen. In fact, the playback head never leaves frame 1 of the movie. Now you can start adding links to create your hypertext.

Save your work.



Not a subscriber?

Start A Free Trial

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