forked from: flash on 2010-12-12
♥0 |
Line 48 |
Modified 2010-12-13 03:19:42 |
MIT License
archived:2017-03-30 22:26:35
ActionScript3 source code
/**
* Copyright bradsedito ( http://wonderfl.net/user/bradsedito )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/9JWye
*/
// forked from ShoyaMorita's flash on 2010-12-12
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 = 0xffffff;
tf.text = "Hello\n\nWorld!!";
tf.autoSize = "left";
bd = new BitmapData(tf.width, tf.height, false, 0x000000);
bd.draw(tf);
bd.applyFilter(bd, bd.rect, new Point(), new BlurFilter());
bd.draw(tf);
for(var i:int = 0; i < bd.width*6; i++){
for(var j:int = 0; j < bd.height*6; j++){
Tweener.addTween(
randomize(addChild(new Rect(bd.getPixel(i, j)))),
{
x: i * 2,
y: j * 2,
alpha: 1,
delay: (i + j) * .0 * Math.random(),
time: 6
}
);
}
}
}
private function randomize(d:DisplayObject):DisplayObject{
d.x = 300 * Math.random();
d.y = 300 * Math.random();
d.alpha = 0;
return d;
}
}
}
import flash.display.Sprite;
class Rect extends Sprite{
public function Rect(color:uint):void{
graphics.beginFill(0xff9900);
graphics.drawRect(0, 0, 1, 1);
graphics.endFill();
}
}