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

izm_design さんお誕生日おめでとうございまーす

izm_design さん、お誕生日おめでとうございまーす。
Get Adobe Flash player
by soundkitchen 18 Oct 2009
    Embed
/**
 * Copyright soundkitchen ( http://wonderfl.net/user/soundkitchen )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/p68c
 */

/**
 *  izm_design さん、お誕生日おめでとうございまーす。
 */
package
{
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageQuality;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFormat;
    import flash.text.TextFormatAlign;

    import com.flashdynamix.utils.SWFProfiler;
    import org.libspark.betweenas3.BetweenAS3;
    import org.libspark.betweenas3.easing.*;
    import org.libspark.betweenas3.tweens.ITween;

    [SWF(width=465, height=465, frameRate=30, backgroundColor=0x000000)]

    /**
     *
     */
    public class Main extends Sprite
    {
        private var _txt:TextField;

        /**
         *
         */
        public function Main()
        {
            addEventListener(Event.ADDED_TO_STAGE, initialize);
        }

        /**
         *
         */
        private function initialize(evt:Event):void
        {
            removeEventListener(Event.ADDED_TO_STAGE, initialize);

            //  setup stage.
            stage.align = StageAlign.TOP_LEFT;
            stage.quality = StageQuality.HIGH;
            stage.scaleMode = StageScaleMode.NO_SCALE;

            //  setup debugger.
            SWFProfiler.init(this);

            var c:String,
                cx:Number, cy:Number,
                t:ITween, tl:Array,
                b:Bitmap, d:BitmapData, s:Sprite;

            cx = stage.stageWidth >> 1;
            cy = stage.stageHeight >> 1;

            _txt = new TextField();
            _txt.defaultTextFormat = new TextFormat("Arial", 96, 0xFFFFFF);
            _txt.autoSize = TextFieldAutoSize.LEFT;

            tl = [];
            for each (c in MESSAGES)
            {
                _txt.text = c;
                d = new BitmapData(_txt.width, _txt.height, true, 0);
                d.draw(_txt);
                b = new Bitmap(d);
                b.x -= b.width >> 1;
                b.y -= b.height >> 1;
                b.smoothing = true;
                s = new Sprite();
                s.x = cx;
                s.y = cy;
                s.scaleX = s.scaleY = 0;
                s.addChild(b);
                addChild(s);
                t = BetweenAS3.serial(
                    BetweenAS3.addChild(s, this),
                    BetweenAS3.to(s, {
                        scaleX: 10,
                        scaleY: 10,
                        _blurFilter: {
                            blurX: 128,
                            blurX: 128
                        }
                    }, .25, Sine.easeIn),
                    BetweenAS3.removeFromParent(s)
                );
                tl.push(t);
            }
            _txt.defaultTextFormat = new TextFormat("Arial", 24, 0xFFFFFF, true, null, null, null, null, TextFormatAlign.CENTER);
            _txt.text = "izm_design さん\nお誕生日おめでとうございまーす!\n禁煙頑張っておくんなましー!";
            d = new BitmapData(_txt.width, _txt.height, true, 0);
            d.draw(_txt);
            b = new Bitmap(d);
            b.x -= b.width >> 1;
            b.y -= b.height >> 1;
            b.smoothing = true;
            s = new Sprite();
            s.x = cx;
            s.y = cy;
            s.rotation = Math.random() * 360;
            s.scaleX = s.scaleY = 0;
            s.addChild(b);
            addChild(s);
            t = BetweenAS3.serial(
                BetweenAS3.addChild(s, this),
                BetweenAS3.to(s, {
                    scaleX: 1,
                    scaleY: 1,
                    rotation: 0
                }, 4, Elastic.easeOutWith(2.0, .5))
            );
            t = BetweenAS3.delay(t, .5);
            tl.push(t);
            t = BetweenAS3.serialTweens(tl);
            t.play();
        }

        private static var MESSAGES:Array = [
            'i', 'z', 'm', 'd', 'e', 's', 'i', 'g', 'n', 'さ', 'ん', '',
            'お', 'た', 'ん', 'じ', 'ょ', 'う', 'び', '',
            'お', 'め', 'で', 'と', 'う', 'ご', 'ざ', 'い', 'ま', 'す', '',
            'き', 'ん', 'え', 'ん', '',
            'が', 'ん', 'ば', 'っ', 'て', 'お', 'く', 'ん', 'な', 'ま', 'し'
        ];
    }
}