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

MultiStripe (090616)

ここから何かできるかな。
Get Adobe Flash player
by OneInchPunch 16 Jun 2009
/**
 * Copyright OneInchPunch ( http://wonderfl.net/user/OneInchPunch )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/8llq
 */

// ここから何かできるかな。

package {
    import flash.display.*;
    import flash.events.*;
    
    public class MultiStripe extends Sprite {
        
        private var stageW:Number = stage.stageWidth;
        private var stageH:Number = stage.stageHeight;
        
        public function MultiStripe() {
            
            init();
        }
        
        
        private function init():void {
            
            // コンテナMC
            var _container:MovieClip = new MovieClip();
            _container.x = 0;
            _container.y = 0;
            
            addChild(_container);
            
            
            // 横分割数
            var horizontalNum:int = 4;
            // 縦分割数
            var verticalNum:int = 300;
            
            
            for(var i:int = 0; i < horizontalNum; i++) {
                
                // 横縞
                var _box:Sprite = new Sprite();
                
                _box.graphics.beginFill(0xffffff);
                _box.graphics.drawRect(0, ((stageH / horizontalNum) * (i + 1)) - (stageH / horizontalNum), stageW, stageH / horizontalNum);
                _box.graphics.endFill();
                
                
                // 縦縞
                for (var n:int = 0; n < verticalNum; n++) {
                    
                    var _obj:Sprite = new Sprite();
                    
                    _obj.graphics.beginFill(Math.random() * 0xffffff);
                    _obj.graphics.drawRect(((stageW / verticalNum) * (n + 1)) - (stageW / verticalNum), (stageH / horizontalNum) * i, stageW / verticalNum, stageH / horizontalNum);
                    _obj.graphics.endFill();
                    
                    // 横縞に追加
                    _box.addChild(_obj);
                    
                }
                
                
                // コンテナに追加
                _container.addChild(_box);
            }
        }
        
    }
}