Using error handling and debugging

Your application needs to be robust enough to anticipate certain errors and handle them accordingly.

One of the best ways to perform error handling in ActionScript 2.0 is to use the try-catch-finally blocks that let you throw and catch custom errors. By creating custom error classes, you can reuse code throughout your application without having to rewrite error handling code. For more information on throwing custom errors, see the Error class in ActionScript 2.0 Language Reference. For more information on try-catch-finally blocks, see try..catch..finally in ActionScript 2.0 Language Reference.

In ActionScript 3.0, use the flash.errors class to catch errors.

For more information, see “Handling synchronous errors in an application” in Programming ActionScript 3.0.

  This page on the Web