default
Availability
Flash Player 6.
Usage
default: statements
Parameters
Any statements.
statements
Returns
Nothing.
Description
Statement; defines the default case for a
parameter of the
expression
operation) any of the
statement.
A
is not required to have a
switch
have to be last in the list. If you use a
an error and the script doesn't compile.
Example
In the following example, the expression A does not equal the expressions B or D, so the
statement following the
var dayOfWeek:Number = new Date().getDay();
switch (dayOfWeek) {
case 1 :
trace("Monday");
break;
case 2 :
trace("Tuesday");
break;
case 3 :
trace("Wednesday");
break;
case 4 :
trace("Thursday");
break;
case 5 :
trace("Friday");
break;
default :
trace("Weekend");
}
See also
switch, case,
142
Chapter 5: ActionScript Core Language Elements
ActionScript Core Language Elements
statement doesn't equal (using the strict equality [
switch
parameters that follow the
expression
default
default
keyword is run and the
default
break
statement. The statements execute if the
switch
case
case statement. A
statement outside a
trace()
CHAPTER 5
keywords for a given
case statement does not
default
statement, it produces
switch
statement is sent to the log file.
]
===
switch
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?