Okay, you have made a movie clip, and you want it to change. Problem is, you have more than one change to make depending on the results of a user action or what-have-you... What do you do?
Simple.
You take the variable and put it into one of two types of condition statements: If or Switch-Case. The syntax is different for the If than it is for the Switch, but they do the same thing. They take the variable and give you different results depending on its value.
"If" conditions are like Boolean variables. The result is based on True or False, or in the case of the Boolean variable, 1 or 0.
"Switch" conditions give you three or more possible results. The SWITCH takes the variable and tells the rest of the statement to make a decision based on it. CASE is where the variable is tested for value, and it gives you a result based on one of many possibilities.
if(variable1>=3){
gotoAndStop(2);
}
The above tells the file to go to frame 2 and stop there if the variable is at least a value of 3. You can add an ELSE statement after it, but I only suggest it if you don't want to mess with the SWITCH.
switch(variable1){
case variable1>=3&&variable1<6:
gotoAndStop(2);
case variable1>=6&&variable1<9:
gotoAndStop(3);
}
if(variable1>=3&&variable1<6){
gotoAndStop(2);
}else{
if(variable1>=6&&variable1<9){
gotoAndStop(3);
}
as you can see, it takes less logical confusion to use the switch statement then it would to use an IF-Else. The way to read the above is: if variable1 is greater than or equal to 3, and less than 6, then go to and stop on frame 2...if it's greater than or equal to 6, and less than 9, then go to and stop on frame 3. The syntax is radically different between the two, so you should definitely decide which one would work best BEFORE you type it out.