• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Using Advanced Conditionals

You should be somewhat familiar with using conditionals at this point. You used a simple if statement in Seminar 9 to evaluate how much of the movie was loaded for a preloader. This seminar introduces the else and else if expressions. As you become more comfortable in your development with ActionScript, you’ll find conditionals extremely helpful, and they will quickly become very common in your ActionScript code.

Working with the if Statement

To understand the logic behind a conditional, you can look at life itself. In our daily lives, almost any question can be answered with yes or no, true or false, greater than or less than. ActionScript can mimic life in determining the answers to many questions. For example, in Flash, a submitted password is either valid or invalid, a numeric value is likely to be either too large or too small, and an event is either too soon or too late. Using if statements, you can tell Flash to behave in certain ways depending on the answers to these questions at any given time.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint