This content has been marked as final. Show 3 replies
I like to think of || as conditional arithmetic and && as conditional multiplication. Its probably not the best analogy but its the way I remember. So it should be the second of your examples.
But what does the compiler think of as the conditions, what if it thought this:
if(menu() == 3 || menu() == (4 && home._visible))
The safest way I've found is to put braces around each one!
More info here:
Thanks for the quick response. So Flash will obey any braces that are used in the conditional statements? It wasn't explicitly stated in the documentation but it seems like thats the case.
yep, and sorry they're more correctly called parentheses.
They're also in the list of operator precedence... near the top.