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

Brilho

Um experimento com o efeito glow, que parece ótimo em performance.
/**
 * Copyright gabriel.eu.br ( http://wonderfl.net/user/gabriel.eu.br )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/dLKM
 */

package {
    import flash.display.AVM1Movie;
    import flash.filters.BlurFilter;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.display.Shape;
    
    public class Aplicativo extends Sprite {
        public var retang:Shape;
        public var circs:uint;
        public var circulos:Array;
        public var alt:int, larg:int;
        public var blur:Array;

        public function Aplicativo() {
            circs = 20;
            circulos = new Array(circs);
            alt = stage.stageHeight;
            larg = stage.stageWidth;
            blur = [new BlurFilter(100, 100, 1)];
            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);
        }
        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;
    }
}