![MACROMEDIA FLASH 8-FLASH Скачать руководство пользователя страница 65](http://html2.mh-extra.com/html/macromedia/flash-8-flash/flash-8-flash_reference_3347197065.webp)
case
65
case
Availability
Flash Lite 1.0.
Usage
case
expression
:
statements
Parameters
expression
Any
expression.
statements
Any
statements.
Description
Statement; defines a condition for the
switch
statement. The statements in the
statements
parameter execute if the
expression
parameter that follows the
case
keyword equals the
expression
parameter of the
switch
statement.
If you use the
case
statement outside a
switch
statement, it produces an error and the code
doesn’t compile.
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")
}
Содержание 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...