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

Distorted Sex Transmissions

Distorted Sex Transmissions
By Ctrl
Video From www.Soho.com.co
/**
 * Copyright Ctrl ( http://wonderfl.net/user/Ctrl )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/AmPE
 */

//Distorted Sex Transmissions
//By Ctrl
//Video From www.Soho.com.co

package
{
	import flash.display.*;
	import flash.events.*;
	import flash.media.*;
	import flash.net.*;
	
	[SWF(width="465", height="465", frameRate="30", backgroundColor="0x000000")]
	
	public class DSTransmissions extends Sprite
	{
		private var nc:NetConnection;
		private var video:Video;
		private var ns:NetStream;		
		private var bmp0:BitmapData;
		private var ant:BitmapData;
		private var bmp1:BitmapData;
		private var bmp2:BitmapData;
		private var bmp3:Bitmap;
		private var ppv:Boolean = true;
		
		public function DSTransmissions()
		{		
			graphics.beginFill(0x000000);
			graphics.drawRect(0, 0, 465, 465);
			Wonderfl.capture_delay(19);
			video = new Video(465,465);
			
			x = 465
			alpha = .2;
			rotationY = 180;
			getDiff();
			
			nc = new NetConnection();
			
			nc.connect(null);
			
			ns = new NetStream(nc);
			ns.addEventListener(NetStatusEvent.NET_STATUS,onStatusEvent)
			
			var meta:Object = new Object();
			
			meta.onMetaData=function(meta:Object):void{
			}
			
			ns.client = meta;
			
			video.attachNetStream(ns);
			
			ns.checkPolicyFile = true;
			
			ns.play("http://www.soho.com.co/media/md_259/Media-259_20091117_105907_High.flv");
			
			
			stage.addEventListener(MouseEvent.CLICK, changeMe);
		}
		
		private function changeMe(e:MouseEvent):void
		{
			if(ppv)
			{
				removeEventListener(Event.ENTER_FRAME, render);
				addChild(video);
				ppv = false;
				alpha = 1;
				ns.pause();
			}
			else if(!ppv)
			{
				addEventListener(Event.ENTER_FRAME, render);
				removeChild(video);
				ppv = true;
				alpha = .2;
				ns.resume();
			}
		}
		
		private function getDiff():void
		{
			bmp0 = new BitmapData(465, 465);
			bmp0.draw(video);
			ant = BitmapData(bmp0);
			addEventListener(Event.ENTER_FRAME, render);
			
			return;
		}
		
		private function repeat():void
		{
			ns.play("http://www.soho.com.co/media/md_259/Media-259_20091117_105907_High.flv");
		}
		
		private function onStatusEvent(stat:Object):void
		{
			if(stat.info.code=="NetStream.Play.Stop"){
				repeat();		
			}
		}
		
		private function render(param1:Event) : void
		{
			
			if (numChildren > 2)
			{
				removeChildAt(0);
			}
			bmp1 = new BitmapData(465, 465);
			bmp1.draw(video);
			if (bmp1.compare(ant) != 0)
			{
				bmp2 = BitmapData(bmp1.compare(ant));
				bmp3 = new Bitmap(bmp2);
				addChild(bmp3);
				ant = bmp1;
			}
			return;
			removeEventListener(Event.ENTER_FRAME, render);
		}
	}
}