, Action Script.
:
http://www.flasher.ru/forum/showthread.php?t=93300
- ( ) fla.
-, .
1. fla . File > New (Ctrl+N)
2. swf 550400px
3. () :
var objectList:Array = new Array();
//
for (var i:Number = 0; i<10; i++) {
var mc:MovieClip = createEmptyMovieClip("circle_mc"+i, i);
objectList.push(mc);
mc._x = Math.random()*550;
mc._y = Math.random()*400;
//
mc.k = Math.random()*0.1+0.02;
drawCircle(mc,Math.random()*5+10,Math.random()*0xffffff,100);
}
onEnterFrame = function () {
//
for (var i:Number = 0; i
var mc:MovieClip = objectList[i];
mc._x += (_xmouse-mc._x)*mc.k;
mc._y += (_ymouse-mc._y)*mc.k;
}
//
for (var i:Number = 0; i
var mc1:MovieClip = objectList[i];
var r1:Number = mc1._width*0.5;
for (var j:Number = 0; j
var mc2:MovieClip = objectList[j];
var r2:Number = mc1._width*0.5;
var dx:Number = mc1._x-mc2._x;
var dy:Number = mc1._y-mc2._y;
var len:Number = Math.sqrt(dx*dx+dy*dy);
if (mc1 != mc2 && len
mc1._x += 0.5*(r1len)*dx/len;
mc1._y += 0.5*(r1len)*dy/len;
mc2._x -= 0.5*(r1len)*dx/len;
mc2._y -= 0.5*(r1len)*dy/len;
}
}
}
};
function drawCircle(target_mc:MovieClip, radius:Number, fillColor:Number, fillAlpha:Number):Void {
var x:Number = radius;
var y:Number = radius;
with (target_mc) {
beginFill(fillColor,fillAlpha);
moveTo(x+radius,y);
curveTo(radius+x,Math.tan(Math.PI/8)*radius+y,Math.sin(Math.PI/4)*radius+x,Math.sin(Math.PI/4)*radius+y
);
curveTo(Math.tan(Math.PI/8)*radius+x,radius+y,x,radius+y);
curveTo(-Math.tan(Math.PI/8)*radius+x,radius+y,-Math.sin(Math.PI/4)*radius+x,Math.sin(Math.PI/4)*radius+
y);
curveTo(-radius+x,Math.tan(Math.PI/8)*radius+y,-radius+x,y);
curveTo(-radius+x,-Math.tan(Math.PI/8)*radius+y,-Math.sin(Math.PI/4)*radius+x,-Math.sin(Math.PI/4)*radius
+y);
curveTo(-Math.tan(Math.PI/8)*radius+x,-radius+y,x,-radius+y);
curveTo(Math.tan(Math.PI/8)*radius+x,-radius+y,Math.sin(Math.PI/4)*radius+x,-Math.sin(Math.PI/4)*radius+
y);
curveTo(radius+x,-Math.tan(Math.PI/8)*radius+y,radius+x,y);
endFill();
}
}
>>>
!![](//s40.radikal.ru/i089/1104/8d/a5fbaf3b67c5.gif)