Frame 1
function gen() {
firstnumber = Math.floor(numberlimit * Math.random()) + 10;
secondnumber = Math.floor(numberlimit * Math.random()) + 10;
}
function clear() {
draw.gotoAndPlay("clear");
}
function hoff() {
h1.gotoAndStop("off");
h2.gotoAndStop("off");
h3.gotoAndStop("off");
h4.gotoAndStop("off");
}
loadMovie ("header.swf", "headerclip");
ans = new Array();
var numberlimit = 90;
var numberdif = 20;
var type = 1;
subtraction.gotoAndStop("off");
addition.gotoAndStop("on");
gen();
choice = Math.floor(4 * Math.random()) + 1;
ans[choice] = firstnumber + secondnumber;
if (choice == 1) {
ans[2] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
ans[3] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
ans[4] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
} else if (choice == 2) {
ans[1] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
ans[3] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
ans[4] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
} else if (choice == 3) {
ans[1] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
ans[2] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
ans[4] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
} else {
ans[1] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
ans[2] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
ans[3] = ((1 + firstnumber) + secondnumber) + Math.floor(numberdif * Math.random());
}
ans1 = ans[1];
ans2 = ans[2];
ans3 = ans[3];
ans4 = ans[4];
stop();
Symbol 12 MovieClip Frame 1
if (drag) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
Symbol 12 MovieClip Frame 2
gotoAndPlay (1);
Symbol 16 Button
on (rollOut, dragOut, releaseOutside) {
mouse = 0;
Mouse.show();
pencilm.drag = false;
pencilm._x = 148;
pencilm._y = 390;
}
on (press) {
mc.drag = true;
mouse = 1;
x1 = 0;
a1 = 0;
}
on (release) {
mouse = 0;
}
on (rollOver) {
Mouse.hide();
pencilm.drag = true;
}
Symbol 19 MovieClip Frame 1
if (drag) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
Symbol 19 MovieClip Frame 2
gotoAndPlay (1);
Symbol 20 MovieClip Frame 1
var tool = "pencil";
pencilcolor = new Color("pencil");
pencilcolor.setRGB(0);
Symbol 20 MovieClip Frame 2
if (Number(mouse) == 1) {
if (Number(x1) == 0) {
x1 = int(getProperty("mc", _x));
y1 = int(getProperty("mc", _y));
} else {
x0 = int(getProperty("mc", _x));
y0 = int(getProperty("mc", _y));
if ((5 < Number((x0 - x1) * (x0 - x1))) or (5 < Number((y0 - y1) * (y0 - y1)))) {
n1 = Number(n1) + 1;
duplicateMovieClip (tool, tool add n1, n1);
setProperty(tool add n1, _x , x1);
setProperty(tool add n1, _y , y1);
setProperty(tool add n1, _xscale , x0 - x1);
setProperty(tool add n1, _yscale , y0 - y1);
x1 = x0;
y1 = y0;
}
}
}
Symbol 20 MovieClip Frame 3
gotoAndPlay (2);
Symbol 20 MovieClip Frame 4
while (n1 >= 0) {
removeMovieClip(tool add n1);
n1 = n1 - 1;
}
n1 = 0;
gotoAndPlay (2);
Symbol 22 Button
on (rollOver) {
Mouse.show();
}
on (rollOut) {
Mouse.hide();
}
Symbol 26 Button
on (release) {
if (_parent.choice == 1) {
if (this == _level0.h1) {
this.gotoAndStop("yes");
_parent.yesno.gotoAndPlay("yes");
} else {
this.gotoAndStop("no");
_parent.yesno.gotoAndPlay("no");
}
} else if (_parent.choice == 2) {
if (this == _level0.h2) {
this.gotoAndStop("yes");
_parent.yesno.gotoAndPlay("yes");
} else {
this.gotoAndStop("no");
_parent.yesno.gotoAndPlay("no");
}
} else if (_parent.choice == 3) {
if (this == _level0.h3) {
this.gotoAndStop("yes");
_parent.yesno.gotoAndPlay("yes");
} else {
this.gotoAndStop("no");
_parent.yesno.gotoAndPlay("no");
}
} else if (this == _level0.h4) {
this.gotoAndStop("yes");
_parent.yesno.gotoAndPlay("yes");
} else {
this.gotoAndStop("no");
_parent.yesno.gotoAndPlay("no");
}
}
on (rollOver) {
Mouse.show();
}
Symbol 29 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 2
stop();
Symbol 29 MovieClip Frame 3
stop();
Symbol 44 MovieClip Frame 1
stop();
Symbol 44 MovieClip Frame 6
stop();
Symbol 44 MovieClip Frame 12
stop();
Symbol 46 Button
on (release) {
subtraction.gotoAndStop("off");
addition.gotoAndStop("on");
if (type == 1) {
} else {
yesno.gotoAndStop("off");
hoff();
gen();
sign = "+";
type = 1;
choice = Math.floor(4 * Math.random()) + 1;
ans[choice] = firstnumber + secondnumber;
if (choice == 1) {
ans[2] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else if (choice == 2) {
ans[1] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else if (choice == 3) {
ans[1] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[2] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else {
ans[1] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[2] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = ((1 + firstnumber) + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
}
ans1 = ans[1];
ans2 = ans[2];
ans3 = ans[3];
ans4 = ans[4];
clear();
}
}
on (rollOver) {
Mouse.show();
}
on (rollOut) {
Mouse.hide();
}
Symbol 47 Button
on (release) {
subtraction.gotoAndStop("on");
addition.gotoAndStop("off");
if (type == 2) {
} else {
yesno.gotoAndStop("off");
hoff();
gen();
while (firstnumber < secondnumber) {
gen();
}
sign = "-";
type = 2;
choice = Math.floor(4 * Math.random()) + 1;
ans[choice] = firstnumber - secondnumber;
if (choice == 1) {
ans[2] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else if (choice == 2) {
ans[1] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else if (choice == 3) {
ans[1] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[2] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else {
ans[1] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[2] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = ((1 + firstnumber) - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
}
ans1 = ans[1];
ans2 = ans[2];
ans3 = ans[3];
ans4 = ans[4];
clear();
}
}
on (rollOver) {
Mouse.show();
}
on (rollOut) {
Mouse.hide();
}
Symbol 51 Button
on (release) {
yesno.gotoAndStop("off");
hoff();
if (type == 1) {
gen();
sign = "+";
type = 1;
choice = Math.floor(4 * Math.random()) + 1;
ans[choice] = firstnumber + secondnumber;
if (choice == 1) {
ans[2] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else if (choice == 2) {
ans[1] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else if (choice == 3) {
ans[1] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[2] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else {
ans[1] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[2] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = (firstnumber + secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
}
ans1 = ans[1];
ans2 = ans[2];
ans3 = ans[3];
ans4 = ans[4];
clear();
} else if (type == 2) {
gen();
while (firstnumber < secondnumber) {
gen();
}
sign = "-";
type = 2;
choice = Math.floor(4 * Math.random()) + 1;
ans[choice] = firstnumber - secondnumber;
if (choice == 1) {
ans[2] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else if (choice == 2) {
ans[1] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else if (choice == 3) {
ans[1] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[2] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else {
ans[1] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[2] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = (firstnumber - secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
}
ans1 = ans[1];
ans2 = ans[2];
ans3 = ans[3];
ans4 = ans[4];
clear();
} else {
gen();
sign = "x";
type = 3;
choice = Math.floor(4 * Math.random()) + 1;
ans[choice] = firstnumber * secondnumber;
if (choice == 1) {
ans[2] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else if (choice == 2) {
ans[1] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else if (choice == 3) {
ans[1] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[2] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[4] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
} else {
ans[1] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[2] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
ans[3] = (firstnumber * secondnumber) + (Math.floor(numberdif * Math.random()) + 1);
}
ans1 = ans[1];
ans2 = ans[2];
ans3 = ans[3];
ans4 = ans[4];
clear();
}
}
on (rollOver) {
Mouse.show();
}
Symbol 58 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 2
stop();
Symbol 61 MovieClip Frame 1
stop();
Symbol 61 MovieClip Frame 2
stop();