EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Page 738

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
738 Chapter 12: ActionScript Dictionary
Within the RecordSet classs sortRows() method, one of these previously defined error objects
are thrown depending on the type of exception that occurred. The following code snippet shows
how this code might look.
// Within RecordSet.as class file...
function sortRows() {
...
if(recordSetErrorCondition) {
throw new RecordSetException();
}
if(malFormedRecordCondition) {
throw new MalformedRecord();
}
...
}
Finally, in another AS file or FLA script, the following code invokes the sortRows() method on
an instance of the RecordSet class. It defines
catch blocks for each type of error that is thrown by
sortRows().
try {
myRecordSet.sortRows();
} catch (e:RecordSetException) {
trace("Caught a recordset exception");
} catch (e:MalformedRecord) {
trace("Caught a malformed record exception");
}
See also
Error class, throw, class, extends

Table of Contents

Related product manuals