/ Published in: ActionScript 3
URL: http://www.republicofcode.com/tutorials/flash/as3switch/
Expand |
Embed | Plain Text
switch (myVariable) { case 1: // Do something here break; case 2: // Do something here break; case 3: // Do something here break; default: trace ("None of the above cases were met") }
Comments
Subscribe to comments
You need to login to post a comment.

you can also have multiple cases to execute the same function / logic for example
switch (myVariable) { case 1: case 2: break;
}