
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Some Basic Phrases
|
9
Perhaps not as friendly as saying hi, but it illustrates one of the true foundations of
programming: Flash can remember something for you, provided that you label it so
that it can be found later. For example, in your second line of code, we had Flash
remember your first name, and we named the reference to it
firstName. Flash remem-
bered your name and displayed it in the Output window, due to the trace() com-
mand, when you tested your movie.
The fact that Flash can remember things for us is crucial in programming. Flash can
remember any type of data, including text (such as your name), numbers (such as
3.14159), and more complex kinds of information that we’ll discuss later.
Official variable nomenclature
It’s time for a few formal terms to describe how Flash remembers things. So far, you
know that Flash remembers data. An individual piece of data is known as a datum.A
datum (e.g., “Hi there, Flash!”) and the label that identifies it (e.g.,
message) are
together known as a variable. A variable’s label is called its name, and a variable’s
datum is called its value. We say that the variable stores or contains its value. Note
that “Hi there, Flash!” is surrounded by double quotation marks (quotes) to indicate
that it is a string of text, not a number or some other kind ...