• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Modifying Variables

Variables are useful because you can always change their contents with updated information about the status of the movie or your viewer. Sometimes, this change involves assigning a new value to the variable. At other times, the change means adding, subtracting, multiplying, or dividing the variable’s numeric values, or modifying a string by adding characters. The variable myScore, for example, could be initialized at 0. Then, for every goal a player makes, the myScore variable changes in increments of 1. The job of modifying information contained in variables falls upon operators—symbols that “operate” on data.

Assignment and arithmetic operators

The assignment operator (=) is a single equal sign that assigns a value to a variable. You’ve already used this operator in the action set variable, which automatically puts the assignment operator between the entries of the Variable field and the Value field. You can also use the evaluate action, which gives you an empty Expression field in the Parameters pane. In that field, you enter your variable name and a value, with the assignment operator between the two entries (Figure 9.36). Table 9.3 lists the other common operators.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint