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

forked from: forked from: forked from: hyperdiscosquares

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

// forked from PrettyMuchBryce's forked from: forked from: hyperdiscosquares
// forked from PrettyMuchBryce's forked from: hyperdiscosquares
// forked from PrettyMuchBryce's hyperdiscosquares
package {
    import flash.filters.BlurFilter;
    //Messing around
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.display.Bitmap;
    import flash.geom.Rectangle;
    import flash.display.BitmapData;
   [ SWF (width = '400', height = '500', backgroundColor = '0x000000', frameRate = '60')]
    public class FlashTest extends Sprite {
        private var _squares:Vector.<Square>;
        private var _buffer:Bitmap;
        private var _tick:int = 0;
        private const _tickMax:int = 1;
        public function FlashTest() {
            _buffer = new Bitmap(new BitmapData(500,500,false,0x0),"never",false);
            _squares = new Vector.<Square>(100);
            addEventListener(Event.ENTER_FRAME,update);
            addChild(_buffer);
            //_buffer.filters=[new BlurFilter(0,2,1)];
            //rotationX = -38;
           // z = 40;
            //y = -40
            _buffer.x=-50;
            for (var i:int = 0; i < 500/50; i++) {
                for (var j:int = 0; j < 500/50; j++) {
                    _squares[(i*10)+j]=new Square(i*50,j*50);
                }
            }         
            _squares[10000].colorize();
        }
        public function update(e:Event):void {
          //  if (rotation
            _tick++;
            if (_tick > _tickMax) {
              //  _buffer.bitmapData.fillRect(new Rectangle(0,0,500,500),0);
                for (var i:int=0; i < 99; i++) {
                    //_squares[i].colorize();
                    _squares[i].blendColor(_squares[i+1].myColor);
                    _squares[i].render(_buffer.bitmapData);
                }
                _squares[99].colorize();
                _tick = 0;
            }
        }
    }
}
import flash.filters.BlurFilter;
import flash.display.AVM1Movie;
import flash.display.Shape;
import flash.geom.Rectangle;
import flash.display.Sprite;
import flash.display.BitmapData;
import flash.display.BlendMode;
import flash.geom.Matrix;
    internal class Square {
        public var myColor:uint;
        private var x:Number;
        private var y:Number;
        private var rect:Rectangle;
        private var m:Matrix = new Matrix();
        private var s:Shape = new Shape();
        public function Square(X:Number,Y:Number):void {
            x = X;
            y = Y;
            rect = new Rectangle(x,y,50,50);
            colorize();
        }
        public function colorize():void {
            myColor = Math.random()*0xFFFFFF;
            s.graphics.beginFill(myColor);
            s.graphics.drawRect(0,0,50,50);
            s.graphics.endFill();
        }
        public function blendColor(color:uint):void {
            myColor = color+1000;
           // s.graphics.beginFill(myColor);
            //s.graphics.drawRect(0,0,50,50);
            //s.graphics.endFill();
            
        }
        public function render(target:BitmapData):void {
            m.identity();
            //m.scale(1,.1);
            //m.scale(10,.1);
            m.rotate(Math.random()*360);
            m.translate(x,y);
            if (Math.random()>.5) target.draw(s,m,null,BlendMode.HARDLIGHT); else target.draw(s,m,null,BlendMode.DARKEN);
            //target.fillRect(rect,myColor);
        }
    }