Using return in finally : Finally : Statement Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Statement » Finally »

 

Using return in finally


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
         changeFlow (  );
    }
    public function changeFlow (  ):void {
      try {
        throw new Error("Test error.");
      catch (e:Error) {
        trace("Caught: " + e.message);
      finally {
        trace("Finally executed.");
        return;
      }
      trace("Last line of method.");  // Not executed.
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Statement
» Finally