flash AS2.0代码连线题的问题 10
正确答案是但是选择正确了还是弹出错误的对话框左边的命名是:t1,t2,t3,t4,t5右边的命名是:btn1,btn2,btn3,btn4,btn5代码是这样的stop(...
正确答案是
但是选择正确了 还是弹出错误的对话框
左边的命名是:t1,t2,t3,t4,t5
右边的命名是:btn1,btn2,btn3,btn4,btn5
代码是这样的
stop();
var stat_arr:Array = [false, false, false, false, false];
var a = 0;
var b = 0;
var c = 0;
var d = 0;
var e = 0;
var id = 0;
btn_kk._visible = false;
dang._visible = false;
tj_btn._visible = false;
btn1.onRelease = function()
{
with (t2)
{
a = 1;
gotoAndStop(1);
}
if (id == 1)
{
stat_arr[0] = true;
check_zt();
}
with (t3)
{
//b = 0;
gotoAndStop(1);
}
with (t4)
{
//c = 0;
gotoAndStop(1);
}
with (t5)
{
//d = 0;
gotoAndStop(1);
}
with (t1)
{
//d = 0;
gotoAndStop(1);
}
};
btn2.onRelease = function()
{
with (t3)
{
b = 1;
gotoAndStop(1);
}
if (id == 2)
{
stat_arr[1] = true;
check_zt();
}
with (t2)
{
//b = 0;
gotoAndStop(1);
}
with (t4)
{
//c = 0;
gotoAndStop(1);
}
with (t5)
{
//d = 0;
gotoAndStop(1);
}
with (t1)
{
//d = 0;
gotoAndStop(1);
}
};
btn3.onRelease = function()
{
with (t4)
{
c = 1;
gotoAndStop(1);
}
if (id == 3)
{
stat_arr[2] = true;
check_zt();
}
with (t3)
{
//b = 0;
gotoAndStop(1);
}
with (t2)
{
//c = 0;
gotoAndStop(1);
}
with (t5)
{
//d = 0;
gotoAndStop(1);
}
with (t1)
{
//d = 0;
gotoAndStop(1);
}
};
btn4.onRelease = function()
{
with (t5)
{
d = 1;
gotoAndStop(1);
}
if (id == 4)
{
stat_arr[3] = true;
check_zt();
}
with (t3)
{
//b = 0;
gotoAndStop(1);
}
with (t4)
{
//c = 0;
gotoAndStop(1);
}
with (t2)
{
//d = 0;
gotoAndStop(1);
}
with (t1)
{
//d = 0;
gotoAndStop(1);
}
};
btn5.onRelease = function()
{
with (t1)
{
e = 1;
gotoAndStop(1);
}
if (id == 5)
{
stat_arr[4] = true;
check_zt();
}
with (t3)
{
//b = 0;
gotoAndStop(1);
}
with (t4)
{
//c = 0;
gotoAndStop(1);
}
with (t5)
{
//d = 0;
gotoAndStop(1);
}
with (t2)
{
//d = 0;
gotoAndStop(1);
}
};
function check_zt()
{
var try_num:Number = 0;
if (a == 1 && b == 1 && c == 1 && d == 1 && e == 1)
{
btn_kk._visible = true;
btn_ok._visible = false
}
for (var i = 0; i < stat_arr.length; i++)
{
trace(stat_arr[i]);
trace(stat_arr.length);
if (stat_arr[i])
{
try_num++;
}
}
trace(try_num);
if (try_num == stat_arr.length)
{
//this.gotoAndPlay(4207);
dang._visible = true;
}
} 展开
但是选择正确了 还是弹出错误的对话框
左边的命名是:t1,t2,t3,t4,t5
右边的命名是:btn1,btn2,btn3,btn4,btn5
代码是这样的
stop();
var stat_arr:Array = [false, false, false, false, false];
var a = 0;
var b = 0;
var c = 0;
var d = 0;
var e = 0;
var id = 0;
btn_kk._visible = false;
dang._visible = false;
tj_btn._visible = false;
btn1.onRelease = function()
{
with (t2)
{
a = 1;
gotoAndStop(1);
}
if (id == 1)
{
stat_arr[0] = true;
check_zt();
}
with (t3)
{
//b = 0;
gotoAndStop(1);
}
with (t4)
{
//c = 0;
gotoAndStop(1);
}
with (t5)
{
//d = 0;
gotoAndStop(1);
}
with (t1)
{
//d = 0;
gotoAndStop(1);
}
};
btn2.onRelease = function()
{
with (t3)
{
b = 1;
gotoAndStop(1);
}
if (id == 2)
{
stat_arr[1] = true;
check_zt();
}
with (t2)
{
//b = 0;
gotoAndStop(1);
}
with (t4)
{
//c = 0;
gotoAndStop(1);
}
with (t5)
{
//d = 0;
gotoAndStop(1);
}
with (t1)
{
//d = 0;
gotoAndStop(1);
}
};
btn3.onRelease = function()
{
with (t4)
{
c = 1;
gotoAndStop(1);
}
if (id == 3)
{
stat_arr[2] = true;
check_zt();
}
with (t3)
{
//b = 0;
gotoAndStop(1);
}
with (t2)
{
//c = 0;
gotoAndStop(1);
}
with (t5)
{
//d = 0;
gotoAndStop(1);
}
with (t1)
{
//d = 0;
gotoAndStop(1);
}
};
btn4.onRelease = function()
{
with (t5)
{
d = 1;
gotoAndStop(1);
}
if (id == 4)
{
stat_arr[3] = true;
check_zt();
}
with (t3)
{
//b = 0;
gotoAndStop(1);
}
with (t4)
{
//c = 0;
gotoAndStop(1);
}
with (t2)
{
//d = 0;
gotoAndStop(1);
}
with (t1)
{
//d = 0;
gotoAndStop(1);
}
};
btn5.onRelease = function()
{
with (t1)
{
e = 1;
gotoAndStop(1);
}
if (id == 5)
{
stat_arr[4] = true;
check_zt();
}
with (t3)
{
//b = 0;
gotoAndStop(1);
}
with (t4)
{
//c = 0;
gotoAndStop(1);
}
with (t5)
{
//d = 0;
gotoAndStop(1);
}
with (t2)
{
//d = 0;
gotoAndStop(1);
}
};
function check_zt()
{
var try_num:Number = 0;
if (a == 1 && b == 1 && c == 1 && d == 1 && e == 1)
{
btn_kk._visible = true;
btn_ok._visible = false
}
for (var i = 0; i < stat_arr.length; i++)
{
trace(stat_arr[i]);
trace(stat_arr.length);
if (stat_arr[i])
{
try_num++;
}
}
trace(try_num);
if (try_num == stat_arr.length)
{
//this.gotoAndPlay(4207);
dang._visible = true;
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询