MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 149

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

Using try..catch and try..catch..finally statements
Using
try..catch..finally
The
try..catch..finally
occur and respond to that error. If any code within the
the
statement), control passes to the
throw
the
code block, if one exists. The optional
finally
of whether an error was thrown.
If code within the
try
normally), the code in the
The finally block executes even if the try block exits using a return statement
You write
try..catch
// try-catch
try {
// statements
} catch (myError) {
// statements
}
// try-catch-finally
try {
// statements
} catch (myError) {
// statements
} finally {
// statements
}
Any time your code throws an error, you can write custom handlers to handle the error
gracefully and take appropriate actions. You might need to try loading external data from a
web service or text file or to display an error message to the end user. You can even use the
block to try to connect to a web service that alerts an administrator that a particular
catch
error occurred, so he or she can make sure the application works properly.
blocks lets you add error handling to your Flash applications.
keywords let you enclose a block of code where an error can
catch
block doesn't throw an error (that is, the
block still executes.
finally
and
try..catch..finally
code block throws an error (using
try
block, if one exists. Then control passes to
block always executes, regardless
finally
block completes
try
statements using the following format:
About statements
149

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents