Object-Oriented Programming With Lingo - MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference

Director scripting reference
Table of Contents

Advertisement

Each paradigm enables you to apply the advantages of object-oriented programming to your
scripts, so it does not really matter which scripting language you are using. You merely apply the
principles in different ways.
Because each scripting language uses a different paradigm to apply object-oriented principles, the
techniques described for one language won't work in the other language. Therefore, you only
need to read the content that applies to the scripting language you are using:
For more information on simulating object-oriented programming in Lingo, see
oriented programming with Lingo"
For more information on object-oriented programming in JavaScript syntax, see
oriented programming with JavaScript syntax" on page

Object-oriented programming with Lingo

In Lingo, parent scripts provide the advantages of object-oriented programming. You can use
parent scripts to generate script objects that behave and respond similarly yet can still operate
independently of each other.
You can create multiple copies (or instances) of a parent script by using Lingo. Each instance of a
parent script is called a child object. You can create child objects on demand as the movie plays.
Director does not limit the number of child objects that can be created from the same parent
script. You can create as many child objects as the computer's memory can support.
Director can create multiple child objects from the same parent script, just as Director can create
multiple instances of a behavior for different sprites. You can think of a parent script as a template
and of child objects as implementations of the parent template.
The discussion about Lingo parent scripts and child objects describes the basics of how to write
parent scripts and create and use child objects, and also provides script examples. It does not teach
fundamental object-oriented programming concepts; however, to use parent scripts and child
objects successfully, you must understand object-oriented programming principles. For an
introduction to the basics of object-oriented programming, see one of the many third-party
resources on that subject.
Similarity to other object-oriented languages
If you are familiar with an object-oriented programming language such as Java or C++, you may
already understand the concepts that underlie parent scripting but know them by different names.
Terms that Director uses to describe parent scripts and child objects correspond to the following
common object-oriented programming terms:
Parent scripts
in Director correspond to classes in object-oriented programming.
Child objects
in Director correspond to instances in object-oriented programming.
Property variables
oriented programming.
Handlers
in Director correspond to methods in object-oriented programming.
Ancestor scripts
programming.
on this page.
in Director correspond to instance variables or member variables in object-
in Director correspond to the Super class or base class in object-oriented
65.
Object-oriented programming with Lingo
"Object-
"Object-
55

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director mx 2004

Table of Contents