try..catch..finally
Availability
Flash Player 7.
Usage
try {
// ... try block ...
} finally {
// ... finally block ...
}
try {
// ... try block ...
} catch(error[:ErrorType1]) {
// ... catch block ...
} [catch(error[:ErrorTypeN]) {
// ... catch block ...
}] [finally {
// ... finally block ...
}]
Parameters
The expression thrown from a
error
or a subclass thereof.
An optional type specifier for the
ErrorType
errors of the specified type.
Description
Keywords; enclose a block of code in which an error can occur, and then respond to the error. If
any code within the
the
block, if one exists, then to the
catch
always executes, regardless of whether an error was thrown. If code within the
throw an error (that is, if the
block is still executed. The
statement.
return
A
block must be followed by a
try
have multiple
catch
deep as desired.
The
parameter specified in a
error
or
theException
blocks, typed errors let you catch multiple types of errors thrown from a single
catch
If the exception thrown is an object, the type will match if the thrown object is a subclass of the
specified type. If an error of a specific type is thrown, the
corresponding error is executed. If an exception that is not of the specified type is thrown, the
block does not execute and the exception is automatically thrown out of the
catch
handler that matches it.
catch
If an error is thrown within a function, and the function does not include a
the ActionScript interpreter exits that function, as well as any caller functions, until a
is found. During this process,
736
Chapter 12: ActionScript Dictionary
throw
code block throws an error (using the
try
block completes normally), then the code in the
try
block executes even if the
finally
catch
blocks but only one
catch
. The variable in a
x
catch
handlers are called at all levels.
finally
statement, typically an instance of the Error class
identifier. The
error
throw
code block, if one exists. The
finally
try
block, a
block, or both. A single
finally
block. You can nest
finally
handler must be a simple identifier such as
handler can also be typed. When used with multiple
catch
clause only catches
catch
action), control passes to
finally
block doesn't
try
finally
block exits using a
try
blocks as many levels
try
e
try
block that handles the
try
handler, then
catch
catch
block
block can
or
block.
block to a
block
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?