Introduction to Director-- lecture notes, October 25, 1999 -- |
||||||
Director from Macromedia started out as a multimedia tool for sales presentations. There are still a few traces of its origins, but by now it is best described as a multimedia programming environment. You can create mainstream-style productions with video, audio, image and text without writing code. Once you learn Director's programming language Lingo, you will find that it is a fairly powerful tool for developing interactive prototypes in general. Director is also the current tool of choice in the multimedia industry. Lots of users means lots of third-party development. Xtras, i.e., plugins, for all purposes are available for free or sale. This introduction covers the basic concepts and techniques. The goal is to enable you to create non-linear multiframe productions with rather straightforward user interaction. The section at the end provides a few pointers for your further learning. |
||||||
|
||||||
Basic concepts |
The stage in Director is what the user of your product (movie) sees and interacts with. When you develop your movie, there is a cast of all the "characters" that may appear on the stage. Members of the cast can be images, text pieces, sounds, video clips and so on. The score is where you decide what goes on stage and when. It is like a table, where the columns are called frames and the rows are channels. When the user runs the product, the score is played one frame at a time. The red vertical line -- the playback head -- shows which frame is currently showing on the stage. When a cast member is placed in the score (and on the stage), it is called a sprite.
|
|||||
|
||||||
The chain of events |
When a Director movie is running, it communicates with the outside world through events. Most events come from the user: clicking on something with the mouse, typing on the keyboard, etc. You put event handlers in your movie to decide what will happen when certain events occur. When the user, for instance, clicks on a sprite, the sprite gets the first chance to react to the event (which, by the way, is called mouseDown). If the sprite has no mouseDown handler, the event is passed to the cast member of the sprite. No handler there either? Then the event is passed to the frame, and finally to the whole movie. As you can see, event handlers can be put in (at least) four different places. This is one of the most common sources of confusion and error in Director programming.
|
|||||
|
||||||
|
||||||
Multiframe movies |
When a movie consists of more than one frame, the playback head moves through the frames as the movie runs. If a sprite is in one place in frame 12, then slightly to the left in frame 13, it will look like the sprite moves to the left. That is how I made the aliens bounce. A very common structure is to give the user a set of choices on the screen. The movie will play different sequences depending on what choice the user makes. In Director, you would typically do this by having different sections of the score for each choice. In my case, the "love" animation sits in frames 3 through 39 in the score. "Hate" is from 40 to 77. And so on. In the Alien Relations Primer, the first frame contains a loop (as above) and four clickable sprites. The "love" sprite, for instance, has a handler like this: on mouseUp Frame 3 is the start of an animated sequence where one alien changes color (using a sprite Ink effect) and then the other moves. The "love" section ends with a jump back to the user selection frame: on exitFrame
|
|||||
Useful links |
The Director Developers Center at Macromedia's own site is full of learning materials and tips for Director users. Very useful. The Director Web is an information-rich voluntary effort. Good place to find examples. The FAQ is also good (but very ugly). updateStage has a number of good how-to articles under Back issues in the Archive. |
|||||