flash on 2013-6-3

by ifree
♥2 | Line 25 | Modified 2013-06-03 01:35:24 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.display.Shape;
    public class FlashTest extends Sprite {
        private var rects:Vector.<Shape>=new Vector.<Shape>;
        public function FlashTest() {
            // write as3 code here..
            for(var i:int=0;i<20;i++){
                var shape:Shape=new Shape();
                shape.graphics.beginFill(i*0x555555+i*10,.8);                
                shape.graphics.drawRoundRect(10+i,i+10,100,100,30);
                rects.push(shape);
                shape.rotation=i*10;
                addChild(shape);
            }
            this.x=this.y=300;
            
            addEventListener("enterFrame",function(e:*):void{
                var i:uint;
                for each(var s:Shape in rects)
                    s.rotation+=(i++)/4;
                rotation+=.3;
                rotationY+=.6;
            });
        }
    }
}