By Fumio Nonaka
4 October 2010
4 October 2010
Some prior experience working with ActionScript 3 is recommended. Familiarity with the Flash authoring environment is also helpful.
This article is the last of seven in a series highlighting examples of programming strategies that make it easier than ever before to create rich content in Adobe Flash CS5 Professional. The UncaughtErrorEvents class was recently introduced to handle errors in Adobe Flash Player 10.1.
Normally, errors are detected using one of two common strategies. But the new UncaughtErrorEvents.uncaughtError event (the UncaughtErrorEvent.UNCAUGHT_ERROR constant) can deal with errors which are not caught by the regularly used approaches shown below:
- Using the try..catch statement to detect errors.
- Registering a listener to the error event to detect errors.
The reference of the UncaughtErrorEvents object is obtained from either the Loader.uncaughtErrorEvents or the LoaderInfo.uncaughtErrorEvents properties. You can use the results in order to avoid display of an error dialog box in user's environment or to get more information about an unexpected error.
To learn more about error handling, see Types of errors in the Adobe Flash Platform help documentation.
Where to go from here
As you can see from these examples, there are many new possibilities to explore when developing ActionScript 3 projects in Flash Professional CS5. Hopefully the scripts provided in these examples will serve as the starting point as you begin experimenting with the new events and capabilities for delivering rich content with interactivity.
Be sure to check out my other articles in this series:
- Working with TLF Text to control the appearance of text elements
- Manipulating springs of an IK Bone for animations
- Leveraging code snippets and using enhanced code hinting
- Dynamically drawing a vector instance that contains elements
- Displaying the audio waveform captured from a microphone
- Deploying projects on devices with touch panels
To learn more about developing with ActionScript 3, see the following online resources:
- ActionScript Technology Center
- ActionScript 3.0 Reference for the Adobe Flash Platform
- Adobe ActionScript Cookbook
Also be sure to visit the Flash Developer Center to find more articles and sample files to help you take your Flash projects to the next level.
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License