I have built a calculator with a running total variable (stotal) this is working great. There are 30 buttons each having its own value each add or subtract from "stotal".
The attached is a much scaled down and simplified version of the calculator. In this sample each button has a value of 200. If the user gets to 1000 or more I want to load an exiernal SWF "succes.swf" that notifies them they have reached 1000.
Here is the AS for one of the buttons. I know I need to wtite this as an "If then Else If" statement in order to get it to work but I am not having much luck;
q1a.onRelease = function(){
if (a1a==true){
a1a=false;
_root.stotal -=200;
}else{
a1a=true;
_root.stotal +=200;
}
}