<classwork>

Concatenating

Concatenating is adding string and/or numbers and/or variables.

For example

"hello" + "world"
returns
"hello world"

note: quotes indicate strings

Another example

"my_movie" + counter
returns
my_movie1

note: counter is a variable that is counting numbers, in this case the value is 1 the number.

another example.

there is an input text field called
yourName_txt

"Hello, "+yourName_txt.text+", "welcome to Flash!"

The result would be:
"Hello Name, welcome to Flash!"


ex. of concatenating script to target a movie clip randomly called "clip1", "clip2", "clip3", "clip4" on the root level and playing the second frame of that clip:

mynumber = Math.floor(Math.random()*4)+1;
_root["clip"+mynumber].gotoAndPlay(2);