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

渦巻き

/**
 * Copyright gaziya ( http://wonderfl.net/user/gaziya )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/pa6U
 */

package {
    import flash.geom.ColorTransform;
    import flash.geom.Matrix;
    import flash.events.Event;
    import flash.display.Shape;
    import flash.display.BitmapData;
    import flash.display.Bitmap;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            graphics.beginFill(0x003333)                
            graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight)
            var canvas:BitmapData=new BitmapData(stage.stageWidth,stage.stageHeight,true,0x0)
            addChild(new Bitmap(canvas))
            var shape:Shape = new Shape
            with (shape) {
                graphics.beginFill(0xff3300)
                graphics.drawCircle(0,0,5)                
            }
            addEventListener(Event.ENTER_FRAME, loop)
            var theta:Number = 0
            var radius:int = 200
            function loop(e:Event):void {
                var colorTransform:ColorTransform = new ColorTransform
                colorTransform.alphaMultiplier = 0.995
                canvas.colorTransform(canvas.rect, colorTransform)
                var split:int = 8
                for (var i:int= 0;i<split;i++) {
                    var matrix:Matrix = new Matrix
                    matrix.translate(stage.stageWidth/2,stage.stageHeight/2)
                    matrix.translate(radius*Math.cos(2*Math.PI/split*i+theta),radius*Math.sin(2*Math.PI/split*i+theta))
                    canvas.draw(shape,matrix)
                }
                theta -= 0.005*Math.PI
                theta %= 2*Math.PI
                radius--
                if (radius < 20) radius = 200
            }            
        }
    }
}