The Colorfuls
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.geom.*;
import caurina.transitions.Tweener;
public class main extends Sprite{
public var mc:Sprite;
private var fmx:Number,fmy:Number;
private var md:Boolean = false;
public function main():void{
addEventListener(Event.ENTER_FRAME,update)
}
public function update(e:Event):void{
var twmc:Sprite = new Sprite();
var g:Graphics = twmc.graphics;
g.beginFill (0xFF0000, 1.0);
g.drawCircle ( 0, 0, 20 );
var scale:Number = (Math.random()+Math.random())/2;
var color:ColorTransform = new ColorTransform(0,0,0,0,155+Math.random()*100,155+Math.random()*100,155+Math.random()*100,0);
addChild(twmc);
twmc.x = fmx+(Math.random()*20)-10;
twmc.y = fmx+(Math.random()*20)-10;
twmc.alpha = 0;
twmc.scaleX = 0;
twmc.scaleY = 0;
twmc.transform.colorTransform = color;
twmc.rotation = Math.random()*360;
if (md){
Tweener.addTween(twmc,{
alpha : 1,
x : Math.random()*mc.stage.width+(Math.random()*100)-50,
y : Math.random()*mc.stage.height+(Math.random()*100)-50,
scaleX : scale,
scaleY : scale,
rotation : Math.random()*360,
time : 1,
delay : 0});
}else{
Tweener.addTween(twmc,{
alpha : 1,
x : mouseX+(Math.random()*100)-50,
y : mouseY+(Math.random()*100)-50,
scaleX : scale,
scaleY : scale,
rotation : Math.random()*360,
time : 1,
delay : 0});
}
Tweener.addTween(twmc,{
alpha : 0,
x : fmx+(Math.random()*500)-250,
y : fmy+(Math.random()*500)-250,
scaleX : 0,
scaleY : 0,
rotation : Math.random()*360,
time : 2,
delay : 1});
fmx = mouseX;
fmy = mouseY;
}
}
}