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

code on 2008-12-19

Get Adobe Flash player
by seyself 18 Dec 2008
package {
[SWF(width="465", height="465", backgroundColor="#242424", frameRate="30")]
dynamic public class Main extends MovieClip { 
public function Main() { screen = this; container = this; 

//---------------------------------------------- START >>

var canvas:BitmapData = new BitmapData(465, 465, true, 0);
stage.addChildAt(this.bitmap = new Bitmap(canvas), 0);

var saturation:Number = random(1,0.6);
var lightness:Number  = random(0.85,0.65);
var hue:uint = 0;
var angle:Number = 0;
var pt:Point = new Point(60, 60);

loop = function():void
{
    for (var i:uint = 0; i < 7;i++ )
    {
        angle += 0.7654;
        pt.x = 250 + cos(angle) * 120;
        pt.y = 230 + sin(angle) * 120;
        
        with(graphics)
        {
            clear();
            lineStyle(1, hsl(hue++, saturation, lightness), 0.2);
            drawCircle(pt.x, pt.y, 120);
            endFill();
        }
        
        canvas.draw(this);
    }
    canvas.scroll(1, 0);
}



//---------------------------------------------- << END

} // end of constructor

public function set loop (value:Function) : void {
if (value is Function) { _loop = function(e:Event):void { value.call(screen, null); }; addEventListener("enterFrame", _loop); }
else { removeEventListener("enterFrame", _loop); }}
private var _loop:Function;

} // end of class

import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.text.*;
import flash.events.*;
import flash.utils.*;
import caurina.transitions.Tweener;
import caurina.transitions.properties.*;

{ // initialize
    ColorShortcuts.init();
    FilterShortcuts.init();
}

} // end of package

var screen:*;
var container:*;
const PI:Number = 3.141592653589793;
const PI2:Number = 6.283185307179586;
const PI_HALF:Number = 1.5707963267948966;
const PI_QUOT:Number = 0.7853981633974483;
const PI_RADIAN:Number = 0.017453292519943295;
const PI_DEGREE:Number = 57.29577951308232;
const E:Number = 2.71828182845905;
function cos (v:Number):Number { return Math.cos(v); }
function sin (v:Number):Number { return Math.sin(v); }
function tan (v:Number):Number { return Math.tan(v); }
function log (v:Number):Number { return Math.log(v); }
function sqrt (v:Number):Number { return Math.sqrt(v); }
function pow (v:Number, n:Number):Number { return Math.pow(v, n); }
function atan2 (y:Number, x:Number):Number { return Math.atan2(y, x); }
function random (max:Number=1, min:Number=0):Number { return Math.random() * (max - min) + min; }
function rgb (r:uint, g:uint, b:uint, a:Number = 0):uint { return a * 0xFF << 24 | r << 16 | g << 8 | b << 0; }
function hsl (h:Number, s:Number, l:Number, a:Number = 0.0):uint { var r:Number = 0, g:Number = 0, b:Number = 0, cmin:Number, cmax:Number; if (s < 0) s = 0; if (s > 1) s = 1; if (l < 0) l = 0; if (l > 1) l = 1; h = h % 360; if (h < 0) h = h + 360; if (l <= 0.5) { cmin = l * ( 1 - s ); cmax = 2 * l - cmin; } else { cmax = l * ( 1 - s ) + s; cmin = 2 * l - cmax; }; r = _h2v(h + 120, cmin, cmax) * 0xFF; g = _h2v(h, cmin, cmax) * 0xFF; b = _h2v(h - 120, cmin, cmax) * 0xFF; a *= 0xFF; return a << 24 | r << 16 | g << 8 | b << 0; }
function _h2v (h:Number, min:Number, max:Number):Number { h = h % 360; if (h <    0) h = h + 360; if (h <   60) return min + (max - min) * h / 60; if (h >=  60 && h < 180) return max; if (h >= 180 && h < 240) return min + (max - min) * (240 - h) / 60; return min; }