• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Controlling Information Flow > Concatenating Variables and the Eval ...

Concatenating Variables and the Eval Function

The addition operator (+) adds the values of numeric data types. But it can also be used to put together strings and variables holding string data types. This is called concatenation. Concatenation of variables and strings lets you create target paths and complicated expressions. For example, a common practice for naming duplicate movie-clip instances is to concatenate a variable with the name of the original movie clip. The variable is simply a counter that increases by one each time a duplicate is made. If the movie clip name is mushroom and the variable name is counter, then you can concatenate a new name with the following expression:

"mushroom" + counter


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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