If Statement with boolean constant : if « Statement « Flash / Flex / ActionScript






If Statement with boolean constant

 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var greeting;
        
        if (true) {
          greeting = "Hello";
        } else {
          greeting = "Bonjour";
        }
        
        trace(greeting);

    }
  }
}

        








Related examples in the same category

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