The first thing you asked for was a timelimit. This can be achieved rather easily, like so:
Code:
window.setTimeout("myFW.stop()", 15000); // Turn off fireworks after 15 seconds
To end after a certain number of fireworks, replace the existing JSFX.FireWorkDisplay.prototype.animate() function with the following:
Code:
var numFireworks = 0;
JSFX.FireworkDisplay.prototype.animate = function()
{
if(numFireworks == 40) myFW.stop();
else numFireworks++;
status = this.loadCount;
if(this.loadCount < this.imgArray.length)
return;
for(var i=0 ; i<this.fireworks.length ; i++)
this.fireworks[i].animate();
}
Bookmarks