Macromedia Director: Lingo Scripting for Interactive CDs
If you're building a "Multimedia CD-ROM" or an interactive kiosk, you're using Macromedia Director 7. While Flash is okay for little web animations, Director is a beast. The heart of its power is Lingo, an English-like scripting language that is surprisingly flexible.
The Score and Sprites
Director uses a movie metaphor. You have a "Score" with frames and "Sprites" on the "Stage."
Writing Lingo
There are two styles of Lingo: the old-school "Verbose" style and the new "Dot Syntax" introduced in Director 7.
Verbose Style:
on mouseUp me
set the member of sprite 1 to "ButtonDown"
updateStage
go to frame "Main"
end
Dot Syntax (The future!):
on mouseUp me
sprite(1).member = member("ButtonDown")
_movie.go("Main")
end
Complex Logic with Parent Scripts
You can even do Object-Oriented Programming in Lingo using "Parent Scripts."
-- Parent Script: MyObject
property pValue
on new me, initialValue
me.pValue = initialValue
return me
end
on getValue me
return me.pValue
end
-- Usage in a regular script:
set myObj = new(script "MyObject", 100)
put myObj.getValue()
-- Output: 100
Director 7's new 3D engine is coming soon, but for now, mastering Lingo is how you make those high-budget interactive encyclopedias. Just remember: updateStage is your best friend when things aren't moving!