Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 13. Creating Conditional Statements

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial