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

forked from: forked from: 文字のテスト

Get Adobe Flash player
by Tamanegi_kenshi 22 Jan 2010
    Embed
/**
 * Copyright Tamanegi_kenshi ( http://wonderfl.net/user/Tamanegi_kenshi )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/zQOD
 */

// forked from nacookan's forked from: 文字のテスト
// forked from nacookan's 文字のテスト
package {
    import flash.display.*;
    import flash.text.*;
    import com.flashdynamix.motion.Tweensy;
    import fl.motion.easing.*;
    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            var format:TextFormat = new TextFormat();
            format.font = 'Century Gothic';
            format.size = 20;
            var text:TextField = new TextField();
            text.defaultTextFormat = format;
            text.text = '1111111111111';
            text.autoSize = TextFieldAutoSize.LEFT;
            var bmpd:BitmapData = new BitmapData(text.textWidth, text.textHeight, true, 0xffffffff);
            bmpd.draw(text);
            //addChild(new Bitmap(bmpd));
            
            var s:Number = 4;
            for(var xx:Number = 0; xx < bmpd.width; xx++){
                for(var yy:Number = 0; yy < bmpd.height; yy++){
                    if(bmpd.getPixel(xx, yy) == 0xffffff) continue;
                    var sp:Sprite = new Sprite();
                    sp.graphics.beginFill(0xff0000);
                    sp.graphics.drawCircle(0, 0, s / 2);
                    sp.graphics.endFill();
                    sp.x = Math.random() * 400;
                    sp.y = Math.random() * 400;
                    sp.z = Math.random() * 1000;
                    addChild(sp);
                    Tweensy.to(sp, {x: xx * s, y: yy * s + 100, z: 0}, 3 + yy * 0.3, Sine.easeOut);
                }
            }
        }
        
        private var traceText:TextField;
        private function t(message:Object):void {
            if(traceText == null) {
                var format:TextFormat = new TextFormat();
                format.font = 'Century Gothic';
                format.size = 10;
                traceText = new TextField();
                traceText.defaultTextFormat = format;
                traceText.autoSize = TextFieldAutoSize.LEFT;
                addChild(traceText);
            }
            traceText.appendText(message.toString());
        }
    }
}