Im doing an actionscripting book, and I’m learning how to use functions. But anyways, in this script i created a function that when you click the power button the TV will turn on and off. On the first frame of the actions layer within the function, there is an if then statement that confuses me. It says:
tvPower = false;
function togglePower(){
if(tvPower) {
newChannel = 0;
tvPower = false;
…
my question is, Arent you supposed to name a condition in the parenthesis, for example
if(x>5){
Do something;
}
I dont understand how tvPower is a condition.