Tutorial in Using Macromedia Director's Lingo Authoring Environment for Exprimental Arts

Stephen Wilson, Professor, Conceptual Information Arts Program, SFSU

What is Director?

Director has been around for a long time and actually has several layers:

1.  Multimedia 2-D Animation:  It is a 2-D multimedia animation program that allows you to create or import images and sounds and orchestrate their movement over time.  This is accomplished by creating image, text, and audio cast members and placing them on a timeline based score that controls their motion and appearance.

2.  Interactive Multimedia Navigation:  Director allows you to divide the score up into sections indicated by markers.  It allows your to create buttons, hypertext, and hot images that control the navigation among areas of the score.  It has built in behaviors that allow you to link user actions such as rolling over an image or clicking a mouse button to movement to particular sections.

3  Lingo programming support:  Director incorporates a programming language which gives you many of the capabilities available in full languages such as C, Pascal, or BASIC.  The language is fully integrated with the multimedia capabilities such as digital video so that you can create much more complex possibilities than are available with the simple navigation behaviors.  To use it, however, you must learn the fundamentals of the Lingo language.  Learning Lingo is the focus of this tutorial.

4. Director as control center:  Director is extensible via special added software capabilities called Xtras and Xcmds.  For example with appropriate Xtras (and in some cases hardware), Director can be used to control speech synthesis and recognition, sensors and robotic devices, 3-D animations, and MIDI synthesizers.  Most recently extensive Internet capabilities have been added so that Director can control web browsers or incorporate information fetched from the Web.  Saving interactive Director movies in Shockwave format allows them to be sent out over the Web and appear within Web pages.

Basic Components of Director

Every media element you use - shapes, text, sounds, digital movies, vector images, scripts become cast members.  The screen display is called the stage.  The flow of events is orchestrated in a time line called the score which is composed of frames.  You bring cast members to the score to appear during specified ranges of frames.  Cast members become sprites when  placed in a channel.  The sprite appears on the stage for  whatever frames you designate.  The same cast member can be reused throughout the movie in different sections.

How Does Lingo Work?

Lingo is referred to as a modified object oriented language.  Everything created in Director - for example, images, sounds, text are called objects.  They become cast members and once placed on the stage, each instance is called a sprite  You create Lingo scripts to give the objects the intelligence to do things.   For example, user actions send messages to objects such as the mousebutton has been pushed down when the pointer was sitting over an image.  Normally nothing happens.  You can add a Lingo script, however, to the image so that it will respond to a button press - for example, by navigating to a certain place in the score.  Director can also send messages to itself - for example, a timer can cause actions to happen after a certain amount of time has passed.

Lingo and Director have enormous possiblities but not everything is possible. Learning Lingo means learning  the range of possibilities it possess, learning the special vocabulary of words it understands, learning the appropriate syntax for expressing your ideas, and learning the logical organization of Lingo and multimedia components necessary to create your events.  Computer languages require absolute precision of expression.  One word misspelled or an extra comma will cause errors and stop your program cold.  This inflexibility is one thing that throws many artists in learning the language.

Artistic Challenge of Working with a Limited System

Basically all you have to work with in interactive computer media is the user's movement of a mouse and actions on a keyboard.  You can manipulate sound, image, and text.  Your challenge is within the limited world of a computer system, how can you create events that are conceptually and expressively rich.  How do you take the things the system can read and do and link them in interesting ways?

What Kind of Events does Lingo understand?

(***Note this list and the next do not list all Lingo capabilities; their primary purpose is to suggest possibilities for the reader to start considering.)

What kind of events does Lingo understand?  What user actions can be used to set up events?  What self induced, non user actions can it work with?  The first prerequiste for working with Lingo artisically is knowing what possibilities exist - what actions can it respond to and what are possibilities for what it can do with image, sound, text, and digital video.  The list below shows specific Lingo messages, commands and functions that you would need to tap into these possiblities.  Don't worry if you don't understand the words in the parentheses; they are examples of Lingo that relate to the events and will become clearer later.  Many detailed tutorial examples are offered after the list.

User Action

Movement of the mouse pointer - entering, staying within, and leaving the boundaries of an image sprite. ( mouseEnter, mouseWithin, mouseLeave)
Clicking the mouse button while pointing at something, double clicking (mouseDown, mouseUp, stillDown, hyperlinkClicked, mouseUpOutside, clickLoc, clickOn)
Location of the mousepointer on the screen (functions called the mouseLoc, mouseH (horizontal), and mouseV (vertical)
Entering text in a text entry field (the text of member "example")
Which keyboard keys are pressed (keyDown, keyUp. controlDown, optionDown, shiftDown, the key)
Grabbing and dragging an image sprite on the screen, contact between images (sprite 1 itersects sprite 2)
Opening, closing, moving, and deactivating windows (openWindow, closeWindow, moveWindow).
The starting or stopping of the movie (startMovie, stopMovie, preparemovie)

System Events

The passing of time since an action (the lastClick,  lastKey, lastEvent, lastRoll, the timer, the ticks)
The time of day or date  (the date, the time)
The movement of movie to different frames of the score (enterFrame, exitFrame)
The movement of a movie to the place a sprite exists (beginSprite, endSprite, prepareSprite)
A idle event Director continuously sends while it is running (Idle)
The touching or enclosure of image sprites (within, intersects)
The movement of a sound or digital movie past cue points
The status of a sound soundBusy(x)
The status of a digital movie (the movieTime)

What Can You Control in Lingo


Location of images (hloc,vloc)
Size and crop of images (the rect, crop)
Color of images (backColor, foreColor)
Replacement images ( the member of sprite x)
Visibility of images (the visible of sprite x)
Degree of transparency of images (the blend of sprite x)
Ink of image- for example opaque, reverse, invert, OR (the ink of sprite)
Palette of image
Orientation (horizontal and vertical flip, rotation, layering)
Shape and vertexes of vector images
Button style
User movability

Interface features
Appearance of the cursor
Custom menus and menuitems

Play a sound, stop, pause (sound playfile, sound stop)
Control volume (fadeIn, fadeOut, the volume of a sound)

Control location of text, movement, size, font, style, alignment, color, hilight
Scroll text (by line, page)
Appearance of text box (border, boxDropShadow)
Manipulate text by character, word, item, line User editability
Generate alert boxes

Digital video
Start, stop, pause, move to particular time points (movieTim
The size of window, crop, location, mask
The speed of movie, direction of play
The status of sound in the movie, the volume
Control of quicktimeVR movies

Navigation and timing of movie
Move to frames (by marker, next, previous)
Halt, pause, continue, stop the flow of the movie
Change the tempo of a movie
Change the transitions between frames

Mathematical and Data Functions
add, subtract, divide, multiply, sine, cosine, tan, integer, round, log, sqrt, max, min
number of items (strings, lists)
manipulate ordered lists, find items, sort, attach properties, locate items

Dowload items from the Web
Control a browser
Monitor progress

Introductory Examples

Here are some brief examples of Lingo scripts.
This one would navigate when some one clicks a button  on mouseUp
  go frame "birthdayscene"
end mouseUp
This one would stop a sound when someone moved out of a sprite image  on mouseLeave
  sound stop 3
end mouseLeave
This one would show an alert box when the movie reached a certain frame on enterFrame
  alert "Why are you here?"
end enterFrame


Where do you put scripts?

Beginners are often confused about where to attach scripts.

Some specific examples - Wilson Tutorials


List of Lingo Commands - arranged by category
Guide to Basic Animation Capabilities of Director

Basic Navigation, Lingo Control of Images and Text Fields

Marker navigation demo    Using Lingo to set up navigation using markers and sections of the score.
Lingo control of sprite visual appearance demo (change size, location, ink, rotation,blend, visibility and change image when rollover)
Lingo control of text field properties (font, fontsize, fontstyle,color) and dynamic placement of text in field from user input
Pause and continue demo   Controls the flow of animation using variable to pause and continue.

Sound, Speech

Sound manipulation (image of handout) - play background sound and pause while sounds plays via rollover of other sprites, sound activated when sprite reaches particular place of the screen,  activate sound only when sprites intersect, change volume based on where mouse is inside of a sprite, activate sound when animation reaches a certain point, activate automatically without user action.  (zip version of acutal sound manipulation Director Movie and associated sound files)
Speech Commands - synthesized speech commands (in Director MX only)
Sound Demo (revised)    Sound Demo (pevious version)  General Principles, Controlling animation by sound, activating sound by user motion, Activating Sound by User Movement, reading collisions, Director 8 sound commands

Lingo - randomness, mouse movement tracking, storing user actions, repeat command, user input

Text manipulation (image of handout)  - take user input into other members, rotate text, increase size of text, speak user input, scroll text in moving message, start and stop scrolling, random generation of sentences from list of words, activate automatically wihout user action (zip version of actual text manipulation Director Movie)
Using the random function - uses random to control rotation, word in text field, font of the text, and sound that is played
3 property demo.  Shows dynamic assignment of graphic cast members and text to moving sprites.  a412.3prop.demo.gif
fontsize   Shows the dyamic control of the font and size of text.
Mouse fontsize demo   The size of text changes dynamically with movements of the mouse
Mouse follow demo     A sprite follows the movements of the mouse.
Repeat Demo   Shows how to control movement and other actions using repeat structure
Opinion Storing Demo   Shows how to store and access text that users type

More complex demos - games, time, web control

Game Demos - simple capture game, memory game, card game, board game
Shockwave movie as alternative browser (using netlingo to let movie access web pages, methods of setting up frames)
Time Demo  Shows how to use the date and time functions Text version for pasting time.movie.sit  time movie.zip
Urgency.time.demo  Shows how to use duration lingo comands  Text version for pasting urgency.siturgency.zip
Timeurldemo  - Access web pages every 15 seconds, other actions at intervals, act at specific second
urgencyboxmove.txt -  user is challenged to drag 3 objects into a box before the timing object falls below a certain level (paste the text into an exitframe script - create the needed sprites)

CIA  sound resource links


Director On-Line Resource

*Dean's Links -  Tutorias faq, lingo info Director info sites, shockwave demos - games, art,etc ,3d,qtvr (http://www.fbe.unsw.edu.au/learning/director/   - University of New South Wales)
*Desmond Lewis Tutorials -uk    (http://www.herts.ac.uk/lis/mmedia/directortutorial/)
Macromedia site for download of free trial version   - (http://www.macromedia.com/go/try_dmx2004)
Director - Wikipedia

Tutorlands list of links for director tutorials  (http://www.tutorialfind.com/tutorials/macromedia/director/)
Online video Director Training

Macromedia index of tutorials
(mostly advanced topics   http://www.macromedia.com/support/director/tutorial_index.html)
Advanced topics - Imaging Lingo (Chuck Neal)
Tutorial on Imaging Lingo
Lingo tutorials, scripts, etc
Advanced topics - Animation math in lingo   - JM Hayward
Director Web Tips for Lingo Programming

Eliens Director manual including Lingo Tutorials
Fbe work flow tutorial on Lingo scripting 
Macromedia - using Director 8  behaviors
Macromedia Director Xtras
Macromedia Tutorial Page (intermediate concepts)
Gary Rosenzweig's Director Page
Director Web
Lingo User's Journal
Macromedia - Director Multimedia index
Macromedia: Director Technotes Index
Macromedia: Welcome to Macromedia!
Update Stage - http://www.updatestage.com/
Clever Media - http://www.clevermedia.com/
Gmatter - http://www.gmatter.com/
Canter Development - http://www.mediaband.com/mbkit/index.html
CSCI E-14: On-line Director resources

http://www.penworks.com/LUJ/lingo-l.cgi - lingo newsgroup
http://www.mcli.dist.maricopa.edu/director/ - director stuff
http://www.shocker.com/digests/index.html - shockwave email news subscription
http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames - director games info
http://www.acm.org/crossroads/xrds6-5/macromedia.html - prototype testing with director
http://www.director-online.com/ - tips & tricks
http://www.herts.ac.uk/lis/mmedia/directortutorial/ - director tutorial basics
http://www.sfx.co.nz/tamahori/thought/shock_3d_howto.html -shockwave 3d how-to
http://www.monkeyfarm.com/howtomakegames.html - duhh - doh!
http://www.director-online.com/ -send questions get replys...
http://www.dubbus.com/devnull - director 3d polygons using dave's engine - dave makes the most popular lingo 3d engine - don't ask me how it works i haven't figured it out yet.
http://www.fbe.unsw.edu.au/learning/Director/ - obvious i think.
http://www.behaviors.com/ - best selection of lingo behaviours ready written
Dean's director  video tutorial- http://www.fbe.unsw.edu.au/learning/Director/resources/FAQ/
Adding que points to Director - http://www.director-online.com/buildArticle.php?id=988
Adding que points II  - http://www.mcli.dist.maricopa.edu/director/tips/qt/012.html


More information about the course exploring the artisitic use of these capabilities is available at the description of the Art 412 Conceptual Information Arts: Introduction to Art & Technology.
rev 7/30/06
Stephen Wilson, Professor, Art, Conceptual/Information Arts Program, San Francisco State University
Information about the Conceptual/Information Arts program    (415) 338-2291   swilson@sfsu.eduWilson web page
Copyright, Stephen Wilson, 1999 - You are free to use the text as long as you attribute source and do not use it commercially.