Else If Statement - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
In the following example, the
greater than or less than 18:
if (age_txt.text>=18) {
trace("welcome, user");
}
else {
trace("sorry, junior");
userObject.minor = true;
userObject.accessAllowed = false;
}
In the following example, curly braces
follows the
statement:
else
if (age_txt.text>18) { trace("welcome, user"); } else trace("sorry,
junior");
See also
if statement

else if statement

if(condition) {
statement(s);
} else if(condition) {
statement(s);
}
Evaluates a condition and specifies the statements to run if the condition in the initial
statement returns
false
the statements that follow the condition inside curly braces (
, Flash skips the statements inside the curly braces and runs the statements following
false
the curly braces.
Use the
statement to create branching logic in your scripts. If there are multiple
elseif
branches, you should consider using a
Availability: ActionScript 1.0; Flash Player 4
Parameters
condition:Boolean
206
ActionScript language elements
condition is used to check whether the
else
({})
. If the
condition returns
else if
switch
- An expression that evaluates to
are not necessary because only one statement
, the Flash interpreter runs
true
). If the
{}
statement.
or
true
false
variable is
age_txt
if
condition is
else if
.

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF