这个作业是聪明和爱好讨论到半夜的成果,
var r = h=s="";
var shang = "爱好聪明为你加油!";
function sun(r, h) {
return (2*Math.PI*r*r+2*Math.PI*r*h);
}
function myColor() {
_root.ss.background = true;
_root.ss.backgroundColor = 0x00FFFF;
_root.ss.border = true;
_root.ss.borderColor = 0xFF0000;
}
js.onRelease = function() {
if (r == "" || h == "" || isNaN(r) || isNaN(h) || r<=0 || h<0) {
s = "请输入正确的数据";
myColor();
} else if (h == 0) {
s = Math.PI*r*r;
myColor();
_txt.text = shang;
} else {
s = sun(r, h);
myColor();
_txt.text = shang;
}
};
qk.onRelease = function() {
r = "";
h = "";
s = "";
_root.ss.background = false;
_root.ss.borderColor = 0x000000;
_txt.text = "";
};
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}