【文件属性】:
文件名称:flash打字游戏
文件大小:875KB
文件格式:FLA
更新时间:2016-12-25 06:16:56
flash游戏
一个用flash as 编辑的打字游戏
stop();
this.createTextField("sr_txt",31,350,350,30,20);
sr_txt.type = "input";
sr_txt.border = true;
sr_txt.borderColor = 0xff0000;
sr_txt.text = "开始";
var i = 0;
function cwb(wbl)
{
if (i < 10)
{
_root.createTextField("wb_txt" + i,i,200,20,40,40);
wb = eval("wb_txt" + i);
var zmwz = random(wbl.length);
wb.text = wbl.charAt(zmwz);
wb._x = 150 + random(370);
wb.setTextFormat(wbformat);
zs++;
}
else
{
i = 0;
}
i++;
}
onEnterFrame = function ()
{
for (k = 0; k < 10; k++)
{
wb = eval("wb_txt" + k);
wb._y += 2;
}
};
var szm;
sr_txt.onSetFocus = function()
{
var jsid = setTimeout(js, 60000);
if (lg == 1)
{
szm = setInterval(cwb, sd, zm);
}
else
{
szm = setInterval(cwb, sd, zw);
}
sr_txt.text = "";
};
function js()
{
clearInterval(szm);
mzl_txt.text = int(df / zs * 100) + "%";
}
sr_txt.onChanged = function()
{
for (j = 0; j < 10; j++)
{
cxdwb = eval("wb_txt" + j);
if (cxdwb.text == sr_txt.text)
{
attachMovie("bz","bz_mc",20);
bz_mc._x = cxdwb._x;
bz_mc._y = cxdwb._y + 10;
dx = cxdwb._x - dp_mc._x;
dy = cxdwb._y - dp_mc._y;
dp_mc._rotation = Math.atan2(dy, dx) * 180 / Math.PI + 90;
cxdwb.removeTextField();
df++;
df_txt.text = df;
}
}
sr_txt.text = "";
};
cw_btn.onRelease = function()
{
if (lg == 1)
{
szm = setInterval(cwb, sd, zm);
}
else
{
szm = setInterval(cwb, sd, zw);
}
setTimeout(js,60000);
sr_txt.text = "";
df = 0;
zs = 0;
mzl_txt.text = "";
trace(mzl_txt.text);
};
sz_btn.onRelease = function()
{
gotoAndStop(3);
};