Chapter 11. Making Decisions in Code

Write an If Statement

In 1979, an extremely popular series of books targeted at young adults hit the shelves. The first such book, written by Edward Packard, was called The Cave of Time, and it introduced a novel new concept in which, at the end of each page, readers had to choose between two alternatives. Based on their choice, they jumped to a different page of the book, so no two readings of the book were the same. Eventually, there would be well over 100 of these Choose Your Own Adventure titles published.

ActionScript, like other programming languages, provides the ability to have the script make decisions based on what is currently happening in the movie, much like readers of those books could choose their ...

Get ActionScript®: Your visual blueprint™ for creating interactive projects in Flash® CS4 Professional 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.