User Guide

222 Chapter 5: ActionScript Core Language Elements
function randomNum():Number {
return Math.round(Math.random()*10)%3;
}
}
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().
import RecordSet;
var myRecordSet:RecordSet = new RecordSet();
try {
myRecordSet.sortRows();
trace("everything is fine");
} catch (e:RecordSetException) {
trace(e.toString());
} catch (e:MalformedRecord) {
trace(e.toString());
}
See also
Error class, throw, class, extends