• 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. For example, you could test whether the up-arrow key and the right-arrow key are pressed together to make a movie clip move diagonally. Or you could test whether a draggable movie clip is dropped on one target or another valid target. You could use the NOT operator to test whether a variable contains a valid e-mail address, but one whose domain is not restricted.

The following task uses the same file that you created previously to move a movie clip from the keyboard. You will combine conditions to have Flash test for combination key strokes 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