"Case" Statements

I’m working on a bunch of buttons that do different things depending on what the user has clicked before. Does anyone know if Case exists in Flash like it does in C++, or should I just use else If else If (and so on)?

Can you explain what case statements do in C++?

why don’t you just give each button some on (release) event?

cases are also called switch statements. different things take place depending on the user’s input
say i had 5 things i could do, a case would look like this:
//this is C++ now…
switch (choice)
{
case 1:
cout << “Do this” << endl;
break;
case 2:
cout << “Do this here” << endl;
break;
case 3:
cout << “What am i doing?” << endl;
break;
case 4:
cout << “???” << endl;
break;
case 5:
cout << “Finally, done!” << endl;
break;
default:
cout << “Not a valid answer” << endl;
break;}

see? it takes variable “choice” and it’s value is tested here. if it’s equal to 4, it would output “???”, 5, “Finally, done!”, etc.

Sounds like it would be pretty easy to emulate that in flash… simple functions/arrays/user imput calculations.

It would take some amount of scripting… but mostly basic commands… not anything too indepth.