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

Chapter 9. Controlling Information Flow > Combining Conditions with Logical Ope...

Combining Conditions with Logical Operators

You can create compound conditions with the logical operators && (AND), || (OR), and ! (NOT). The operators combine two or more conditions in one if statement to test for more-complicated scenarios. You could test whether the up-arrow key and the right-arrow key are pressed together to make a movie clip move diagonally, for example. Or you could test whether a draggable movie clip is dropped on one valid target or another. You could use the NOT operator to test whether a variable contains a valid email address whose domain is not restricted.

The following task uses the same file that you created to move a movie clip from the keyboard. You will combine conditions to have Flash test for combination key presses to move the movie clip diagonally.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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