12. Conditionals

Until now, all the examples you have been working with run in a straight line. You aren’t changing courses during the execution of the code based on varying conditions. Often, you will want to do specific actions if certain conditions are met, and if they aren’t met, you want to do other actions instead. This type of action is called Boolean logic.

In this chapter, you’ll learn more about the Boolean variable type and see how you can use it to determine if certain conditions are true or false based on equality operators. You can then apply these operators to blocks of code that will execute differently based on the results of these evaluations.

Boolean Variables and Equality

Boolean variables can contain only two values: true ...

Get Fundamentals of ActionScript 3.0: Develop and Design 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.