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

チョコ・フラ [CS4]

////////////////////////////////////////////////////////////////////////////////
// チョコ・フラ [CS4]
//
// 文字表示部分
// matacat's Flash CS5 ICON [http://wonderfl.net/c/ysQp]
////////////////////////////////////////////////////////////////////////////////
Get Adobe Flash player
by ProjectNya 14 Feb 2011
    Embed
/**
 * Copyright ProjectNya ( http://wonderfl.net/user/ProjectNya )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/wE4s
 */

////////////////////////////////////////////////////////////////////////////////
// チョコ・フラ [CS4]
//
// 文字表示部分
// matacat's Flash CS5 ICON [http://wonderfl.net/c/ysQp]
////////////////////////////////////////////////////////////////////////////////

package {

    import flash.display.Sprite;
    import flash.display.StageScaleMode;
    import flash.display.StageAlign;

    [SWF(backgroundColor="#FFFFFF", width="465", height="465", frameRate="30")]

    public class Main extends Sprite {
        private var icon:Icon;

        public function Main() {
            //Wonderfl.capture_delay(1);
            init();
        }

        private function init():void {
            icon = new Icon(150);
            addChild(icon);
            icon.x = 232;
            icon.y = 232;
            icon.scale = 2;
        }
        
    }

}


//////////////////////////////////////////////////
// Iconクラス [CS4]
//////////////////////////////////////////////////

import flash.display.Sprite;
import flash.filters.DropShadowFilter;
import flash.display.BlendMode;

class Icon extends Sprite {
    private var size:uint;
    private var _scale:Number = 1;
    private var fl:FlashCS4;

    public function Icon(s:uint) {
        size = s;
        draw();
    }

    private function draw():void {
        var base:Sprite = new Sprite();
        addChild(base);
        var rows:uint = Math.ceil(size/22);
        var cols:uint = Math.ceil(size/12);
        for (var r:uint = 0; r < rows; r ++) {
            for (var c:uint = 0; c < cols; c ++) {
                var block:Block = new Block();
                base.addChild(block);
                block.x = 22*(r - rows/2);
                block.y = 12*(c - cols/2);
            }
        }
        var overlay:Sprite = new Sprite();
        addChild(overlay);
        overlay.graphics.beginFill(0x000000);
        overlay.graphics.drawRect(-size/2, -size/2, size, size);
        overlay.graphics.endFill();
        base.mask = overlay;
        var shade:DropShadowFilter = new DropShadowFilter(4, 90, 0x000000, 0.3, 8, 8, 2, 3, false, false);
        base.filters = [shade];
        //
        fl = new FlashCS4();
        addChild(fl);
        fl.x = - 84;
        fl.y = - 82;
        var shadow:DropShadowFilter = new DropShadowFilter(1, 45, 0xFF4444, 0.5, 2, 2, 2, 3, false, false);
        fl.filters = [shadow];
        fl.blendMode = BlendMode.OVERLAY;
    }
    public function get scale():Number {
        return _scale;
    }
    public function set scale(param:Number):void {
        _scale = param;
        scaleX = scaleY = _scale;
    }

}


//////////////////////////////////////////////////
// Blockクラス
//////////////////////////////////////////////////

import flash.display.Shape;
import frocessing.color.ColorHSV;

class Block extends Shape {
    private var color:ColorHSV;

    public function Block() {
        draw();
    }

    private function draw():void {
        color = new ColorHSV();
        color.h = 20;
        color.s = 1;
        color.v = 0.6;
        graphics.beginFill(color.value);
        graphics.drawRect(0, 0, 22, 12);
        graphics.endFill();
        color.s = 0.5;
        color.v = 0.7;
        graphics.beginFill(color.value);
        graphics.moveTo(0, 0);
        graphics.lineTo(2, 2);
        graphics.lineTo(18, 2);
        graphics.lineTo(20, 0);
        graphics.endFill();
        color.s = 0.75;
        color.v = 0.7;
        graphics.beginFill(color.value);
        graphics.moveTo(0, 0);
        graphics.lineTo(2, 2);
        graphics.lineTo(2, 8);
        graphics.lineTo(0, 10);
        graphics.endFill();
        color.s = 1;
        color.v = 0.5;
        graphics.beginFill(color.value);
        graphics.moveTo(0, 10);
        graphics.lineTo(2, 8);
        graphics.lineTo(18, 8);
        graphics.lineTo(20, 10);
        graphics.endFill();
        color.s = 1;
        color.v = 0.4;
        graphics.beginFill(color.value);
        graphics.moveTo(20, 0);
        graphics.lineTo(18, 2);
        graphics.lineTo(18, 8);
        graphics.lineTo(20, 10);
        graphics.endFill();
    }

}


//////////////////////////////////////////////////
// FlashCS4クラス
//////////////////////////////////////////////////

import flash.display.Sprite;

class FlashCS4 extends Sprite {
    private var FL_C:Vector.<int> = new <int>[1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 3, 2, 3, 3];
    private var FL_D:Vector.<Number> = new <Number>[48, 42, 94, 42, 95, 57, 64, 57, 64, 77, 92, 77, 92, 91, 64, 91, 64, 123, 48, 123, 104, 42, 120, 42, 120, 109, 120, 113, 125.5, 111.5, 125.5, 122, 121.5, 124, 117, 124, 104, 124, 104, 112];

    public function FlashCS4() {
        draw();
    }
    private function draw():void {
        graphics.beginFill(0x282828);
        graphics.drawPath(FL_C, FL_D);
        graphics.endFill();
    }

}