In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

文字点滅

Get Adobe Flash player
by matsu4512 12 May 2009
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 = "Hello!!!!";
            tf.autoSize = "left";
            
            //テキストフィールドの大きさで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, 4.5);
                	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();
                	}
                }
            }
        }
    }
}