Chapter 2
90
Reuse the handler
You’ll use the same script cast member in the last frame of your movie, frame 64.
With the Cast window and Score open, drag the Loop script from cast slot 13 to frame 64 in the
script channel of the Score. A new sprite for the script appears in frame 64.
Notice that the default length of script sprites is one frame.
Now the same looping effect takes place in frame 64 so that the movie keeps playing until the user
clicks a button in the sound and video scene.
In the animation scene, you constructed an animation that takes place from frame 15 to frame
50. If you loop the playhead only in frame 50, the animation does not play while the movie is
waiting for the user to click a button. In this case, you should loop the playhead over the entire
range of frames that contain the animation.
To do this, you can use a script that is similar to the one you just wrote and place it in the last
frame of the animation scene. However, this new script will send the playhead to the first frame of
the animation rather than to the frame where the script is located.
Because the first frame of the animation scene is frame 15, you can simply write a script that says:
go to frame 15
The problem with this script is that it’s not too flexible. If you decide to move the animation
scene to a different range of frames in the Score, the script would be incorrect. To make the script
more flexible, you can place markers in the Score and send the playhead to a marker rather than a
specific frame number.
Add a marker to the Score
Markers are a way of giving a name to a specific frame in the Score. If you name the first frame of
the animation scene and then decide to move the scene, you can simply move the marker in the
Score along with the rest of the scene.
1
Because you won’t be using the effects channels in this section, click the Hide/Show Effects
Channels button in the upper right corner of the Score.
All the effects channels, except the script channel, are hidden. This makes the Score
easier to read.
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...