ANIMATIONS SOFTWARE : GRAPHICS & ANIMATION SOFTWARE : FLASH
Creating your own backdrop or overlay
In addition to using the behaviors in the sample movie to create a backdrop or overlay, you can create a backdrop with just a few lines of Lingo.
Examining the backdrop Lingo
Open the Script window for the movie and view the BackdropBehavior script. This Lingo declares and holds properties for the Parameters for "BackdropBehavior" dialog box.
The Lingo picking functions
You can use five Lingo functions to create picking…
Creating picking with Lingo
The on checkForModels handler, which is called by the mouseUp script on the 3D sprite, does several things. First, it updates, in the spriteToWorld display field, the position vector of where the user clicked.
Property lists
This article assumes that the reader is already familiar with basic Lingo. This article is not for beginning Lingo programmers.
Troubleshooting Lingo
Director includes several tools to help you find problems in your Lingo scripts. The Message window, the Debugger window, the Watcher window, and the Script window help you use basic troubleshooting techniques to quickly find find and fix Lingo code that isn't doing what you want.
Why and how to use linear lists
This article is about linear lists, as opposed to property lists, and how you can use multiple lists to store a variety of information about things you need to track.
Using JavaScript Syntax in Director MX 2004 for 3D Visualization
The shift to JavaScript syntax is a major advancement to Macromedia Director, and is important for a number of reasons. The feature provides a more common language and syntax between Macromedia Flash MX and Macromedia Director.
Creating a JavaScript Syntax Workflow
Macromedia Director MX 2004 introduces JavaScript syntax as an alternative scripting language. JavaScript syntax is based on Mozilla’s SpiderMonkey engine and implements core JavaScript 1.5 as its base language. As such, many external editors are available that implement syntax coloring and auto completion features.
Dynamic Run-Time Linking to External Media with Director MX
How to use Lingo to import and manipulate external files on the fly with Director MX.
Lingo: 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.
Lingo: Scriptable authoring
You can automate many authoring tasks by using Lingo commands that manipulate the Score or Casts…
Lingo: Complex lists
The Complex lists show demonstrates behaviors that manage a complex database list.
Lingo: Multiple child objects
"Simple Child Object," is an example of how to create a child object from a parent script…
Lingo: Simple child object
The best way to start learning about parent scripts and child objects is to study a simple movie that creates one child object from a simple parent script.
Imaging Lingo Basics
Learn how to create and manipulate images in Director.
Types of Scripts
Scripts are a way you can give Director specific instructions to execute tasks. They can be as simple as making your computer beep or as complex as creating a flight simulator game.There are 4 types of scripts…
Lingo & Programming Terminology
Notes you can place within a script that help explain statements or provide other general information about the content of a script. These notes are ignored by the computer when executing the script. A double dash (--) is placed before a comment to identify it as such. It is a good idea to provide a comment before defining a global variable so it is clear what the variable is...
Learning to Program with Lingo
With the release of Director MX 2004, the program now supports 2 programming languages. These are Lingo and JavaScript Syntax. You can read more about JavaScript Syntax here. JavaScript Syntax was introduced as there was a high demand from the programmer user base for a language that is closer to other common languages.
Lingo: Local, Global and Property Variables
Variable is a data holder. This data usually changes (varies) over time. The main difference between local, global and property variables is the accessibility of the data the variable holds - the ability to get and set the values of the variable…
The Power of Lists: List Lingo
Lists are variables that contain multiple pieces of data at once. Each unit (known as an entry) can be manipulated without affecting the others. Knowledge of lists is vital for a strong command of Lingo’s advanced functions. Well-written lists help manage multiple windows, Xtras, Parent/Child objects and any other data you have in your movies.
User Tracking with Lists
Lists can be useful to keep track of a user’s path through your presentation, recording the precise order and number of locations visited. If you would like more explantaion of what lists are and related list Lingo, see the The Power of Lists - List Lingo technote.
Getting a handle on Lingo: Writing generic scripts & custom handlers
Lingo can be a powerful tool. With Lingo, you can control an entire application from a single frame in the Score. Most of us creative types don't like programming much and would prefer to write as little Lingo as possible. However, if you intend to push your Director projects as far as they can go, understanding Lingo and the fundamentals of programming is vital.
Using me and other parameters in Lingo
The term me is a parameter. A parameter is a variable that is used to add flexibility to handlers or behaviors. When you apply a behavior from the Behavior Palette, often you will be prompted to assign certain parameters to that behavior. The parameters can be thought of as the behavior's properties. It is a Lingo convention to call the first parameter of a handler me.
Understanding Behaviors: Creating a Parameter Dialog Box
Behaviors are script objects, and like every other object in Director (like sound, text, images), they can have their own properties. Behaviors are most useful when their properties can change each time they are are applied. This is because they are flexible and can be reused from one project to the next without rewriting the Lingo. These properties are also know as parameters for the behavior...
Inter-behavior Communication
Global variables are one way scripts can share data and communicate with each other. Another form of communication can be the sending of messages with arguments to behaviors using the sendSprite, sendAllSprites and call commands…
Primary Event Handlers: Screensaver Lingo
This page looks at the use of Primary Event Handlers to create scripts that could be used in a screensaver type application. There are 4 primary event handlers - keydownScript, mouseDownScript, mouseUpScript, timeoutScript.
Exporting text from Director
Exporting and importing information with Director is done using the FileIO Xtra. Below outlines how to create a text file from Director, write text to it, open an existing text file and read it in Director.
Using Movies In A Window (MIAWs)
Creating MIAWs is relatively simple. The difficult part is planning when to use them. MIAWs can be created with one line of Lingo, but to gain full control the properties, such as MIAW size, location, appearance, it is worthwhile setting all them yourself rather than relying on the default settings.
Lingo Alternatives to the Tempo Channel
The tempo channel is intended for straightforward linear presentations. When your movie gets more more sophisticated, it is a better to use Lingo alone.
Parent/Child Objects
Director's scripting capability is extended to the full with the use of Parent scripts and child objects. While it may seem intimidating at first to new-comers of object-oriented programming, it is not too difficult once you get the hang of it.
Parent/Child Scripting 2
In the first P/C tutorial, parents, children and ancestors were confined to the message window. This emphasises the fact that these objects exist entirely in RAM. The next step is to use them to control physical aspects of your presentation.
Users bloomfield - Intro to Lingo: Hot Spots
The purpose of this tutorial is to recreate some of the basic navigation and effects used in the best-selling game, Riven. These are: Dividing the screen into 3 areas known as "hot spots," though you can think of them as invisible buttons. Each hot spot will react differently to a mouse rollover or to being clicked on...
What is Lingo?
Lingo is Director's own programming (or scripting) language…
Let's script!
To demonstrate some basic script features, ignore movie making and have a look at a bit of Director called the Message window.
Making an interactive movie
In the creation of the movie this tutorial will cover: where to write your script, event handlers, commands, arguments, markers and behaviors…
Scripting
There are four places to write your script for four different reasons. There is a frame script, a sprite script, a cast script and a movie script , each performs different functions with different levels of importance. You will see this as you progress.
Using cue points with Lingo
The event this tutorial will cover is on cuePassed, there are others. With this event when the sound being played reaches the cue point you can program something to happen.
PuppetSprites and repeat while loops
It is possible to make a sprite respond to the user, for example letting the user drag it about. When you drag a file into the wastebasket or move a window around on your monitor you, the user, are controlling the position of the file/window…
Dragging a sprite
The movie requires that the match follows the position of the cursor when the user clicks down on the match and drags it…
Repeat while commands
A repeat while command will make Director keep asking a question about a condition and depending on that condition it will repeat an action until the condition changes…
The next stage is to make the jump to the firework animation when the match intersects with the firework
When you drag a file from a floppy disk to the hard disk of your computer the file's icon intersects with the hard disk's icon or an open window and the computer's operating system tells it that on this event a file transfer must happen. This is an intersect event handler and a file transfer command.
Variables
I am just going to tantalise you with a very simple use of one kind of variable. But first what is a variable? Technically a variable is an area of the computer's Random Access Memory (RAM) which contains a value and is assigned a name. Using Lingo you create a variable by coming up with a name and entering a value, which all sounds horribly vague.
Playing a movie from within a movie
It is possible to programme Director to open and play a Director movie from within another movie. This feature can be used to create one large continuous movie from a series of smaller movies, a good technique for overcoming any file size problems. Alternatively this feature can be used to enhance interactivity expanding the resource base from which the end user can extract information.
Using Lingo commands to play a movie within a movie
You can jump from one movie to another using the simple Lingo commands that you are already familiar with, go to and play/play done…
Lingo hierarchy
In Lingo's hierarchy a movie script is the lowliest. It carries out the background work. Any other script will override a movie script. In this example the movie script sets a default action of moving on one frame each time the mouse is clicked. In order to make the buttons work and carry out their own navigational commands their script must override the movie script.
To write a cast script
Open the Cast window, highlight the return button cast and click the script icon at the top of the window…
Constructing a presentation
The object of this exercise is to construct the outline of a presentation and in so doing; create a template for a presentation, write a movie script and look at the way one script can override another.
Introducing the if, then, else script
Lingo has the ability to ask Director to make decisions. It uses the following pattern…
Controlling playback
The object of this exercise is to demonstrate how Lingo can control QuickTime movies. For the purposes of this demonstration select Loop in the Property Inspector and OK the window. Click on frame 40 and let it play.
Play and Play done
Open your button/destination movie from the lingo tutorial. Swap the go to frame "yellow" command with play "yellow", rewind and play.
Welcome to the Lingo Lounge
Hello Lingo fans. Welcome to the first weekly installment of the Lingo Lounge. Every week I'll dispense useful tips, tricks and techniques for Lingo programmers.
Vector Member Fireworks
Several times over my game-building career I have needed to add fireworks animations to a game. These are usually just for an interesting effect, and not necessarily a real part of the game.
Table Manners
In Director 4 and 5, there was only one way to display tabular information created with Lingo. This was to use a mono-spaced font, like Courier, and line up the columns of the table with excess spaces…
Shining a Flashlight with Alpha Channels
The new Imaging Lingo is sure to be the most talked about feature of Director 8. There's so much that can be done with it that even the developers that have played with it during the beta test haven't begun to scratch the surface.
Using Lingo to Create Brownian Noise
A Brownian Noise generator is a simple program that uses random numbers to make a musical composition. Instead of just picking a random number and playing a note that corresponds…
"Goo" With Director 8
In the Lingo Lounge we have a request. A reader asks: "There's this program called Goo, that lets you drag and stretch images from anywhere you click on the mouse. In Director 8, they have the image lingo and one example that lets you pull on the corners of the image to distort it, but not from anywhere inside the image. Is there a way to do this, a trick of some kind to emulate Goo?" ...
Lingo Collision Detection, Part 1
Director has several Lingo functions that are meant to be used for collision detection. Unfortunately, these functions fall far short of what is needed for quality collision detection…
Lingo Collision Detection, Part 2
We looked at mathematical ways to detect collisions. All of these methods fall short in one way or another. Most will not detect collisions around shapes more complex than a rectangle. Others will not detect collisions until the Stage has already been updated to show the objects overlapping...
Lingo Collision Detection, Part 3
Director 8 offers a new way to do collision detection. Thanks to the getPixel function, we can examine contents of individual pixels…
Text Auto-Completion
You know when you are using a browser and you begin to type the URL and the browser fills in the rest of the name? Like if I were to type "http://clev", the browser would fill in "http://clevermedia.com" without me having to type in the other letters. This is called auto-completion and it is a very nice interface technique.
Lengthening sounds with internal loops
Director 8's new Sound Lingo allows you to set loop points in a sound, and then the number of loops to perform…
Creating Starfields and Galaxies from Scratch
With Director 8, we can use imaging Lingo. The simplest example I could think of was a starfield. Instead of using a Stage-sized bitmap for a background, you can use Imaging Lingo to create a random starfield that will look good, but take up little or no file space. The way to do this is to generate a random horizontal and vertical location, along with a random shade of gray, and draw it on to a bitmap. This handler will take n as a parameter and draw n stars.
Comparing Text Display Methods
In Director, all you need to do is plop down a text member and update its text property. However, this can be slow. Let's compare four different ways of displaying text…
Using Date Objects
In Director 7 and 8, the date string expression still exists. However, it is there simply for backwards compatibility and for simple uses. A much more powerful feature now exists: date objects. Date objects are like points, rects, and colors in that they have a set of properties, and operations can be performed on them. The three visible properties of a date are year, month and day, in that order. Here is a simple example in the message window.
Using the randomSeed
Director, like many other programming languages, has a built in random number generator. In Lingo, it is the simple random() function…
Agocg - Lingo Tutorial Movie Details
Welcome to the new and improved Lingo Web Tutorial! This resource is intended to provide instruction, with clear examples, in using the Lingo scripting language for Director movies…
Creating animated textures for 3D models using Lingo
Creating animated textures and applying them to 3D models is a great way to add special or realistic effects to 3D models you create or import into Macromedia Director…
Creating primitive 3D shapes with Lingo
This tutorial demonstrates one way to create primitive 3D shapes in Director using Lingo. While viewing this movie make sure to open the Shockwave 3D viewer for the 3D cast member named "newPrimitive". This will allow you rotate the camera around the models created.
Director Setup For Lingo
In the Director environment, Lingo animation is done by changing sprite and cast member properties. It is sufficient for most of this tutorial to work with a single sprite's loch and locv properties to demonstrate how the numbers are behaving.
Data Structures and Recursion
Data structures store data in a way that reflects some relationship between the data, and is easily useable in a program. Lingo provides some built-in data structures such as lists. This section describes how data structures are created using objects, and some of their common uses in animation.
Object-Oriented Fundamentals
Understanding how objects can be used greatly simplifies the programming of complex animation. Investing a little time in getting the hang of it yields big returns.
Perspective & Other Depth Cues
It's interesting how difficult it is to see the motion for what it is, 2D discs that are changing in size, moving in 2D, and changing color. The human mind is thoroughly fooled into seeing depth.
Quad Property
The sprite.quad property is a list of four points that specify the screen coordinates of the corners of a sprite. If the quad property is set in Lingo, Director will distort the sprite accordingly. This allows the rendering of 3D rotation of a sprite.
One Axis
A script shown with a movie is the behavior script attached to the sprite. If you copy the script from the web page to Director, the invisible characters from the page may cause script errors…
Two Axes
This script is the same as the last, but now there is vertical velocity as well as horizontal. Moving an object both horizontally and vertically produces a diagonal motion…
Checking Conditions
Usually you'll want to have your animated object react to certain conditions. For example, in the two-axes demo it would be nice to have the object react to reaching the edge of the stage by bouncing off. Other conditions might be a user action, the passing of a certain amount of time, the state of another object you are animating, a random event, or many others.
Physics Model
A distinguishing characteristic of motion in the real world is that it is continuous. Objects don't jump instantaneously from point A to point B, nor do objects at rest start going 100 mph all of a sudden. Most animation attempts to give the impression of continuous motion, and using the ideas in physics is a good way to achieve that.
Surface Gravity
Near the surface of the earth, acceleration due to gravity is constant and downward. What this means in terms...
Combining Forces
When more than one force is acting on an object they are combined by adding them together. To do this with a set of forces Force1, Force2, Force3, etc, the vertical components are summed, and the horizontal components are summed…
Friction
Friction occurs when materials are in contact with each other but have different velocities. This demo deals with air friction, which is a useful one in animation. An object moving through air experiences friction with the air, which pushes against the object.
Spring Forces
Imagine a spring with one end anchored to a surface, and the other with an object attached. If you push or pull on the object and let it go, it will oscillate back and forth because of the force that the spring exerts on it. The spring is trying to return the object to its resting position.
Mass
Mass is a measure of how much matter an object is made of, and is related to weight. In physics it appears in the equation…
General Gravity
The equation for general gravity governs all objects, not just those close to the surface of the earth as is covered in surface gravity. Near the surface of the earth certain elements of the general equation are simplified.
Inventing A Force
Most forces encountered in human experience fall into one of the categories already covered. These represent a categorization of forces: surface gravity which is constant, air friction which depends on velocity, and spring which depends on position. Most likely a behavior you want to achieve will fall into one of these categories, or a combination of them.
Direction Of Velocity Using Sine & Cosine
In this tutorial, the velocity of the object is specified by variables for direction and speed rather than x and y components. The direction is a value for t, as described in the definition of sine and cosine. When it comes time to move the object, x and y velocity components are found by cos(t) and sin(t), respectively. Programming it this way makes it easier to "steer" the object.
Direction of Force and Acceleration Using Sine & Cosine
In the car tutorial, t specified the direction of velocity. In this demo, t specifies the direction of force and, consequently (since there's only one force), acceleration. Take a look at the movement in the classic game "asteroids" and compare it to the car demo. For an explanation of t, see Sine & Cosine Definitions.
Collision Using Spring Force
When two objects rebound after colliding with each other, it is due to a spring force, even though it may not look like it. When two billiard balls collide, the compression of the ball is limited to a miniscule fraction of its width but it still happens.
General Continuity
The continuity of motion that the physics model provides can be generalized to provide continuity for any property or variable.
Independent Model Rate
This section describes a method of programming incremental animation that gives two advantages…
Parametric Animation
When Director does "tweening" it's using parametric animation, but doing it in lingo gives much more variety and control. Take a look at this simple example and notice how it differs from incremental animation.
Standardizing the Parameter to 0->1
Standardizing the parameter means using the same range for the parameter in all parametric animation. In particular, standardizing the range to p:0->1.
Driving the Parameter
p can be driven by such things as: Location of an object (such as a slider), Mouse location, Elapsed frames, elapsed time (frame-rate independence), Number of characters entered in a field, Scroll position of text member, Digital video time, A value given by an Xtra...
Biasing the Parameter
Director gives tweening options to 'ease-in' and 'ease-out'. The effect is to regulate the speed of the object along its path. In parametric animation, this is done by 'biasing' the parameter.
Using the Parameter
This section goes over different ways of using p, after driving it and biasing it. Functions that use p to calculate the value for a property or variable will be called "animator functions". There is one animator function for each property or variable being animated.
Linear Motion
The animator functions used so far in the tutorial have all produced linear motion because they are linear functions of the form Ax + B, created by shifting & scaling. It is the simplest type of function and the most frequently used.
Circular Motion
The method of generating circular motion is directly related to the definitions of sine and cosine.
Motion Along a Spline
There are a variety of functions that generate spline curves. They all use a set of points to make the curve, but differ in how they use the points…
Combining Motions
Functions can be combined and used as the building blocks of more complex motions. For example, a linear function can be used and on top of that a sin() function can be added…
Combining Motions Independently
To start, this tutorial uses linear as the primary motion, and sine as the secondary motion, or offset. Offsetting linear by sine creates the curve shown in The Sine Wave. The black dot in the demo shows the linear motion, and the red dot shows the linear with a sine function added.
Combining Motions Dependently
A secondary motion (offset) can be made dependent on the primary motion in various ways. In this demo, the sine offset is made perpendicular to the linear motion and scaled according to the length of the linear path. This gives the object's path a consistent shape.
Multiple Drivers
When an animation is based on several factors in the program, each factor is a driver of the animation and will drive a separate parameter…
Model/Display Separation
The animation model is the set of variables, such as position, velocity, etc, that store the state of the animation along with the algorithm that makes their values change. It is a mathematical model, consisting of numbers and calculations with them.
Recorded Animation
In recorded animation, model variables are set from stored values. A few uses are recording human motion (mouse movement) and recording incremental animation. Recording incremental animation would then let you play it back with the kind of control parametric animation gives. You could also get ahold of some motion-capture data and massage it into a form that can be used for playback within Director.
Time-Based Animation
An object animated based on time will move from point A to point B in the same amount of time regardless of the frame rate of the movie. The slower the frame rate, the farther the object moves each frame in order to maintain the same speed.
Lingo: Functions
A function accepts zero or more values, performs some set of operations on them, and returns one value as the result. The values accepted by the function are called the parameters, or arguments of the function. Almost all functions have at least one parameter (pi() is one exception).
Shifting & Scaling Numbers
"Shifting and scaling" is another way to say adding and multiplying. But more, it describes the effect of adding and multiplying on ranges of numbers. In the tutorial a range of numbers is denoted "x:10->15" which means that the variable x goes from 10 to 15.
Sine & Cosine Definitions
The sine and cosine functions are defined on what is called the unit circle, which is a circle with a radius of 1 and centered at the origin, (0,0).
The Sine Wave
As described in Sine & Cosine Definitions, t is the length of an arc on the unit circle. If the sine function is graphed with t on the horizontal axis and sin(t) on the vertical axis, this is the resulting curve…
Vectors
A vector extends from the origin to some point. A vector can be used to specify a direction and a size (which is its length), so it is a useful term in describing these with one word.
Bezier Curves
The bezier curve is defined for a single segment, which has two endpoints and two 'handles', one for each endpoint. When two segments are joined and share an endpoint, that point has two handles, one from each segment. If these handles are on a line with the endpoint the segments join smoothly.
Lingo Math Functions
In this tutorial, you learn the Lingo Math Functions...
The Round-Off Effect
When either the vertical or horizontal position of a sprite is set in Director, it is automatically rounded to the nearest integer. If sp.locv is set to 10.4, its value will be rounded to 10.
Integer Division
In Director, if both operands to a division are integers Director will return an integer, dropping any decimal portion of the result. For example, in the message window…
Using Date Objects and HTML to Make Calendars
With the systemDate, you can determine today's date. Or, you can create a date object for any day. A great feature of date objects is that you can perform operations on them…
Making timers that display in Time format
The two primary ways that you can tell time in Director are the ticks and the milliseconds. The latter is more precise, so we will deal with the milliseconds in this article. The function the milliseconds counts thousandths of a second since Director…
Limiting text input
A common situation that I run into is that I want to limit the information that users can type into an editable text member. Suppose, for instance, that you want the user to enter their name…
Making a Magnifying Glass
One of the questions I often get asked is how to make a fake magnifying glass in Director. Until Director 8's Imaging Lingo, this was done with Xtras or by faking it with multiple images. Now, with only a few lines of Lingo, you can make the effect.
A Button Behavior with a Visited State
How to make a button that changes color or appearance if the user has already visited the frame that the button leads them to. This is an understandably desirable feature, as hyperlinks in Web browsers work this way.
Using Score Labels to Create Navigation Buttons
It bothers me that some Director programmers do not use Score labels in their movies. Just as a programmer should use useful, clear variable and handler names…
Restricting Behaviors to the Proper Sprites
Director 8 introduced a new behavior handler that can come in handy if you are developing Lingo behaviors for non-programmers. In many workplaces, the Lingo programmer…
Creating a Random List
Random elements are great additions to any Director movie. Let's say, for example, that you have a set of ten sounds, one of which is selected at random to play when a user clicks a button. The problem with this type of randomness is that it is very possible for the same sound to be played twice in a row...
Using Hidden Debugging Tools
Think that the Lingo debugger takes care of all your debugging needs? Think again. The hardest bugs to figure out are the ones that don't show themselves when running your movie in Director, but only appear in Projectors or Shockwave. How does this happen? Simple. Shockwave and Projectors are a different environment than Director...
Capturing Double Clicks with Lingo
A funny thing happened while writing this Lingo Lounge column. It was, and is, to be about capturing double clicks on buttons. I was going to start by explaining how the old Lingo property the doubleClick doesn't really work, because it simply returns TRUE...
Creating Ripples with Imaging Lingo
Here's what Lingo programmers do when they are bored. The following behavior, when attached to a frame, lets the user create ripples across the Stage. They can click once for a single ripple, or click and drag to create multiple ripples.
Linking Multiple Text Entry Fields
Have you ever seen a set of text entry fields that are linked together so the user can just type right from one to the other? You might see this done for fields that let the user type a product serial number, a telephone number, or even a zip+4 code…
Using Director with Databases: Part 1
I'll show you how to let the user (or yourself) enter data into a small database. I'll also show you how to list the items in the database…
Using Director with Databases: Part 2
This tutorial, let's expand that project to include a way to save and load the database so that you don't need to start from scratch each time you run the program. I'll also show you how to export the information in the database in a format that can be read by other programs, like Microsoft Excel.
Director Card Game Tutorial
This tutorial will show you how to get started making a card game in Director using the Lingo programming language. It may seem like a strange topic for a tutorial, but we hope that not only will you get an idea on how to make a card game, but also get some experience with objects, behaviors, and other Director basics...
Director Single Frame Animations
If you need to create dynamic animations at runtime, you'll want to learn about single-frame animations…
How to Build a Timer Object Using Lingo
Check out this tutorial for an example of how to make a timer object using object oriented programming with Lingo…