PaulSmith Version
PaulSmith.as
// forked from kadal's PaulSmith
/* PaulSmith.as */
package {
import flash.display.Sprite;
import flash.display.Graphics;
import flash.display.DisplayObject;
import flash.events.TimerEvent;
import flash.utils.Timer;
import flash.events.Event;
import flash.filters.BlurFilter;
[SWF(backgroundColor="#FFFFFF", frameRate=30)]
public class PaulSmith extends Sprite {
public function PaulSmith() {
var timer:Timer = new Timer(30, 0);
timer.addEventListener(TimerEvent.TIMER, myPaul);
timer.start();
}
private function myPaul(evt:TimerEvent):void {
var p:Sprite = new Sprite();
p.graphics.beginFill(Math.random() * 0xFFFFFF);
p.graphics.drawRect(0, 0, stage.stageWidth, Math.round(Math.random() * 3));
p.graphics.endFill();
/*
var filters_array:Array = new Array();
var myBlur:BlurFilter = new BlurFilter(0, 2, 1);
filters_array.push(myBlur);
p.filters = filters_array;
*/
p.scaleX = 0.01;
//p.x = Math.random() * stage.stageWidth;
p.y = Math.round(Math.random() * stage.stageHeight);
addChild(p);
p.addEventListener(Event.ENTER_FRAME, extending);
}
private function extending(evt:Event):void{
var p:Object = evt.target;
if(p.scaleX >= 1){
p.scaleX = 1;
} else {
p.scaleX *= 1.15;
}
if(p.scaleX >= 1){
p.removeEventListener(Event.ENTER_FRAME, extending);
}
}
}
}