|
For the first
navigational assignment, you will be using 4 different scripts. Two of
these will be Frame Scripts and two will be Sprite Scripts.
Frame Scripts
for Assignment #2:
Hold Script
on exitFrame
go to the frame
end
Loop Script
on exitFrame
go [frame number]
end
Sprite Scripts
for Assignment #2:
Navigational Script A
on mouseUp
go [frame number]
end
Navigational Script B
on mouseUp
go [different frame number]
end
|
|
About Lingo
Scripts
Scripts are created by a Lingo "author" (i.e., yourself) to
implement interactivity and animation in a Director movie. Scripts run
in the background and are generally not seen by the user. They enable
such functionality as navigation, audio and visual effects, data input
and output, out-of-the-box interactions, etc.
Event Handlers
A handler uses specific scripting language to describe the event that
will trigger an action. Some examples of typical handlers are:
on exitFrame This handler refers to the "event"
of the playback head leaving a frame
on mouseUp This handler referes to the "event"
of the release of the mouse click
Commands
A command is triggered by an event handler. Some examples of commands
are:
go to the frame This causes the playback head to
hold on the current frame
go [frame number] This script is used to navigate
to another part of the Score (when used as a Sprite Script), or to create
a loop (when used as a Frame Script).Script Types and Locations
As a Lingo author, you can create 3 different types of Lingo scripts in
a Director movie: the Frame Script, the Sprite Script or the Movie Script.
All scripts are stored in the Script Window. Each different type of script
is located in a different place once it is used in a Director movie.
The Frame Script affects only the Frame in which
it is placed in the Director Score. It is located in the Script Channel
near the top of the score. To create a Frame Script, double click on the
Frame in the Script Channel so that the Script Window opens. Type your
script into the Script Window. It will automatically be attached to the
selected frame.
The Sprite Script will be dragged onto a specific
sprite, and will be associated only with that sprite. One of the most
common functions of a sprite script is to make a sprite into a navigational
"button." To create a sprite script, select the sprite in the
Score, go to the pulldown Behavior menu on the top left of the Score,
next to the Frame channel and select "New Behavior." The Script
Window will open; type your script. It will automatically be attached
to that sprite.
Alternatively, select the sprite and go to Modify>Sprite>Script,
to open the Script Window.
The Movie Script will remain in the Script Window.
The functionality of a movie script will affect the entire Director movie.
To create a new Movie Script, hold down Command + Shift and press U.
|