Using Director > Writing Scripts with Lingo > About variables

 

About variables

Director uses variables to store and update values. As the name implies, a variable contains a value that can be changed or updated as the movie plays. By changing the value of a variable as the movie plays, you can do things such as store a URL, track the number of times a user takes part in an online chat session, or record whether a network operation is complete.

It's a good idea always to assign a variable a known value the first time you define the variable. This is known as initializing a variable. Initializing variables makes it easier to track and compare the variable's value as the movie plays.

Variables can be global or local. A global variable can exist and retain its value as long as Director is running, while a local variable exists only as long as the handler in which it is defined is running. See Using global variables and Using local variables.