In flash 8, I have a movie clip(“mc”), and when you roll over it, it runs a script that makes sparks. What I’d like to do is have the script STOP running when you roll out, but I’m not sure how to do this. Can anyone help? Here’s the script:
[AS]mc.onRollOver = function() {
// Create spark
sparkCount = 0;
function makeSpark() {
sparkCount++;
var spark = attachMovie(“spark”, “spark”+sparkCount, sparkCount);
spark._x = 275;
spark._y = 200;
spark.g = 0;
spark.yMovement = Math.random()12-6;
spark.xMovement = -Math.random()10-14;
spark.onEnterFrame = movIt;
}
//
//Move spark
movIt = function () {
this._alpha-=2;
if(this._alpha<4)this.removeMovieClip();
this._y -= this.yMovement=.95;
this._x += this.xMovement+=1;
if(this._x>250){
this.xMovement=-.6;
this._x = 250;
}
};
//
// Start shooting sparks
setInterval(makeSpark, 10);
//
//
}
[/AS]
Thanks in advance!