Chapter 13. Creating Conditional Statements

All of our decisions in life are based on conditional logic. Is the traffic light red or green? Did I leave the iron on? Am I tired or not? These everyday decisions are based on conditions. For some of these questions, the answers are either true or false. To react to a condition, we assess the condition, get a true or false response, and act accordingly. If the condition is true, we react one way; if the answer is false, we react in a different way.

To create “decision forks” in ActionScript, you must implement conditional logic. You set a condition, and if the condition is true, the code will respond; if it is false, the code will move on and check another condition, if one exists.

Many different kinds ...

Get ActionScript 3.0: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.