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

カラフルリフレクト2

Spriteなので重いかもしれません(´・ω・`)
Get Adobe Flash player
by yuugurenote 26 Jun 2012
    Embed
/**
 * Copyright yuugurenote ( http://wonderfl.net/user/yuugurenote )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/dJs2
 */

package {
    import flash.display.Sprite;
    import flash.display.Graphics;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import flash.geom.ColorTransform;
    import frocessing.color.ColorHSV;
    [SWF(width=465,height=465,backgroundColor=0x000000,frameRate=60)]

    public class AS120626_01 extends Sprite {
        public var sw:Number=stage.stageWidth;
        public var sh:Number=stage.stageHeight;
        public var myColor:ColorTransform = new ColorTransform();
        public var viewBmd:BitmapData=new BitmapData(sw,sh,false,0x000000);
        public var viewBmp:Bitmap=new Bitmap(viewBmd);
        public var _myCircleAlpha0:myCircleAlpha0;
        public var myCol:int=0;

        public function AS120626_01() {

            addChild(viewBmp);
            var tmpBmd:BitmapData;
            myColor.redMultiplier=0.999;
            myColor.greenMultiplier=0.999;
            myColor.blueMultiplier=0.999;
            addEventListener(Event.ENTER_FRAME,xDraw);
            stage.addEventListener(Event.ENTER_FRAME,xEnter1,false,0,false);
        }
        public function xDraw(e:Event):void {
            viewBmd.draw(stage,null,myColor);
        }
        public function xEnter1(e:Event):void {
            var _color:ColorHSV=new ColorHSV(myCol+=1,0.9);
            _myCircleAlpha0 = new myCircleAlpha0(int(_color));
            _myCircleAlpha0.x=sw/2;
            _myCircleAlpha0.y=sh/2;
            addChild(_myCircleAlpha0);
        }
    }
}

import flash.display.Sprite;
import flash.geom.ColorTransform;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.filters.BlurFilter;
import frocessing.color.ColorHSV;

class myCircleAlpha0 extends Sprite {

    public var radius:Number;
    public var max:Number = 3;
    public var min:Number = -3;
    public var speedX:Number=(Math.random()* (max - min + 1) + min)
    public var speedY:Number=(Math.random()* (max - min + 1) + min)
    public var myColor2:ColorTransform = new ColorTransform();

    public function myCircleAlpha0(color:uint) {

        this.graphics.beginFill(int(color),1.5);
        this.graphics.drawCircle(0,0,0.8);
        this.graphics.endFill();
        this.addEventListener(Event.ENTER_FRAME,xEnter2,false,0,true);

    }

    public function xEnter2(e:Event):void {
        radius=this.width/2;
        this.x+=speedX;
        this.y+=speedY;
        this.rotation += 1;
        this.alpha -= 0.001;
        
        if (this.alpha < 0) {
            stage.removeChild(this);
        }

        if (this.x+radius>stage.stageWidth) {
            this.x=stage.stageWidth-radius;
            speedX=- speedX;
        }
        if (this.x-radius<0) {
            this.x=radius;
            speedX=- speedX;
        }
        if (this.y+radius>stage.stageHeight) {
            this.y=stage.stageHeight-radius;
            speedY=- speedY;
        }
        if (this.y-radius<0) {
            this.y=radius;
            speedY=- speedY;
        }
    }
}