Director: The Very Basics

Director is arguably the most powerful multimedia authoring program out there.
Lingo is its scripting language.
[Scripting vs. Programming. High level vs. low level. Easier vs. harder.]
That's what we're going to focus on in this class.
So we're going to ignore most of the complex Director functionality...

This is by necessity just the most basic of introductions.
Definitely check out the Director online help:
Go to Basics -> Director Basics.
If you're the sort who likes to have a book, I recommend
Macromedia Director MX and Lingo: Training from the Source by Phil Gross.
Check out Jessica's book reviews for other recommendations.

Windows
Stage - where the action takes place
Cast - where the elements (members) for your movie live
Score - where you tell your movie who's on stage at any point and what actions they should be taking
Tools window - lets you create quick vector-based image and text cast members
Paint window - lets you create graphical (bitmap) cast members
Message window - a way to try things out and also see what's going on inside

The score has different channels
For now, we're interested in:
1. Sprite channels - where you put the cast members you want on stage
[When you move a cast member to the score, it becomes a sprite]
2. Script channel - the only place you will put your lingo for now

Basic Loop
Keeps the score on one frame only
on exitFrame
   go to the frame
end


Properties
Sprites and cast members have properties that determine
where they are on stage and what they look like, etc.

They use dot.notation.
Some examples:
sprite.locH - the horizontal location of the sprite on the stage
sprite.locV - the vertical location of the sprite on the stage
[location on stage is measured from upper left hand corner (0,0)]
sprite.width - how wide the sprite is
sprite.height - how tall the sprite is
sprite.member - the cast member of the sprite
sprite.member.name - the name of the cast member of the sprite
member.text - for text and field members, what the text says
member.name - what the name of the member is
[For more properties, check out the property inspector]

Properties can always be tested and sometimes set.
Syntax: To set properties, use = sign.
sprite(1).locH = 270
sprite(1).locH = sprite.locH + 10
sprite(1).locV = 180
sprite(2).width = 100
sprite(2).width = sprite.width + 200

Events and event handlers
Director listens for certain events and
then acts according to your instructions:
on mousedown
on mouseup

Other useful events, system properties, etc.:
rollOver() or the rollover
the stilldown
mouseh
mousev
These can be tested but not set.


if statements
syntax:
if logicalExpression then statement

With if statements, you can test property conditions and
system events, and tell Director to act accordingly.
Example:
if rollover(3) then member(1).text = "i'm a square."