我有这个问题,只有最后一个函数有效,而所有前面的函数都被 flash 忽略了。由于所有的函数都是用同样的方式写的,所以我找不到问题所在。
此代码只是一个用于更改场景类型的按钮,我按下某个键并更改它,但在这种情况下,只有我选择的最后一个键有效。
任何提示?
var gomas:Object = new Object();
var chocolate:Object = new Object();
var tarte:Object = new Object();
var peixe:Object = new Object();
var lama:Object = new Object();
gomas.onKeyDown = function()
{
if (Key.getCode() == "51","54","222","87","73","71","86");
{
loadMovieNum("01 Gomas.swf",0);
}
};
Key.addListener(gomas);
chocolate.onKeyDown = function()
{
if (Key.getCode() == "49","56","69","71","76","67","78");
{
loadMovieNum("02 Chocolate.swf",0);
}
};
Key.addListener(chocolate);
tarte.onKeyDown = function()
{
if (Key.getCode() == "52","48","82","75","66","85");
{
loadMovieNum("03 Tarte.swf",0);
}
};
Key.addListener(tarte);
peixe.onKeyDown = function()
{
if (Key.getCode() == "50","55","84","79","83","72","77");
{
loadMovieNum("04 Peixe.swf",0);
}
};
Key.addListener(peixe);
lama.onKeyDown = function()
{
if (Key.getCode() == "53","57","81","89","80","68","74");
{
loadMovieNum("05 Lama.swf",0);
}
};
Key.addListener(lama);