Combined Code
frame 1 {
function AddDigit(digit) {
if (clear) {
clear = false;
decimal = false;
display = '0';
}
if (display == '0' and digit != '.') {
display = digit;
} else {
display += digit;
}
}
function DoOperator(newOper) {
if (operator == '+') {
display = Number(operand1) + Number(display);
}
if (operator == '-') {
display = operand1 - display;
}
if (operator == '*') {
display = operand1 * display;
}
if (operator == '/') {
display = operand1 / display;
}
operator = '=';
clear = true;
decimal = false;
if (newOper != null) {
operator = newOper;
operand1 = display;
}
}
memory = 0;
sp = '0';
display = '0';
stop();
}
button 8 {
on (release) {
getURL('http://www.funcalculator.com', '_blank');
}
}
button 16 {
on (release) {
AddDigit('1');
}
}
button 20 {
on (release) {
AddDigit('2');
}
}
button 24 {
on (release) {
AddDigit('3');
}
}
button 28 {
on (release) {
AddDigit('4');
}
}