74
Flash Lite Statements
Example
In the following example, if the
myNum
parameter evaluates to 1, the
trace()
statement that
follows
case 1
executes; if the
myNum
parameter evaluates to 2, the
trace()
statement that
follows
case 2
executes; and so on. If no
case
expression matches the
number
parameter, the
trace()
statement that follows the
default
keyword executes.
switch (myNum) {
case 1:
trace ("case 1 tested true");
break;
case 2:
trace ("case 2 tested true");
break;
case 3:
trace ("case 3 tested true");
break;
default:
trace ("no case tested true")
}
In the following example, the first case group doesn’t contain a break, so if the number is 1,
both A and B appear in the Output panel:
switch (myNum) {
case 1:
trace ("A");
case 2:
trace ("B");
break;
default:
trace ("D")
}
See also
case
while
Availability
Flash Lite 1.0.
Usage
while(
condition
) {
statement(s)
;
}
Содержание FLASH 8-FLASH
Страница 1: ...Flash Lite 1 x ActionScript Language Reference...
Страница 6: ...6 Contents...
Страница 46: ...46 Flash Lite Global Functions...
Страница 62: ...62 Flash Lite Properties...
Страница 76: ...76 Flash Lite Statements...
Страница 110: ...110 Flash Lite Operators...
Страница 162: ...162 Index...