Hi everybody,
I have the code below, containing a setInterval. With it I am trying to call a function once, after 7 seconds, and then clear the Interval.
It is not working and the interval keeps calling the function every 7 seconds.
Can anyone tell me if I am missing anything?
Thanks a lot for your help.
//
function scaleUpCurves() {
clearInterval(scaleUpInterval);
trace("Interval working");
fvCurve_mc.onEnterFrame = function() {
this._xscale += 10;
this._yscale += 10;
if (this._xscale >= 100 && this._yscale >= 100) {
this._xscale = 100;
this._yscale = 100;
}
this._x -= 10;
this._y -= 10;
if (this._x <= fvX && this._y <= fvY) {
this._x = fvX;
this._y = fvY;
delete this.onEnterFrame;
}
};
}
//
//
this.onEnterFrame = function() {
badCurve_mc._alpha -= 10;
if (badCurve_mc._alpha <= 0) {
badCurve_mc._alpha = 0;
goodCurves_mc._alpha += 10;
goodCurves_mc._x += 10;
if (goodCurves_mc._alpha >= 100 && goodCurves_mc._x >= 296) {
goodCurves_mc._alpha = 100;
goodCurves_mc._x = 296;
var scaleUpInterval = setInterval(scaleUpCurves, 7000);
delete this.onEnterFrame;
}
}
};