13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Handling errors<br />

Class name Description Notes<br />

TypeError The TypeError exception is thrown wh<strong>en</strong> the actual<br />

type of an operand is differ<strong>en</strong>t from the expected<br />

type.<br />

URIError The URIError exception is thrown wh<strong>en</strong> one of the<br />

global URI handling functions is used in a way that is<br />

incompatible with its definition.<br />

VerifyError A VerifyError exception is thrown wh<strong>en</strong> a malformed<br />

or corrupted SWF file is <strong>en</strong>countered.<br />

flash.error package Error classes<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

The flash.error package contains Error classes that are considered part of the Flash runtime API. In contrast to the<br />

Error classes described, the flash.error package communicates errors ev<strong>en</strong>ts that are specific to Flash runtimes (such<br />

as Flash Player and Adobe AIR).<br />

Last updated 6/6/2012<br />

A TypeError can be thrown under the following circumstances:<br />

An actual parameter of a function or method could not be<br />

coerced to the formal parameter type.<br />

A value is assigned to a variable and cannot be coerced to the<br />

variable’s type.<br />

The right side of the is or instanceof operator is not a<br />

valid type.<br />

The super keyword is used illegally.<br />

A property lookup results in more than one binding, and is<br />

therefore ambiguous.<br />

A method is called on an incompatible object. For example, a<br />

TypeError exception is thrown if a method in the RegExp class<br />

is “grafted” onto a g<strong>en</strong>eric object and th<strong>en</strong> called.<br />

A URIError can be thrown under the following circumstances:<br />

An invalid URI is specified for a Flash Player API function that<br />

expects a valid URI, such as Socket.connect().<br />

Wh<strong>en</strong> a SWF file loads another SWF file, the par<strong>en</strong>t SWF file can<br />

catch a VerifyError g<strong>en</strong>erated by the loaded SWF file.<br />

68

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!