My goal is to get a single stroke to animate randomly every time I open the animation. My code seems to be creating a new strokes during the animation causing them to stack on top of each other. This animation would work if only the previous stroke did not multiply.
import mx.transitions.Tween;
import mx.transitions.easing.*;
var randomDistance:Number = Math.random()*250
var randomStageDistance:Number = Math.random()*Stage.width
var anchorAAnimation:Tween = new Tween(anchorA, "_y", Regular.easeInOut, 100, randomDistance, 3, true);
var anchorBAnimation:Tween = new Tween(anchorB, "_y", Regular.easeInOut, 200, randomDistance, 3, true);
anchorAAnimation.onMotionFinished = anchorBAnimation.onMotionFinished = function(){;
this.yoyo();
};
this.createEmptyMovieClip("activeline",this.getNextHighestDepth());
activeline.lineStyle(3,0x000000,100,true,"none","none","round",1);
moveLineNow=function(){
activeline.moveTo(anchorA._x,anchorA._y);
activeline.curveTo(randomStageDistance,randomDistance,anchorB._x,anchorB._y);
}
setInterval(moveLineNow, 50, img1_mc);