User Guide
547
repeat with...in list
Syntax
repeat with variable in someList
Description
Keyword; assigns successive values from the specified list to the variable.
While in a repeat loop, Lingo ignores other events except keypresses. To check the current key in
a repeat loop, use the
keyPressed property.
Only one handler can run at a time. If Lingo stays in a repeat loop for a long time, other events
stack up waiting to be evaluated. Therefore, repeat loops are best used for short, fast operations or
when users are idle.
If you need to process something for several seconds or more, evaluate the function in a loop with
some type of counter or test to track progress.
If the stop condition is never reached or there is no exit from the repeat loop, you can force
Director to stop by using Control+Alt+period (Windows) or Command+period (Macintosh).
The Director player for Java doesn’t detect mouse movements, update properties that indicate the
mouse’s position, or update the status of mouse button presses when Lingo is in a repeat loop.
Example
This statement displays four values in the Message window:
repeat with i in [1, 2, 3, 4]
put i
end repeat
resetWorld
Syntax
member(whichCastmember).resetWorld()
member(whichTextCastmember).resetWorld()
Description
3D command; resets the member’s properties of the referenced 3D cast member to the values
stored when the member was first loaded into memory. The member’s
state property must be
either 0 (unloaded), 4 (media loaded), or -1 (error) before this command can be used, otherwise a
script error will occur.
This command differs from
revertToWorldDefaults in that the values used are taken from the state
of the member when it was first loaded into memory rather than from the state of the member
when it was first created.
Example
This statement resets the properties of the cast member named Scene to the values they had when
the member was first loaded into memory:
member("Scene").resetWorld()
See also
revertToWorldDefaults