code on 2008-12-18
package
{
import flash.display.*
import flash.events.Event;
import flash.filters.BlurFilter;
import flash.filters.GradientGlowFilter;
import flash.filters.GlowFilter
[SWF(width=600, height=600, backgroundColor=0x000000, frameRate=60)]
public class Test4_2 extends Sprite
{
public function Test4_2()
{
var arr:Vector.<Shape> = new Vector.<Shape>()
var v:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>()
for (var i:int = 0; i < 1000; i++){
var s:Shape = new Shape()
s.graphics.beginFill(Math.random() * 0xFFFFFF)
s.alpha = .3
s.graphics.drawCircle(0, 0, 3)
s.x = this.stage.stageWidth / 2;
s.y = this.stage.stageHeight / 2;
arr.push(addChild(s))
var vec:Vector.<Number> = new Vector.<Number>()
vec.push(Math.random() * 200 + 1)
vec.push(Math.random() * 200 + 1)
v.push(vec) };
var blur:BlurFilter = new BlurFilter()
blur.blurX = 5
blur.blurY = 5
blur.quality = 3
this.filters = [blur]
addEventListener(Event.ENTER_FRAME,function():void{
for (var i:int = 0; i < 1000; i++){
Shape(arr[i]).x += (mouseX - Shape(arr[i]).x) / v[i][0];
Shape(arr[i]).y += (mouseY - Shape(arr[i]).y) / v[i][1];}})
}
}
}