flash.error package Error classes

The flash.error package contains Error classes that are considered part of the Flash Player API. In contrast to the Error classes just described, the flash.error package communicates errors events that are specific to Flash Player.

Class name

Description

Notes

EOFError

An EOFError exception is thrown when you attempt to read past the end of the available data.

For example, an EOFError is thrown when one of the read methods in the IDataInput interface is called and there is insufficient data to satisfy the read request.

IllegalOperationError

An IllegalOperationError exception is thrown when a method is not implemented or the implementation doesn't cover the current usage.

Examples of illegal operation error exceptions include the following:

  • A base class, such as DisplayObjectContainer, provides more functionality than the Stage can support. For example, if you attempt to get or set a mask on the Stage (using stage.mask), Flash Player will throw an IllegalOperationError with the message "The Stage class does not implement this property or method."
  • A subclass inherits a method it does not require and does not want to support.
  • Certain accessibility methods are called when Flash Player is compiled without accessibility support.
  • Authoring-only features are invoked from a run-time version of Flash Player.
  • You attempt to set the name of an object placed on the timeline.

IOError

An IOError exception is thrown when some type of I/O exception occurs.

You get this error, for example, when a read-write operation is attempted on a socket that is not connected or that has become disconnected.

MemoryError

A MemoryError exception is thrown when a memory allocation request fails.

By default, ActionScript Virtual Machine 2 does not impose a limit on how much memory an ActionScript program may allocate. On a desktop PC, memory allocation failures are infrequent. You see an error thrown when the system is unable to allocate the memory required for an operation. So, on a desktop PC, this exception is rare unless an allocation request is extremely large; for example, a request for 3 billion bytes is impossible because a 32-bit Microsoft® Windows® program can access only 2 GB of address space.

ScriptTimeoutError

A ScriptTimeoutError exception is thrown when a script timeout interval of 15 seconds is reached. By catching a ScriptTimeoutError exception, you can handle the script timeout more gracefully. If there is no exception handler, the uncaught exception handler will display a dialog box with an error message.

To prevent a malicious developer from catching the exception and staying in an infinite loop, only the first ScriptTimeoutError exception thrown in the course of a particular script can be caught. A subsequent ScriptTimeoutError exception cannot be caught by your code and will immediately go to the uncaught exception handler.

StackOverflowError

The StackOverflowError exception is thrown when the stack available to the script has been exhausted.

A StackOverflowError exception might indicate that infinite recursion has occurred.


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00000108.html