forked from: Hello World!!!
// forked from nitoyon's Hello World!!!
package{
import flash.display.*;
import flash.text.*;
import flash.filters.*;
import flash.geom.*;
import caurina.transitions.Tweener;
public class Foo extends Sprite{
private var bd:BitmapData;
public function Foo():void{
var tf:TextField = new TextField();
tf.textColor = 0x000000;
tf.text = "Hello\nWorld!!!";
tf.autoSize = "left";
bd = new BitmapData(tf.width, tf.height, false, 0x3399ff);
bd.draw(tf);
bd.applyFilter(bd, bd.rect, new Point(), new BlurFilter());
bd.draw(tf);
var directions:Object = {
r: { v:1, axis:'x', next:'d', limit: bd.width - 1 },
d: { v:1, axis:'y', next:'l', limit: bd.height - 1},
l: { v:-1, axis:'x', next:'u', limit: 0 },
u: { v:-1, axis:'y', next:'r', limit: 1 }
}
var p:Point = new Point(0, 0);
var d:Object = directions.r;
var t:int = bd.width * bd.height;
for(var i:int = 0; i < t; i++){
Tweener.addTween(
addChild(new Circle(bd.getPixel(p.x, p.y))),
{
x: p.x * 10,
y: p.y * 10,
delay: i * 0.0015
}
);
if (p[d.axis] == d.limit) {
// change direction
d.limit -= d.v;
d = directions[d.next];
}
p[d.axis] += d.v;
}
}
}
}
import flash.display.Sprite;
class Circle extends Sprite{
public function Circle(color:uint):void{
graphics.beginFill(color);
graphics.drawCircle(0, 0, 6);
graphics.endFill();
}
}