Performing Actions Conditionally : if « Statement « Flash / Flex / ActionScript






Performing Actions Conditionally

 

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

        var animalName:String = "turtle";
        
        if (animalName == "turtle") {
          trace("Yay! 'Turtle' is the correct answer.");
        }

    }
  }
}

        








Related examples in the same category

1.If Statements
2.If Statement with boolean constant
3.An if statement with no else
4.If statement with else
5.Chaining if statements
6.Performing Complex Conditional Testing