Chapter 2
96
6
In the name text box at the top of the script window, type
RewindScript
. Close the Script
window, and save your movie.
The Lingo you typed in this handler uses a different syntax than the scripts you wrote earlier.
When you write Lingo that manipulates properties of objects such as sprites or cast members,
you use dot syntax. Dot syntax is a way of writing Lingo that separates properties from their
objects with dots instead of words such as the and of.
By using dot syntax, you can write a short script like this:
sprite(1).movieTime = 0
Without using dot syntax, you would have to write a more verbose script like this:
set the movieTime of sprite 1 to 0
Using dot syntax is much faster when you are authoring your movie.
This example illustrates the basic requirements of dot syntax:
•
You refer to sprites with the word
sprite
followed by the sprite’s channel number in
parentheses.
•
You refer to a property of the specified sprite by separating it from the word
sprite()
with a
dot or period.
•
The equal sign (=) is sufficient to indicate that the property should be set to the specified value,
as in
sprite(1).movieTime = 0.
7
Close the Script window. Rewind and play your movie. Click the Go to Sound and Video
button in the start scene.
The movie jumps to the sound and video scene, and the QuickTime sprite begins to play.
8
When the QuickTime sprite finishes playing, click the Rewind button. The QuickTime sprite
rewinds to the beginning of the video.
Add a script that plays the QuickTime sprite
When the video is playing normally, the
movieRate
is 1. You can now add the
movieRate
property to the Play button. This time, the Lingo ensures that the QuickTime sprite plays when
the user clicks the Play button.
1
In the Score, right-click (Windows) or Control-click (Macintosh) the Play button sprite in
channel 2, frames 55 through 64.
2
Select Script from the context menu. On the second line of the handler in the Script window,
type the following Lingo:
sprite(1).movieRate = 1
This Lingo starts the QuickTime sprite playing at normal speed.
3
In the name text box at the top of the script window, type
PlayScript
, close the Script window,
and save your movie.
Summary of Contents for DIRECTOR MX-USING DIRECTOR MX
Page 1: ...Using Director MX Macromedia Director MX...
Page 12: ...Contents 12...
Page 156: ...Chapter 4 156...
Page 202: ...Chapter 6 202...
Page 244: ...Chapter 7 244...
Page 292: ...Chapter 10 292...
Page 330: ...Chapter 12 330...
Page 356: ...Chapter 13 356...
Page 372: ...Chapter 14 372...
Page 442: ...Chapter 16 442...
Page 472: ...Chapter 18 472...
Page 520: ...Chapter 19 520...
Page 536: ...Chapter 20 536...
Page 562: ...Chapter 23 562...
Page 566: ...Chapter 24 566...
Page 602: ...Chapter 27 602...