Dead Code Preservation :: Archived AS3 works from wonderfl.net

AuralSynapse

AuralSynapse
BradSedito 12.11.2011
/**
 * Copyright bradsedito ( http://wonderfl.net/user/bradsedito )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/gdx6
 */

// AuralSynapse
// BradSedito 12.11.2011


package 
{
    import flash.display.*;
    import flash.events.*;
    import flash.filters.BlurFilter;
    import net.hires.debug.Stats;
    
    
    public class AuralSynapse extends Sprite 
    {
        public  var retang:Shape;
        public  var circs:uint;
        public  var circulos:Array;
        public  var alt:int, larg:int;
        public  var blur:Array;
        private var stats:Stats = new Stats();


        public function AuralSynapse() 
        {
            stage.scaleMode = StageScaleMode.EXACT_FIT;// SHOW_ALL;
            stage.align = StageAlign.TOP;
            stage.frameRate = 90;
            stage.quality = 'BEST'; 
            // ENTRY POINT: 
                        
            circs = 12;
            circulos = new Array(circs);
            alt = stage.stageHeight;
            larg = stage.stageWidth;
            blur = [new BlurFilter( 100,100,4 )];
            retang = new Shape();
            retang.graphics.beginFill(0);
            retang.graphics.drawRect(0, 0, larg, alt);
            stage.addChild(retang);
            for(var i:uint = 0; i < circs; i++) {
                circulos[i] = new Brilho(Math.random() * larg, Math.random() * alt, blur);
                stage.addChild(circulos[i]);
            }
            addEventListener("enterFrame", atualizar);
            addChild( stats );
        }
        
        public function atualizar(e:Event):void {
            for(var i:uint = 0; i < circs; i++) circulos[i].avancar(larg, alt);
        }
    }
}
import flash.display.Shape;
class Brilho extends Shape {
    public var vx:Number;
    public var vy:Number;
    public function Brilho(x:Number, y:Number, filtros:Array) {
        super();
        this.x = x;
        this.y = y;
        vx = Math.random() * 4 - 2;
        vy = Math.random() * 4 - 2;
        graphics.beginFill(Math.floor(Math.random() * 0xFFFFFF));
        graphics.drawCircle(0, 0, Math.random() * 40 + 80);
        blendMode = "add";
        filters = filtros;
    }
    public function avancar(mx:Number, my:Number):void {
        if(x > mx || x < 0) vx *= -1;
        if(y > my || y < 0) vy *= -1;
        x += vx;
        y += vy;
    }
}