Interactive Digital Multimedia
Instructor: Barbara Lattanzi

rev. 2.29.04

This page was begun during the previous semester that this course took place. Look for new additions to come.

Other tutorials and sample files are searchable on the web. Macromedia's website is a good place to start. Another resource is Director-Online.

Additional LINGO Code examples used in class can be found at this link.


Links to Sample Director Files

1. How do I make a simple rollover with Lingo?

Attach a Behavior script to the sprite. The Behavior script uses the "mouseEnter" and "mouseLeave" handlers.

Note that for any bitmap castmember, if you want only the outer shape to be active (rather than the invisible box which surrounds each sprite) to be active then (as long as your background is white) you can use matte ink with your sprite.

2. How can I get the shapes in bitmap images to have smooth edges?

Edit your image in Photoshop, Image-Ready, or Fireworks so that it has one single layer with no background (i.e., background is transparent). Then import this file into Director as a 32-bit image. This preserves the 8-bit "alpha channel" which has the transparency information for the image.

3. How can I make a sprite image randomly change on the stage?

There are several ways to do this. Probably the easiest is to line up your castmembers in consecutive slots of the cast window and use a random function to select a castmember (randomly, of course). Any event can trigger this: every "exitFrame" event, or viewer/interactor events such as a "mouseUp" event, or during a "mouseWithin" event.

4. How is a count-down timer made?

The countdown timer makes use of the clock that is part of every computer system. Use an if/then conditional statement to count off the seconds and to test when zero on the counter is reached, in which case you can make some other event occur such as moving the playback head to a new frame on the score, make a sprite rotate (e.g. a clock), change a sprite's castmember, etc.

5. How can I make a sprite moveable for the viewer-interactor to manipulate? And can I make that sprite have a specific target location where the viewer-interactor can place it?

The sprite has a property called "moveablesprite" which, with Lingo, can be made true or false any time during the Director movie. (The default is false, which is why the viewer-interactor cannot usually move what is seen on the stage.

You can test (with an if/then conditional statement) whether the viewer-interactor has moved the sprite to a particular location by testing the sprite's "rect" (as in "rectangle") property to see if the sprite's rectangle overlaps some other rectangle on the stage.

6. How can I get a sprite to "stick" to the cursor and to substitute for the cursor?

Using a Lingo command, the cursor can be changed to any system cursor icons (pointing finger, hour-glass, arrow, etc.). The cursor can also be made invisible. Cursors are identified by number. In order to have an invisible cursor, use the statement "cursor 200" when, for example, the movie starts. Then, every "exitFrame" event should be able to track where the cursor (invisibly) is located and place your chosen sprite in that location.

7. How can I keep track of things that the viewer-interactor is doing?

Lingo offers a way to keep track of things by using something called, naturally enough, a list. For example, what if the viewer-interactor has to collect or manipulate a number of different images (such as finding clues in a narrative space)? How does the Director movie keep track when she has completed with the series of manipulations? With Lingo, you can add or subtract things to/from a list as a way of keeping track and determining "what next".


8. How can I keep a sprite pointing at the mouse (or at another sprite)? Can I make sprites flock to that location?

This Director movie is adapted from a sample done by a skillful Lingo programmer. Link here to his original sample (if it is still available). The following links are from an adaptation of his sample:

9. How can I create and sustain a simulated "bot"-like conversation between the computer and the viewer using text?

This "bot" (software robot) is constructed in the Director movie using "sendSprite" messages between sprite objects (i.e., between the viewer's input text sprite and the computer's response text sprite). It also uses "lists" of phrases that become the computer's lexicon of replies to the viewer's text input. Note that there is a practical need to limit the lexicon of phrases. The strategy used in this example is to base the conversation on a photograph:

10. How can a sprite detect if another sprite is intersecting it?