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

Proximity step 1

I Will extend tomorrow, gott go now.
* Angry girlfriend!
Get Adobe Flash player
by onedayitwillmake 07 May 2009
/**
 * Copyright onedayitwillmake ( http://wonderfl.net/user/onedayitwillmake )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/xJXn
 */

/**
 * I Will extend tomorrow, gott go now.
 * Angry girlfriend!
 */
package 
{
	
	import flash.display.GradientType;
	import flash.display.Shape;
	import flash.display.SpreadMethod;
	import flash.display.Sprite;
	import flash.display.StageQuality;
	import flash.events.Event;
	import flash.geom.Matrix;

	[SWF(width="465", height="465", background="#000000")]
	
	public class Proximity extends Sprite
	{
		private var _lastCircle:Circle
		private var _canvas:Sprite;
		
		public function Proximity()
		{
			stage.quality = StageQuality.LOW;
			
			addChildAt(createBG(), 0);
			addChild(_canvas = new Sprite());
			
			addEventListener(Event.ENTER_FRAME, loop);			
			_canvas.graphics.lineStyle(0.5, 0xffffff, 0.3);
		}
		
		private function createBG():Sprite
		{
			var matr:Matrix = new Matrix();
			matr.createGradientBox(465, 465, Math.PI / 2, 0, 0);
			
			var bg:Sprite = new Sprite();
			bg.graphics.beginGradientFill
			(
				GradientType.LINEAR, 
				[0xDEDBA7, 0xD13F32], //colors
				[1, 1], //alphas
				[0, 255], //ratios
				matr, //matrix
				SpreadMethod.PAD
			);	
			
			bg.graphics.drawRect(0, 0, 465, 465);
			bg.graphics.endFill();
			
			return bg;
		}
		
		private function loop(e:Event):void
		{
			if(Math.random() < 0.05) return;
			
			var c:Circle = new Circle();
				//trace(c);
				c.x = Math.random() * stage.stageWidth;
				c.y = Math.random() * stage.stageHeight;
				_canvas.addChild(c);
				
				//Connect
				if(_lastCircle != null)
				{
                                        _lastCircle.alpha *= 0.6 + Math.random() * 0.4 
					_canvas.graphics.moveTo(_lastCircle.x, _lastCircle.y);
					_canvas.graphics.curveTo(c.x, c.y, (c.x - _lastCircle.x) * 0.5, (c.y - _lastCircle.y)*0.5);
				}
				
			_lastCircle = c;
		}
	}
}


import flash.display.Shape;
import flash.display.Sprite;

class Circle extends Sprite
{
	private var _radius	:Number = Math.random() * 15 + 5;
	//Linked List
	public var next:Circle;
	
	public function Circle():void
	{
		graphics.beginFill(0x71B095)
		graphics.drawCircle(0, 0, 4);
		graphics.endFill();
		
		graphics.beginFill(0x1A212C, 0.5)
		graphics.drawCircle(0, 0, _radius);
		graphics.endFill();
	}	
}