var myarry = new Array("+", "-", "*", "/");
var h;
function mycolor() {
a.background = b.background=c.background=true;
a.backgroundColor = b.backgroundColor=c.backgroundColor=0x00FFFF;
a.border = b.border=c.border=d.border=true;
a.borderColor = b.borderColor=c.borderColor=d.borderColor=0xff00ff;
}
b1_btn.onRelease = function() {
e = myarry[random(4)];
m = a.text=random(1000);
n = b.text=random(1000);
mycolor();
};
function da() {
switch (e) {
case ("+") :
h = Number(m)+Number(n);
break;
case ("-") :
h = Number(m)-Number(n);
break;
case ("*") :
h = Number(m)*Number(n);
break;
case ("/") :
h = Math.round((Number(m)/Number(n))*100)/100;
break;
}
}
b2_btn.onRelease = function() {
d.background = true;
d.backgroundColor = 0xff00ff;
da();
if (c.text == h) {
d.text = "恭喜,你答对了";
} else {
d.text = "好遗憾,加油呀";
}
};
b3_btn.onRelease = function() {
a.background = b.background=c.background=d.background=false;
a.text = "";
b.text = "";
c.text = "";
d.text = "";
e = "";
};
b4_btn.onRelease = function() {
da();
c.text = h;
};
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}