Tweenerで適当に
package {
import flash.display.Sprite;
import flash.events.*;
import flash.filters.GlowFilter;
import caurina.transitions.*;
import caurina.transitions.properties.*;
[SWF(width="465", height="465", backgroundColor="#000000", frameRate="60")]
public class FlashTest extends Sprite {
public function FlashTest() {
ColorShortcuts.init();
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
var sp_arr:Array = new Array();
for(var i:uint=0; i<200; i++){
var radius:uint = Math.random()*40+10;
var glow:GlowFilter = new GlowFilter(0xffffff, 0.5, 10, 10, 1);
sp_arr[i] = new Sprite();
sp_arr[i].graphics.beginFill(Math.random()*0xffffff, Math.random()*0.9+0.1);
sp_arr[i].graphics.drawCircle(0, 0, radius);
sp_arr[i].graphics.endFill();
sp_arr[i].blendMode = "add";
sp_arr[i].filters = new Array(glow);
sp_arr[i].x = int(Math.random()*stage.stageWidth);
sp_arr[i].y = int(Math.random()*stage.stageHeight);
addChild(sp_arr[i]);
sp_arr[i].addEventListener(MouseEvent.ROLL_OVER, rollOver);
}
}
private function rollOver(e:MouseEvent):void{
var tg:Sprite = e.target as Sprite;
tg.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
tg.addEventListener(MouseEvent.ROLL_OUT, rollOut);
Tweener.addTween(tg, {scaleX:2, scaleY:2, _color:0xffffff, time:3, transition:"easeoutelastic"});
}
private function rollOut(e:MouseEvent):void{
var tg:Sprite = e.target as Sprite;
tg.removeEventListener(MouseEvent.ROLL_OUT, rollOut);
tg.addEventListener(MouseEvent.ROLL_OVER, rollOver);
this.setChildIndex(tg, 0);
Tweener.addTween(tg, {scaleX:1, scaleY:1, _color:Math.random()*0xffffff, time:5, transition:"easeoutelastic"});
}
}
}