MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 150

Actionscript language reference
Table of Contents

Advertisement

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
150
Chapter 5: ActionScript Core Language Elements
ActionScript Core Language Elements
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
or
.
true
false
condition returns
true
). If the
{}
statement.
score_txt
CHAPTER 5
, the Flash interpreter runs the
condition is
else if
to a specified value:
if
,
false

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents