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 ( |
Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.