Skip to main content
Participant
January 29, 2014
Question

help on stopping action script

  • January 29, 2014
  • 1 reply
  • 598 views

im using this actionscript code to generate fire effect on my flash ad but i want this code to disable in a frame when the ad plays, can you pls help me on this.

function mover(){

this._y += this.speed;

}

function fire(x1,n){

for(i = 0; i<n; i++){

path = this.createEmptyMovieClip("path"+i, i);

path._x = Math.random()*x1;

path.startFrame = 2*Math.abs(25 - path._x);

dot = this.path.attachMovie("flame", "flame", 0);

dot.speed = -(Math.random()*5+1);

dot.gotoAndPlay(Math.round(Math.random()*34));

dot.onEnterFrame= mover;

}

}

fire(600, 725);

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
January 29, 2014

What you likely need to do is the delete the onEnterFrame and somehow set the value of i to be equal to n within that function or otherwise stop the looping