Tad-Pole
package {
import flash.display.Sprite;
import flash.display.Shape;
import flash.events.TimerEvent;
import flash.geom.Point;
import flash.utils.Timer;
import flash.filters.BevelFilter;
import flash.filters.DropShadowFilter;
import flash.ui.Mouse;
[SWF(width=380,height=380,frameRate=60,backgroundColor=0x0292623)]
public class Main extends Sprite {
private var num:uint=40;
private var vel:Number=2.2;
private var timer:Timer;
private var puntos:Array;
private var dibu:Shape;
public function Main():void {
puntos=new Array();
for (var i:uint=0; i < num; i++) {
puntos.push(new Point(190,190));
}
dibu = new Shape();
addChild(dibu);
filtros(dibu,1.9,0x000000,0,45);
timer=new Timer(16);
timer.addEventListener("timer",mueve);
timer.start();
Mouse.hide();
}
private function mueve(e:TimerEvent):void {
var col:uint=0xa54a987;
puntos[0].x=mouseX;
puntos[0].y=mouseY;
dibu.graphics.clear();
dibu.graphics.moveTo(puntos[0].x,puntos[0].y);
for (var i:uint=1; i < num; i++) {
dibu.graphics.lineStyle(num-i, col+(i*3));
var p1:Point=puntos[i];
var p2:Point=puntos[i-1];
p1.x += (p2.x - p1.x) / vel;
p1.y += (p2.y - p1.y) / vel;
dibu.graphics.lineTo(p1.x,p1.y);
}
}
private function filtros(mc:Shape, grosor:Number, col:uint, espacio:Number, angulo:uint):void {
var filterArray:Array = new Array();
filterArray.push(new BevelFilter(1, -45, 0x000000, .5, 0xffffff, .0, 10, 10, 100, 3));
filterArray.push(new DropShadowFilter(espacio, angulo, col, 100, grosor, grosor, 100, 3));
filterArray.push(new DropShadowFilter(3, 135, 0x000000, .15, 2, 2, 100, 1));
mc.filters = filterArray;
}
}
}