var dropSpeed = 3750;
var spawnSpeed = 2000;
var i = 0;
function makeSymbol(sym)
{
setInterval(function(){
if(dropSpeed > 1500){dropSpeed = dropSpeed - 350;}if(spawnSpeed > 50){spawnSpeed = spawnSpeed - 231;}
var aSymbol = sym.createChildSymbol("aSymbol" ,"stage");
i = i + 1;
symbols[i] = aSymbol.getSymbolElement();
symbols[i].animate({top: "950px"},dropSpeed); //uses the changed dropspeed
},spawnSpeed); //does not use the change spawnSpeed but keeps using the 2000
}
spawnSpeed不會改變,但dropSpeed會改變。我怎麼能讓spawnspeed改變?我希望這不是一個愚蠢的問題,但我在這裏呆了很久。你們是我唯一的希望。 :)設置可變間隔速度
,如果你把這個外面的setTimeout()和前 把它如果(spawnSpeed> 50){spawnSpeed = spawnSpeed - 231;} – vodich 2014-12-07 13:35:10
剛纔看到您使用的setInterval();無視以前的評論 – vodich 2014-12-07 13:40:47