Statements

Statements are language elements that perform or specify an action. For example, the return statement returns a result as a value of the function in which it executes. The if statement evaluates a condition to determine the next action that should be taken. The switch statement creates a branching structure for ActionScript statements.

Statements summary

Statement

Description

break

Appears within a loop (for , for..in, do..while or while) or within a block of statements associated with a particular case within a switch statement.

case

Defines a condition for the switch statement.

class

Defines a custom class, which lets you instantiate objects that share methods and properties that you define.

continue

Jumps past all remaining statements in the innermost loop and starts the next iteration of the loop as if control had passed through to the end of the loop normally.

default

Defines the default case for a switch statement.

delete

Destroys the object reference specified by the reference parameter, and returns true if the reference is successfully deleted; false otherwise.

do..while

Similar to a while loop, except that the statements are executed once before the initial evaluation of the condition.

dynamic

Specifies that objects based on the specified class can add and access dynamic properties at runtime.

else

Specifies the statements to run if the condition in the if statement returns false.

else if

Evaluates a condition and specifies the statements to run if the condition in the initial if statement returns false.

extends

Defines a class that is a subclass of another class; the latter is the superclass.

for

Evaluates the init (initialize) expression once and then starts a looping sequence.

for..in

Iterates over the properties of an object or elements in an array and executes the statement for each property or element.

function

Comprises a set of statements that you define to perform a certain task.

get

Permits implicit getting of properties associated with objects based on classes you have defined in external class files.

if

Evaluates a condition to determine the next action in a SWF file.

implements

Specifies that a class must define all the methods declared in the interface (or interfaces) being implemented.

import

Lets you access classes without specifying their fully qualified names.

interface

Defines an interface.

intrinsic

Allows compile-time type checking of previously defined classes.

private

Specifies that a variable or function is available only to the class that declares or defines it or to subclasses of that class.

public

Specifies that a variable or function is available to any caller.

return

Specifies the value returned by a function.

set

Permits implicit setting of properties associated with objects based on classes you have defined in external class files.

set variable

Assigns a value to a variable.

static

Specifies that a variable or function is created only once per class rather than being created in every object based on that class.

super

Invokes the superclass' version of a method or constructor.

switch

Creates a branching structure for ActionScript statements.

throw

Generates, or throws , an error that can be handled, or caught , by a catch{} code block.

try..catch..finally

Enclose a block of code in which an error can occur, and then respond to the error.

var

Used to declare local or Timeline variables.

while

Evaluates a condition and if the condition evaluates to true , runs a statement or series of statements before looping back to evaluate the condition again.

with

Lets you specify an object (such as a movie clip) with the object parameter and evaluate expressions and actions inside that object with the statement(s) parameter.


Version 8

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00001859.html