Lingo programming language
|
Lingo is a scripting language developed by John H. Thompson for use in Macromedia Director. It has been said that HyperTalk was one of the inspirations for Lingo.
Contents |
Syntax
When Lingo was created, the syntax was designed to mimic spoken language, so it would be easy for beginners to get started. You could write whole sentences like:
if the visible of sprite 5 then go to the frame
Although it is still possible to use the old syntax, the latest version of the language fully supports dot syntax, so that the code looks more like in standard programming languages.
The equivalent in new scripting style would be:
if sprite(5).visible then _movie.go(_movie.frame)
Although this format uses elements of the Document Object Model introduced in Director MX 2004. In versions prior to MX 2004 the syntax would be:
if sprite(5).visible then go to the frame
Usage
Lingo is embedded into Macromedia Director. This way you don't need to care much about hardware or details of getting things on the screen - the program does this for you.
There are 3 types of scripts in Lingo:
BEHAVIOR scripts are attached to a sprite to control that sprite's properties and movement. They make it easy to program in an object-oriented way, as you can directly see the relationship between the programming and the item they are attached to. They can also control or interact with other sprites, making them a true object.
MOVIE scripts are not attached to any one sprite, and are available throughout the program (movie). They can be used to control overall aspects of the movie, especially upon the start or end of the movie. They can be referenced by any other script, to hold common handlers, for instance.
PARENT scripts are used to create ("birth") an Object into a Global Variable, with a "new" command. These objects can control sprites and other media remotely, without being attached to any one sprite, or may be used to control data or other non-displayed items. A Parent script can be used to create or destroy an object at anytime, freeing them from the confines of the score that a Behavior is limited to.<p>
BEHAVIOR and PARENT scripts encourage good object-oriented programming. MOVIE scripts are not as OOP-oriented; however, they can still be used to make "black-box" handlers, where other objects can input raw data and receive answers back, without knowing the inner workings of the box. Using the strengths and ease-of-use of Director's programming methodology, with the advantages of OOP makes for a powerful and fast programming environment.
Imaging Lingo
A very powerful part of the language is Imaging Lingo. It was introduced when Director version 8.0 arrived. It gives the user the power of image manipulation with simple commands. There are some similarities to functions of image applications (like Photoshop), what makes it easy to create visual effects.
External links
Useful resources
- director-online.com (http://www.director-online.com/)
- DirectorWeb (http://www.mcli.dist.maricopa.edu/director/)
- lingoworkshop.com (http://www.lingoworkshop.com/) - Useful open source scripts.
- Animation Math in Lingo (http://www.jmckell.com/) - Great tutorials for beginners and experts
- MediaMacros (http://www.mediamacros.com/) - Hundreds of free scripts, opens source games, and a database of Xtras (Plugins)
Mailing lists
- Direct-L (http://listserv.uark.edu/archives/direct-l.html) is probably the biggest Lingo mailing list
- Dirgames-L (http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames-l) is a list about Lingo for games
- Director-3D-L (http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l) is a pure 3D-Lingo list