User Guide
16 Chapter 2: Director Scripting Essentials
Some data types are shared between Lingo and JavaScript syntax, and some data types are specific
to one language or another. The set of data types that Director supports is fixed and cannot be
modified, meaning that new data types cannot be added and existing data types cannot be
removed. Director supports the following data types.
Data type Description
# (symbol) A self-contained unit that can be used to represent a condition or flag. For example,
#list or #word.
Array (JavaScript syntax only) Although not literally a data type, an Array object can be
used to work with linear lists of values. The functionality of an Array object is similar
to that of the List data type in Lingo.
Boolean A value that is
TRUE (1) or FALSE (0). In Lingo, all TRUE or FALSE values are simple
integer constants, 1 for
TRUE, 0 for FALSE. In JavaScript syntax, all true or false
values are by default the actual Boolean
true or false values, but are converted to
simple integer constants automatically when required in Director.
In Lingo,
TRUE and FALSE can be either lowercase or uppercase. In JavaScript
syntax,
true and false must always be lowercase.
Color Represents an object’s color.
Constant A piece of data whose value does not change.
Date Although not literally a data type, in JavaScript syntax a Date object can be used to
work with dates. In Lingo, use the date() method to create a Date object and work
with dates.
Float (Lingo only) A floating-point number. For example, 2.345 or 45.43.
Function (JavaScript syntax only) Although not literally a data type, a Function object can be
used to specify a string of code to run.
Integer (Lingo only) A whole number. For example, 5 or 298.
List A linear or property list made up of values or property names and values,
respectively.
Math (JavaScript syntax only) Although not literally a data type, a Math object can be
used to perform mathematical functions.
null (JavaScript syntax only) Denotes a variable whose value behaves as 0 in numeric
contexts and as
FALSE in Boolean contexts.
Number (JavaScript syntax only) Although not literally a data type, a Number object can be
used to represent numerical constants, such as a maximum value, not-a-number
(NaN), and infinity.
Object Although not literally a data type, an Object object can be used to create a custom
named container that contains data and methods that act on that data.
Point A point on the Stage that has both a horizontal and vertical coordinate.
Rect A rectangle on the Stage.
RegExp (JavaScript only) A regular expression pattern that is used to match character
combinations in strings.
String A contiguous sequence of keyboard symbols or character values. For example,
"Director" or "$5.00".