Accessibility
 
Home > Products > Director > Support > Lingo, Behaviors and Parent Scripts
Macromedia Director Support Center - Lingo, Behaviors and Parent Scripts
Case statement

This Show Me Example describes how to use Lingo's case statement. The Case statement creates a multiple branching logic structure that is easier to write than repeated if...then statements. See Case statement overview for more information about the case statement.

The following are examples of movies that use the case statement. You can download copies of these movies from the links at the bottom of the page to see how the movies were made in Director.

Zip code checking
The case statement in this movie determines if the text in the zip code field makes a valid zip code. To operate the movie, enter text in the field and then click the arrow button. Alerts indicate whether the text is a valid zip code.

How the example works
Code listing

Rollover member type
This movie uses a case statement to display the type of member the pointer is over. To operate the movie, place your pointer over any of the four members to see their member type icon displayed.

How the example works
Code listing

Ball motion events
The case statement in this movie controls the ball's motion, based on messages sent by the control buttons. To change the ball's motion, click the buttons to make the ball change direction or stop.

How the example works
Code listing

Download Windows source files for these movies (70K)
Download Macintosh source files for these movies (35K)

David Benman

Macromedia


Director

6 January 2000

9587