Frame 1
fscommand ("fullscreen", "false");
fscommand ("showmenu", "false");
calctext = "0";
decimal = eval("False");
lastkey = "empty";
Frame 5
stop();
Symbol 7 Button
on (press) {
newdig = "3.14159";
call("/actions:digitcall");
}
Symbol 15 Button
on (press) {
if ((lastkey eq "operator") or (lastkey eq "equals")) {
calctext = "0.";
decimal = eval("True");
}
if (Number(decimal) == Number(eval("False"))) {
calctext = calctext add ".";
decimal = eval("True");
}
lastkey = "digit";
}
Symbol 17 Button
on (press) {
newdig = "0";
call("/actions:digitcall");
}
Symbol 19 Button
on (press) {
newdig = "1";
call("/actions:digitcall");
}
Symbol 21 Button
on (press) {
newdig = "4";
call("/actions:digitcall");
}
Symbol 23 Button
on (press) {
newdig = "7";
call("/actions:digitcall");
}
Symbol 25 Button
on (press) {
newdig = "2";
call("/actions:digitcall");
}
Symbol 27 Button
on (press) {
newdig = "5";
call("/actions:digitcall");
}
Symbol 29 Button
on (press) {
newdig = "8";
call("/actions:digitcall");
}
Symbol 31 Button
on (press) {
newdig = "3";
call("/actions:digitcall");
}
Symbol 33 Button
on (press) {
newdig = "6";
call("/actions:digitcall");
}
Symbol 35 Button
on (press) {
newdig = "9";
call("/actions:digitcall");
}
Symbol 37 Button
on (release) {
newop = "/";
call("/actions:opcall");
}
Symbol 40 Button
on (release) {
newop = "*";
call("/actions:opcall");
}
Symbol 42 Button
on (release) {
newop = "-";
call("/actions:opcall");
}
Symbol 44 Button
on (release) {
newop = "+";
call("/actions:opcall");
}
Symbol 46 Button
on (release) {
if (Number(calctext) < 0) {
calctext = "Error. Press C.";
} else {
i = 0;
n = 1;
while (Number(i) < 500) {
n = n - (((n * n) - calctext) / (2 * n));
i = Number(i) + 1;
}
calctext = n;
lastkey = "equals";
}
}
Symbol 48 Button
on (release) {
call("/actions:calculate");
lastkey = "equals";
operator = "empty";
}
Symbol 50 Button
on (release) {
calctext = "0";
x1 = "0";
lastkey = "clear";
operator = "empty";
decimal = eval("False");
}
Symbol 53 Button
on (release) {
stopAllSounds();
}
Symbol 54 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 5
if (((/:calctext eq "0") or (/:lastkey eq "equals")) or (/:lastkey eq "operator")) {
Set("/:calctext", /:newdig);
} else {
Set("/:calctext", /:calctext add /:newdig);
}
Set("/:lastkey", "digit");
Symbol 54 MovieClip Frame 10
if (/:lastkey eq "operator") {
Set("/:operator", /:newop);
} else if (((/:lastkey eq "digit") or (/:lastkey eq "equals")) or (/:lastkey eq "clear")) {
call("calculate");
Set("/:operator", /:newop);
}
Set("/:lastkey", "operator");
Symbol 54 MovieClip Frame 15
if (/:operator eq "+") {
z1 = Number(/:x1) + Number(/:calctext);
Set("/:calctext", z1);
Set("/:x1", z1);
} else if (/:operator eq "-") {
z1 = /:x1 - /:calctext;
Set("/:calctext", z1);
Set("/:x1", z1);
} else if (/:operator eq "*") {
z1 = /:x1 * /:calctext;
Set("/:calctext", z1);
Set("/:x1", z1);
} else if (/:operator eq "/") {
z1 = /:x1;
Set("/:calctext", z1);
Set("/:x1", z1);
} else if (/:operator eq "exp") {
if ((Number(/:calctext) != Number(int(/:calctext))) or (Number(/:calctext) < 1)) {
Set("/:calctext", "Error. Press C.");
} else {
it = 1;
base = /:x1;
z1 = base;
maxit = /:calctext;
while (Number(it) < Number(maxit)) {
z1 = z1 * base;
it = Number(it) + 1;
}
Set("/:calctext", z1);
Set("/:x1", z1);
}
} else {
Set("/:x1", /:calctext);
}