User Guide

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