SWiSH Player Support
SWF4 or later - Supported Internally
Syntax
switch (expression1) {
case expression2 :
statements
default :
statements
}
Arguments
expression1; Any expression.
expression2; Any expression
statements; script to execute
Returns
Nothing.
Description
Action; used to create a branching structure for SWiSHscript statements. There can be multiple 'case' labels, and optionally a single 'default' label. The switch action evaluates the first expression within the parentheses. It then compares it to each expression in the case labels. If it finds one that matches, then the statements of the switch statement are executed from there. If none of the case labels match, and there is a 'default' label, the statements are executed from there. Use a 'break' statement between cases if you don't want the statements of following cases to execute as well.