Chapter 16
404
To clear all current global variables:
•
Use the
clearGlobals
command in the Message window to set the value of all global variables
to
VOID
.
See
global
,
clearGlobals
, and
showGlobals
in the Lingo Dictionary.
To monitor the values of global variables during movie playback, use the Object inspector. See
“Using the Object inspector” on page 433.
Using local variables
A local variable exists only as long as the handler in which it is defined is running. However, after
a local variable is created, you can use the variable in other expressions or change its value while
Lingo is still within the handler that defined the variable.
Treating variables as local is a good idea when you want to use a variable only temporarily in one
handler. This helps you avoid unintentionally changing the value in another handler that uses the
same variable name.
To create a local variable:
•
Assign the variable a value using the equals (
=
) operator or the
set
variableName
=
value
command.
Unless the handler uses the term
global
to declare that a variable is global, the variable is
automatically a local variable.
To display all current local variables in the handler:
•
Use the
showLocals
command.
You can use this command in the Message window or in handlers to help with debugging. The
result appears in the Message window.
To monitor the values of local variables during movie playback, use the Object inspector. See
“Using the Object inspector” on page 433.
Expressing literal values
A literal value is any part of a statement or expression that is to be used exactly as it is, rather than
as a variable or a Lingo element. Literal values that you encounter in Lingo are character strings,
integers, decimal numbers, cast member names and numbers, frame and movie names and
numbers, symbols, and constants.
Note:
The
value()
function can convert a string into a numerical value. The
string()
function can convert a
numerical value into a string.
Each type of literal value has its own rules.
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...