MACROMEDIA DIRECTOR MX-USING DIRECTOR MX Use Manual page 411

Table of Contents

Advertisement

For example, the following
responds accordingly:
case (the key) of
"A": go to frame "Apple"
"B", "C":
puppetTransition 99
go to frame "Oranges"
otherwise beep
end case
If the user pressed A, the movie goes to the frame labeled Apple.
If the user pressed B or C, the movie performs the specified transition and then goes to the
frame labeled Oranges.
If the user pressed any other letter key, the computer beeps.
A
statement can use comparisons as the test condition.
case
For more information, see
Repeating an action
Lingo can repeat an action a specified number of times or while a specific condition exists.
To repeat an action a specified number of times:
Use a
repeat with
.
repeat with
This structure is useful for performing the same operation on a series of objects. For example, the
following repeat loop makes Background Transparent the ink for sprites 2 through 10:
repeat with n = 2 to 10
set the ink of sprite n = 36
end repeat
This example performs exactly the same action as above, but uses dot syntax:
repeat with n = 2 to 10
sprite(n).ink = 36
end repeat
This example performs a similar action, but with decreasing numbers:
repeat with n = 10 down to 2
sprite(n).ink = 36
end repeat
To repeat a set of instructions as long as a specific condition exists:
Use a
repeat...while
For example, these statements instruct a movie to beep continuously whenever the mouse button
is being pressed:
repeat while the mouseDown
beep
end repeat
statement tests which key the user pressed most recently and
case
in the Lingo Dictionary.
case
structure. Specify the number of times to repeat as a range following
statement.
Writing Scripts with Lingo
411

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DIRECTOR MX-USING DIRECTOR MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Director mx

Table of Contents