0 Replies Latest reply on Mar 2, 2007 7:30 AM by 187_2007

    Error handling

    187_2007
      Here is what I have:

      public function validateAdSize(validateThis:String):void{

      try{
      var AdsizeLength:int = validateThis.length;
      var locOf_x:int = validateThis.indexOf("x");

      var strADSIZE_LENGTH:String = validateThis.slice(0,locOf_x);
      var strADSIZE_WIDTH:String = validateThis.slice(locOf_x + 1, AdsizeLength);
      var ADSIZE_WIDTH:int = parseInt(strADSIZE_WIDTH);
      var ADSIZE_LENGTH:int = parseInt(strADSIZE_LENGTH);
      if (ADSIZE_WIDTH == 0 || ADSIZE_LENGTH == 0) {
      Alert.show("Adsize is incorrect");
      }
      }catch (err:Error)
      {
      trace("<Error> " + err.message);
      }


      }



      Looking for a better way to do Error Handling. Any suggestions?