Search Tutorials
The Logical OR is a source of much confusion for newbies who mix it up with AND but upon closer inspection it is, in fact, quite the opposite. Let's first consider this plain english example - If it is raining OR if it is snowing then the picnic will not go ahead. Let's look at each possibility, the picnic will not go ahead if, one, it is raining, two, if it is snowing and three, if it is raining AND snowing. The only way the picnic can go ahead is if it is not raining AND not snowing. Now lets look at another example of the OR operator but this time using actionscript. On (Release) If ((title eq "webmaster") or (username eq "flashkit")) Set Variable: "greeting" = "Hi Mark" Else Set Variable: "greeting" = "You are not Mark Fennell" End If End On Let's deconstruct this actionscript. Whereas the AND operator only had one scenario that would evaluate to TRUE, the OR operator has three out of the four possibilities. One, if the value of the variable "title" equates to "webmaster. Two, if the variable "username" equates to "flashkit" and three, if "title equates to "webmaster" AND "username" equates to "flashkit". The only time this operator will evaluate to FALSE is when both variables don't equate to "webmaster" AND "flashkit" respectively, in which case the person would not be Mark Fennell, webmaster of flashkit.com. Confused? Checkout this table it should help explain the logic:
Now lets look at the NOT operator.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|