all groups > flash actionscript > march 2004 >
You're in the

flash actionscript

group:

action script MC stop repeating


action script MC stop repeating UltraTch
3/14/2004 10:57:26 PM
flash actionscript:
how do you make a MC which has the following action scrip stop repeating once
it reaches the end?

this.createEmptyMovieClip("painter", 1);

var x = new Array();
var y = new Array();

painter.c = 0;
painter.lineStyle(3, "0x000000", 100);

painter.onEnterFrame = function() {
if (painter.c < x.length) {
painter.lineTo(x[painter.c], y[painter.c]);
painter.c++;
}
}
stop(); <----------------------that doesnt work?

Re: action script MC stop repeating kglad
3/15/2004 2:34:41 AM
do you mean that you want your onEnterFrame loop to stop at some point? if so,
you can use the delete function and my guess is you want to use an else branch
of your if-conditional to place that delete (assuming the arrays x and y have
elements assigned somewhere).
AddThis Social Bookmark Button