At the bottom of the Stage, click the Stop button to stop the movie.
7
The handler that you wrote has three parts:
•
The first line,
frame where the script is located. This is frame 10.
•
The second line, beginning with
current frame. The
playhead is currently located. Again, this is frame 10.
•
The last line of any handler contains the word
The result of the new handler is that the playhead continually loops in frame 10 as it is sent back
to frame 10 each time it tries to go to frame 11. Your Director movie plays to frame 10 and loops
there until the user clicks a button to go to a different scene.
Reuse the handler
You can use the same script cast member in the last frame of your movie, frame 64. The script
creates the same looping effect in frame 64 for the sound and video scene as you achieved in frame
10 for the start scene.
Make sure that the Cast window and Score are open.
1
In the Score, display frame 64.
2
From the Cast window, drag the Loop script cast member to frame 64 in the Script channel of
3
the Score.
A new sprite for the script appears in frame 64. The default length of script sprites is one
frame. Now the same looping effect from frame 10 also occurs in frame 64. So the movie keeps
playing the sound and video scene until the user clicks a button.
Add a marker to the Score
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 could simply write a script
that says:
_movie.go(15)
The problem with this script is that it is not 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.
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.
68
Chapter 4: Building Your First Basic Movie
, tells Director to run this script when the playhead leaves the
on exitFrame me
_movie.go
in
.frame
(_movie.frame)
, tells Director to send the playhead back to the
always refers to the frame number where the
. It signals the end of the script.
end
Need help?
Do you have a question about the DIRECTOR MX 2004-GETTING STARTED WITH DIRECTOR and is the answer not in the manual?
Questions and answers