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

flash on 2010-12-5

参考:Adobe Flash CS3 詳細!ActionScript3.0入門ノート サンプル7-1
Get Adobe Flash player
by syano 05 Dec 2010
/**
 * Copyright syano ( http://wonderfl.net/user/syano )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/p45p
 */

//参考:Adobe Flash CS3 詳細!ActionScript3.0入門ノート サンプル7-1

package {
    import flash.display.Sprite;
    
    public class DrawFlower extends Sprite {
        
        public function DrawFlower() {
            init();
        }
        
        private function init():void {
            var cx:int = stage.stageWidth / 2;
            var cy:int = stage.stageHeight / 2;
            var color:uint;
            var alpha:Number;
            var ew:int;
            var eh:int;
            
            for(var i:int = 1; i <= 50; i++) {
                color = Math.random()*0xffffff;
                alpha = 1 - 0.02*i
                ew = 12*i
                
                for (var j:int = 1; j<= 12; j++) {
                    eh = ew / 3;
                    
                    var canvas:Sprite = new Sprite();
                    stage.addChild(canvas);
                    
                    canvas.graphics.lineStyle(1, color, alpha);
                    canvas.graphics.drawEllipse(-ew, -eh/2, ew, eh);
                    
                    canvas.x = cx;
                    canvas.y = cy;
                    canvas.rotation = 30*(j-1);
                }
            }
        }
        
    }
}