# freeskier89→ 4. Circular Space Filling

Here is a circular space filling thing I made a while back, and modified to code to meet the guidelines. I know you guys are going to say I copied Chaoswarp, but actually I didn’t. You can ask jerez_z if you wish, for I posted this at ffiles long before the contest began (http://ffiles.com/view_listing.php?sid=94&cat=18).

The motion was inspired by chaoswarp though, and I will make sure to give him part of the prize if I win with this one:hugegrin:

``````function MaxRadius(center1, dist) {
for (var n = 0; n<stack.length; n++) (Math.sqrt((stack[n].center.x-center1.x)*(stack[n].center.x-center1.x)+(stack[n].center.y-center1.y)*(stack[n].center.y-center1.y))-stack[n].radius<dist) ? dist=Math.sqrt((stack[n].center.x-center1.x)*(stack[n].center.x-center1.x)+(stack[n].center.y-center1.y)*(stack[n].center.y-center1.y))-stack[n].radius : null;
(dist>225 || dist<1) ? dist=[1, 225][int(dist>225)] : null;
return dist;
}
MovieClip.prototype.FollowPoint = function(p) {
this._x = this._x+(p.x-this._x)/36;
this._y = this._y+(p.y-this._y)/36;
};
circle = _root.createEmptyMovieClip("circle"+(depth++), depth);
circle._x = 200+300*Math.cos(Math.random()*Math.PI*2);
circle._y = 200+300*Math.sin(Math.random()*Math.PI*2);
circle._alpha=0;
circle.center = center;
circle.onPress = function(){
this.removeMovieClip();
}
stack==undefined ? stack=[circle] : stack.push(circle);
circle.onEnterFrame = function() {
((this.center.x >= this._x-.5 && this.center.x <= this._x+.5)&&(this.center.y >= this._y-5 && this.center.y <= this._y+5)) ? this.onEnterFrame = null : (this.FollowPoint(this.center) , this._alpha+=3);
};
}
drawCircle({x:random(Stage.width), y:random(Stage.height)}, 30+random(70), 0);
onEnterFrame = function () {