Performing Complex Conditional Testing : if « Statement « Flash / Flex / ActionScript






Performing Complex Conditional Testing

 

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

        // Use the logical AND (&&), OR (||), and NOT (!) operators to create compound conditional statements.
        
        var current:Date = new Date(  );
        
        if (current.getDate(  ) == 17 && current.getMonth(  ) == 3) {
          trace ("Happy Birthday, Bruce!");
        }

    }
  }
}

        








Related examples in the same category

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