else if
Availability
Flash Player 4.
Usage
if (condition){
statement(s);
} else if (condition){
statement(s);
}
Parameters
An expression that evaluates to
condition
statement(s)
statement is
false
Returns
Nothing.
Description
Statement; evaluates a condition and specifies the statements to run if the condition in the initial
statement returns
if
statements that follow the condition inside curly braces (
Flash skips the statements inside the curly braces and runs the statements following the curly
braces.
Use the
else if
branches, you should consider using a
Example
The following example uses
if (score_txt.text>90) {
trace("A");
} else if (score_txt.text>75) {
trace("B");
} else if (score_txt.text>60) {
trace("C");
} else {
trace("F");
}
See also
if, else,
switch
An alternative series of statements to run if the condition specified in the
.
. If the
false
else if
statement to create branching logic in your scripts. If there are multiple
switch
statements to compare
else if
ActionScript Language Reference
or
.
true
false
condition returns
true
). If the
{}
statement.
score_txt
CHAPTER 2
, the Flash interpreter runs the
condition is
else if
to a specified value:
else if
if
,
false
287
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?