forked from: 文字点滅
// forked from matsu4512's 文字点滅
package{
import flash.display.*;
import flash.filters.*;
import flash.geom.*;
import flash.text.*;
import org.libspark.betweenas3.BetweenAS3;
import org.libspark.betweenas3.tweens.ITween;
[SWF(backgroundColor=0x000000)]
public class BetweenAS3_Text extends Sprite{
private var bd:BitmapData;
public function BetweenAS3_Text():void{
var tf:TextField = new TextField();
tf.text = "BradSedito";
tf.autoSize = "left";
// tf.font = "Verdana";
//テキストフィールドの大きさでBitmapを生成
bd = new BitmapData(tf.width, tf.height, false, 0xffffff);
bd.draw(tf);
for(var i:int = 0; i < bd.width; i++){
for(var j:int = 0; j < bd.height; j++){
var p:Shape = new Shape();
p.x = i*8;
p.y = j*8;
p.scaleX = p.scaleY = 0;
p.graphics.beginFill(0x000000);
p.graphics.drawCircle(0, 0, 3.0);
p.graphics.endFill();
if(bd.getPixel(i, j) < 0xf00000){
var t:ITween = BetweenAS3.serial(
BetweenAS3.addChild(p, this),
BetweenAS3.tween(p,
{scaleX:1, scaleY:1, transform:{colorTransform: {redOffset: 255, blueOffset: 255, greenOffset: 255}}},
null,
1),
BetweenAS3.tween(p,
{scaleX:0, scaleY:0, transform:{colorTransform: {redOffset: 0, blueOffset: 0, greenOffset: 0}}},
{scaleX:1, scaleY:1, transform:{colorTransform: {redOffset: 255, blueOffset: 255, greenOffset: 255}}},
1));
t.stopOnComplete = false;
t.play();
}
}
}
}
}
}