The ActionScript Statements
Now that you know how a typical statement is formed, skim Table 6.1 to acquaint yourself with some of the things that ActionScript statements do.
Table 6-1. The ActionScript Statements
|
Statement |
Syntax |
Use |
|---|---|---|
|
break |
break; |
Cancels a loop |
|
call |
call (
|
Executes the script on a remote frame |
|
continue |
continue; |
Restarts the current loop |
|
do-while |
do {
|
A variation of a while loop |
|
empty statement |
; |
Holds a place where a statement is expected, and used with evaluate in novice mode |
|
for |
for ( |
Executes some code repetitively (a for loop) |
|
for-in |
for ( |
Enumerates the properties of an object |
|
function |
function |
Declares a function |
|
if-else if-else |
if ( |
Executes some code based on a condition or a series of conditions |
|
ifFrameLoaded |
ifFrameLoaded ( |
Executes some code if a certain frame has loaded; deprecated in Flash 5 |
|
return |
return;
return
|
Exits a function or returns a value from a function |
|
set |
set ( |
Assigns a value to a dynamically named variable |
|
var |
var |
Declares and optionally initializes a variable |
|
while |
while ( |
Executes some code repetitively (a while loop) |
|
with |
with ( |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access