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…
cout << “Do this” << endl;
cout << “Do this here” << endl;
cout << “What am i doing?” << endl;
cout << “???” << endl;
cout << “Finally, done!” << endl;
cout << “Not a valid answer” << endl;
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.