I am using Flash 8 and just learning ActionScript 2.0.
I have a basic call to a function that I am not sure why it is not working.
3 Questions:
1.) Am I passing the value into the function correctly.
2.) Can I pass a value into a function and not use it.
3.) How come in the code that works, I don't have to call the function by togglePower(), Instead I call it without the ()?
Here is my code:
NOT WORKING
I know the value passed in has nothing to do with the function.
This code below does work.
WORKING
I have a basic call to a function that I am not sure why it is not working.
3 Questions:
1.) Am I passing the value into the function correctly.
2.) Can I pass a value into a function and not use it.
3.) How come in the code that works, I don't have to call the function by togglePower(), Instead I call it without the ()?
Here is my code:
NOT WORKING
Code:
function togglePower(myVar:Number):Void {
remote_mc.light_mc.play();
}
remote_mc.power_btn.onRelease = togglePower(55);
This code below does work.
WORKING
Code:
function togglePower():Void {
remote_mc.light_mc.play();
}
remote_mc.power_btn.onRelease = togglePower;