MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 219

Actionscript language reference
Table of Contents

Advertisement

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 one of its subclasses.
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, and then to the
catch
block always executes, regardless of whether an error was thrown. If code within the
doesn't throw an error (that is, if the
block is still executed. The
finally
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
ActionScript Core Language Elements
throw
code block throws an error (using the
try
try
finally
catch
blocks but only one
catch
. The variable in a
x
catch
statement, typically an instance of the Error class
identifier. The
error
throw
code block, if one exists. The
finally
block completes normally), then the code in the
block executes even if the
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
CHAPTER 5
clause catches only
catch
statement), control passes to
finally
try
block exits using a
try
try
blocks as many levels
try
e
try
block that handles the
try
try..catch..finally
block
block can
or
block.
block to a
219

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents