About conditions

You use conditions to determine whether something is true or exists, and then you can optionally repeat an action (using loops), or execute actions that you specify, such as functions or expressions, based on whether the condition is true or not. For example, you can determine whether a certain variable is defined or has a certain value and execute a block of code based on the result. Also, you could change the graphics within your Flash document based on what time the user's system clock is set to or on the weather in the user's current location.

To perform an action depending on whether a condition exists, or to repeat an action (create loop statements), you can use if, else, else if, for, while, do while, for..in, or switch statements.

For more information on conditions that you can use, and how to write them, see the following topics: