This is probably simple, but are there any conflicts with these scripts I’ve made for calculator buttons (The buttons will be named ‘1’ ‘2’ ‘3’ ‘Plus’ ‘Minus’ ‘Equals’ etc.)
Frame 1
currentNumb = 0 //Number being added, subtracted, etc from
secondNumb = 0 //Modifying number
totalNumb = 0 //Number displayed on calculator
arithFunction = 0 //Says which arithmitic operation to use (0= None, 1=Add, 2=Subtract, 3=Multiply, 4=Divide)
Frame 2
stop();
_root.Number == totalNumb //Tells the Dynamic text ‘Number’ to display the nuber)
Button X (X = 1, 2, 3…)
on(press) {if (currentNumb == 0){ //Tells whether to add number to currentNumb or secondNumb
currentNumb = X
totalNumb = X
} else {
secondNumb = X
totalNumb = X
}
}
Aritmitic Button (Add, Subtract, etc.) Y = What button you pressed
on(press){
arithFunction = Y
}
Equals button (A = + or - or * or / depending on the arithFunction variable
on(press){
if (arithFunction = Y){
totalNumb = currentNumb secondNumb
}