•
Case-sensitivity can vary between Lingo and JavaScript syntax.
Lingo is not case-sensitive in any circumstance—you can use uppercase and lowercase letters
however you want. For example, the following four statements are equivalent:
-- Lingo syntax
member("Cat").hilite = true
member("cat").hiLite = True
MEMBER("CAT").HILITE = TRUE
Member("Cat").Hilite = true
Although Lingo is not case-sensitive, it's a good habit to choose a case convention and use it
consistently throughout your scripts. This makes it is easier to identify names of handlers,
variables, cast members, and so on.
JavaScript syntax is case-sensitive when referring to objects, the top level properties or methods
that refer to objects, or when referring to user-defined variables. For example, the top level
method returns a reference to a specific Sprite object, and is implemented in
sprite()
Director with all lowercase letters. The first statement below refers to the name of the first
sprite in a movie, while the second and third statements result in a script error.
// JavaScript syntax
sprite(1).name // This statement functions normally
Sprite(1).name // This statement results in a script error
SPRITE(1).name // This statement results in a script error
Literal strings are always case-sensitive in both Lingo and JavaScript syntax.
For more information on using strings, see
Data types
A data type is a set of data with values that have similar, predefined characteristics. Every variable
and property value in Director is of a specific data type, and values returned by methods are of a
specific data type.
For example, consider the following two statements. In the first statement, variable
assigned a whole number value of 14, which is an integer. So, the data type of variable
integer. In the second statement, variable
which is a string. So, the data type of variable
-- Lingo syntax
intX = 14
stringX = "News Headlines"
// JavaScript syntax
var intX = 14;
var stringX = "News Headlines";
The values that are returned by methods or functions are also of an inherent data type. For
example, the Player object's
window is present. The returned value is
"Strings" on page
stringX
stringX
method returns a value that specifies whether a
windowPresent()
(1) or
TRUE
18.
is assigned a sequence of character values,
is string.
(0).
FALSE
is
intX
is
intX
Data types
15
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers