forked from: Hello World!!!
package{
import flash.display.*;
import flash.text.*;
import flash.filters.*;
import flash.geom.*;
import caurina.transitions.Tweener;
[SWF(backgroundColor="0x000000")]
public class HelloWorld2 extends Sprite{
private var bd:BitmapData;
private var baseColor:uint = 0xFFFFFF;
public function HelloWorld2():void{
var tf:TextField = new TextField();
tf.textColor = 0x000000;
tf.htmlText = "<font size='18'>Hello\nWorld</font>";
tf.autoSize = "left";
bd = new BitmapData(tf.width, tf.height, false, baseColor);
bd.draw(tf);
for(var i:int = 0; i < tf.textWidth; i++){
for(var j:int = 0; j < tf.textHeight; j++){
if (bd.getPixel(i, j) == baseColor)
continue;
Tweener.addTween(
randomize(addChild(new Char(Math.random() * 0xFFFFFF))),
{
x: i * 10,
y: j * 10,
alpha: 1,
delay: (i + j) * .2 * Math.random(),
time: 1,
transition: "easeOutCirc"
}
);
}
}
}
private function randomize(d:DisplayObject):DisplayObject{
d.x = 1000;
d.y = 1000;
return d;
}
}
}
import flash.display.*;
import flash.filters.*;
import flash.text.*;
class Char extends Sprite{
public function Char(color:uint):void{
var char:String = String.fromCharCode(65 + 25 * Math.random() | 0);
var format:TextFormat = new TextFormat();
//format.size = Math.floor(20 * Math.random());
var tf:TextField = new TextField();
tf.defaultTextFormat = format;
tf.textColor = color;
tf.text = char;
addChild(tf);
}
}