Hi, I’ve been having fun making these curve generating movies such as this one:
http://www.walkingbaby.co.uk/experiments/spiderdraw4.html
The problem I am having is that after they get more detailed they start slowing down considerably. Does anyone have any suggestions as to how i can make it more efficient?
This is how I am currently doing it:
this.createEmptyMovieClip("curve",1);
curve.xPoint = Stage.width/2;
curve.yPoint = Stage.height/2;
curve.xPointA = Stage.width/2;
curve.yPointA = Stage.height/2;
curve.onMouseMove = function(){
with(this){
if(Key.isDown(Key.ENTER)){
//colour = Math.random() * 16581375;
colour = 0x555555;
lineStyle(3, colour, 10);
moveTo(xPointA,yPoint);
curveTo(_xmouse,_ymouse,xPointA,yPointA);
//curveTo(Stage.width-_xmouse,_ymouse,xPointA,_xmouse);
endFill();}
xPoint = _xmouse;
yPoint = _ymouse;
//this.xPointA+= (0.5-Math.random())*10;
this.yPointA+= (0.5-Math.random())*30;
if (yPointA > Stage.height) yPointA = Stage.height;
if (yPointA < 0) yPointA = 0;
}
}
this.onMouseDown = function(){
curve.clear();
}
Thanks.