topical media & game development

talk show tell print

actionscript-book-CustomErrors-com-example-programmingas3-errors-Validator.ax

actionscript-book-CustomErrors-com-example-programmingas3-errors-Validator.ax [swf] flex


  package 
  {
          public class @ax-actionscript-book-CustomErrors-com-example-programmingas3-errors-Validator
          {
  
                  public static function validateEmployeeXML(employee:XML):void 
                  {
                          // checks for the integrity of items in the XML
                          if (employee.costCenter.length() < 1) {
                                  throw new actionscript_book_CustomErrors_com_example_programmingas3_errors_FatalError(9000);
                          }
                          
                          if (employee.costCenter.length() > 1) {
                                  throw new actionscript_book_CustomErrors_com_example_programmingas3_errors_WarningError(9001);
                          }
                          
                          if (employee.ssn.length() != 1) {
                                  throw new actionscript_book_CustomErrors_com_example_programmingas3_errors_FatalError(9002);
                          }
                  }
          }
  }


(C) Æliens 27/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.