Chapter 16
412
Lingo continues to loop through the statements inside the repeat loop until the condition is no
longer true or until one of the instructions sends Lingo outside the loop. In the previous example,
Lingo exits the repeat loop when the mouse button is released because the
mouseDown
condition
is no longer true.
To exit a repeat loop:
•
Use the
exit repeat
command.
For example, the following statements make a movie beep while the mouse button is pressed,
unless the mouse pointer is over sprite 1. If the pointer is over sprite 1, Lingo exits the repeat loop
and stops beeping. (The term
rollover
followed by a sprite number indicates that the pointer is
over the specified sprite.)
repeat while the stillDown
beep
if rollover (1) then exit repeat
end repeat
See
repeat with
,
repeat while
, and
exit repeat
in the Lingo Dictionary.
Creating and attaching scripts with the Script window
To create scripts and write the Lingo statements that make up handlers, you use the
Script window.
To open the Script window, do one of the following:
•
Select Window > Script.
•
Double-click a script cast member in the Cast window.
For more ways to create and open scripts, see “Performing common tasks” on page 387.
You can change the font of text in the Script window and define different colors for various code
components. See the next section.
Setting Script window preferences
To change the default font of text in the Script window and the color of various code elements,
you use Script window preferences. Director automatically colors different types of code elements
unless you turn off Auto Coloring.
To set Script window preferences:
1
Select Edit > Preferences > Script.
2
To choose the default font, click the Font button and select settings from the Font dialog box.
3
To choose the default color of text in the Script window, select a color from the Color menu.
4
To choose the background color for the Script window, select a color from the Background
color menu.
5
To make new Script windows automatically color certain code elements, select Enable for Auto
Coloring. This option is on by default.
With Auto Coloring off, all text appears in the default color.
Содержание 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...