The finally Block : finally « Statement « Flash / Flex / ActionScript






The finally Block

 
try {
} catch (e:ErrorType1) {
} catch (e:ErrorTypen) {
} finally {
}

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

        try {
          try {
            throw new Error("Test error");
          } catch (e:Error) {
            trace(e.message);  // Displays: Test error
          }
        } catch (e:Error) {
        }

    }
  }
}

        








Related examples in the same category

1.The finally block can be useful for cleaning up. You can use try and finally together:
2.Throws an exception in a finally block.
3.Control-Flow Changes in try/catch/finally
4.Using return in finally