Now comes the complicated part: the code. Im going to start off by showing you the full block of code that accomplishes my drawing animation, and then break it down piece by piece:
onClipEvent(load) {
xstart=Math.random()*300;
ystart=Math.random()*300;
_root.createEmptyMovieClip ("twisty", 1);
_root.twisty.lineStyle (1, 0x5566FF, 40);
_root.twisty.moveTo (xstart, ystart);
}
onClipEvent(enterFrame){
if(xstart>0&&xstart<300&&ystart>0&&ystart<300) {
xstart=xstart*Math.atan(xstart)*Math.random();
ystart=ystart*Math.atan(ystart)*Math.random();
_root.twisty.curveTo(xstart+20*Math.random(), ystart-20*Math.random(), xstart, ystart);
}
else {
ystart=300*Math.random();
xstart=300*Math.random();
}
}