Understanding Error Objects : Error : Development Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Development » Error »

 

Understanding Error Objects


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var sUsername:String = "";
        try {
          if(sUsername == "") {
            throw new Error("Missing Username.");
          }
        }
        catch (erObject:Error) {
          trace(erObject.message);  // Displays: Missing Username.
        }

    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Development
» Error