AS: Main
Ok, in this tutorial you will be learning about some symbolic operators used in flash. I will cover these symbolic operators: !, >, <, ||, and &&. I will not cover the math symbols becuase they were already done in T-H's maths tutorial. So, I will explain the easy one first, the ! symbol.
-------------
!
Ok, in general, this operator is used to check if something is NOT a ceartain value. I will explain it to you by using this example:
Lets say one day you are at a baseball game and you break a lot of rules. The ump comes up to you and you say what rule did I break? The ump replies which rule didn't you break?
Im sorry if that isnt clear but I hope you get the picture.
-------------
In a code, the ! statement would look like this:
if(!something=something else){
//actions
}
What that does it flash will only do the actions if a variable does not equal a certain value. I hope you know not to use that exact code for anything cos it was a sample. You can easily combine it with your codes to make it work. Now, I will teach you the < and > statements.
-------------
< >
Ok, what this does is flash will check whether a value is greater than something if using the > symbol, or if a value is less than something if using the < symbol. You would want to use this becuase Instead of checking for every value greater than something which would take ages, you could use this one simple command to help you out.
-------------
In a code, it would look like this:
if(variable1>value){
//actions
}
of course you can replace > with <.
-------------
||
Ok, in flash, if you wanna action to run if one thing or another is happeneing, use || (or) statements. The code works by like I said, if one of 2 or whatever events is happening, the actions run.
-------------
In a code, it would look like this:
if(Key.isDown(Key.SPACE)||Key.isDown(Key.U
P)){
//actions
}
-------------
&&
You use this statement if you wanna check if multiple events are happening at the same time. Use it for if you want the user to have to press 2 keys for example, for an action to happen.
-------------
In a code, it would look like this:
if(Key.isDown(Key.SPACE)&&Key.isDown(Key.U
P)){
//actions
}
-------------
Well, thats it! If I missed any symbols, tell me!