Use break statements to exit the switch statement after executing the actions under the matching case. : Break : Statement Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Statement » Break »

 

Use break statements to exit the switch statement after executing the actions under the matching case.


 
    

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
 
        var animalName:String = "dove";
        
        switch (animalName) {
          case "turtle":
            trace("Yay! 'Turtle' .");
            break;
          case "dove":
            trace("Sorry, .");
            break;
          default:
            trace("Sorry, try again.");
        }

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Statement
» Break