User Guide

Data types 17
Note: Many of the data types and objects that are specific to JavaScript syntax contain their own set
of methods and properties that can be used to further manipulate those types. While the Director
Scripting Reference may refer to some of these methods and properties, it does not include complete
reference information about them. For more detailed information on these data types and objects,
and their methods and properties, see one of the many third-party resources on the subject.
The built-in properties in Director, such as the Cast object’s name property, can only be assigned
values that are the same data type as that of the propertys inherent data type. For example, the
Cast object’s
name propertys inherent data type is a string, so the value must be a string such as
News Headlines. If you try to assign a value of a different data type to this property, such as the
integer 20, a script error occurs.
If you create your own custom properties, their values can be of any data type, regardless of the
data type of the initial value.
Both Lingo and JavaScript syntax are dynamically typed. This means that you do not have to
specify the data type of a variable when you declare it, and data types are automatically converted
as needed while a script runs.
For example, the following JavaScript syntax initially sets the variable
myMovie to an integer, and
later in the script it is set to a string. When the script runs, the date type of
myMovie is converted
automatically.
-- Lingo syntax
myMovie = 15 -- myMovie is initially set to an integer
...
myMovie = "Animations" -- myMovie is later set to a string
// JavaScript syntax
var myMovie = 15; // myMovie is initially set to an integer
...
myMovie = "Animations"; // myMovie is later set to a string
undefined (JavaScript syntax only) Denotes a variable that does not have a value.
Vector A point in 3D space.
VOID (Lingo only) Denotes an empty value.
Data type Description