O'Reilly logo

Essential ActionScript 3.0 by Colin Moock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Statements and Operators

This chapter provides a reference-style overview of ActionScript's statements and operators—many of which we've already seen in this book. Rather than discussing each statement and operator in isolation, this book teaches the use of statements and operators in the context of other programming topics. Accordingly, this chapter lists many crossreferences to discussion and usage examples found elsewhere in this book. For information on operators not covered in this book, see Adobe's ActionScript Language Reference.

Statements

Statements are one kind of directive, or basic program instruction, consisting of a keyword (command name reserved for use by the ActionScript language) and, typically, a supporting expression.

Table 10-1 lists ActionScript's statements, their syntax, and purpose.

Table 10-1. ActionScript statements

Statement

Usage

Description

break

break

Aborts a loop or switch statement. See Chapter 2.

case

case expression:
  substatements

Identifies a statement to be executed conditionally in a switch statement. See Chapter 2.

continue

continue;

Skips the remaining statements in the current loop and begins the next iteration at the top of the loop. See Adobe documentation.

default

default:
  substatements

Identifies the statement(s) to execute in a switch statement when the test expression does not match any case clauses. See Chapter 2.

do-while

do {
  substatements
} while (expression);

A variation of a while loop that ensures at least one iteration ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required