Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In this chapter, we'll explore ActionScript's system for generating and responding to runtime errors—or exceptions. In ActionScript, errors can be generated both by the Flash runtime and by the program that is executing. Errors generated by the Flash runtime are known as built-in errors; errors generated by a program are known as custom errors. In a program, we can respond to, or handle, any error (whether built-in or custom) using the try/catch/finally statement; we can generate an error via the throw statement.
To learn how to generate and respond to errors in a program, we'll revisit our virtual zoo program.