If is one of the common syntax for Flash, its format is as follows
if (Coditon) statement1 (Else Statement2)
Where Coditon can be any expression, not even a real Boolean value, because JavaScript automatically converts it to a Boolean value.
If the conditional execution result is true, Statement1 is executed, and if the condition is false, the result Statment2 is executed (if Statement2 exists, else is not required)
Each conditional statement can be a single line of code, or it can be a block of code. Here's a simple example.
var inumber = number (Prompt ("Please enter a digit between 5 and 100"); if (IsNaN (inumber)) document.write ("You make sure you enter the number. "); Else if (Inumber > | | inumber < 5 ) document.write ("The value you entered is not in range"); Else document.write ("The value you entered is" + inumber);
JavaScript Basic Series (v) Conditional statements (conditional statements)