If Statement - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Enter the following ActionScript in a frame on the Timeline:
var giants:Team = new Team("San Fran", "SFO");
trace(giants.name);
giants.name = "San Francisco";
trace(giants.name);
/* output:
San Fran San Francisco */
When you trace giants.name, you use the
See also
addProperty (Object.addProperty method)

if statement

if(condition) {
statement(s);
}
Evaluates a condition to determine the next action in a SWF file. If the condition is
Flash runs 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
branching logic in your scripts.
The curly braces (
) used to enclose the block of statements to be executed by the
{}
statement are not necessary if only one statement will execute.
Availability: ActionScript 1.0; Flash Player 4
Parameters
condition:Boolean
Example
In the following example, the condition inside the parentheses evaluates the variable
see if it has the literal value
runs.
if(name == "Erica"){
play();
}
get
statement along with the
if
- An expression that evaluates to
. If it does, the
"Erica"
method to return the value of the property.
and
else
else if
or
true
false
function inside the curly braces
play()
,
true
). If the condition is
{}
statements to create
if
.
name
Statements
to
215

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF