forked from: microstock theft engine
/**
* Copyright wh0 ( http://wonderfl.net/user/wh0 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/hm53
*/
package {
import mx.utils.Base64Decoder;
import flash.display.*;
import flash.events.*;
import flash.system.*;
import flash.filters.*;
import flash.net.*;
import flash.media.*;
[SWF(width=380, height=216)]
public class MSTE extends Sprite {
private static const CONTEXT:LoaderContext = new LoaderContext(true);
private var qty:int = 0;
private var src:Video;
private var sf:ShaderFilter;
private var ns:NetStream;
public function MSTE() {
stage.scaleMode = StageScaleMode.NO_SCALE;
var nc:NetConnection = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, loop);
ns.play('http://www.istockphoto.com/video_passthrough.php/11662685/65/11662685.flv');
//ns.play('http://www.istockphoto.com/video_passthrough.php/12194254/65/12194254.flv');
src = new Video(380, 216);
src.attachNetStream(ns);
var ll:Loader = new Loader();
ll.contentLoaderInfo.addEventListener(Event.COMPLETE, loGet);
ll.load(new URLRequest('http://assets.wonderfl.net/images/related_images/9/9f/9fde/9fde781cea66f12057a884e1e67a6c79dd605c28'), CONTEXT);
var hl:Loader = new Loader();
hl.contentLoaderInfo.addEventListener(Event.COMPLETE, hiGet);
hl.load(new URLRequest('http://assets.wonderfl.net/images/related_images/e/ed/ed00/ed007fbcbba77a94c3fed31bf7c35156652d3150'), CONTEXT);
var d:Base64Decoder = new Base64Decoder();
d.decode('oQECAAAMX091dENvb3JkAKEBAgQADGQAowAEc3JjAKMBBGxvAKMCBGhpAKECBAEAD2RzdAAdBQDBAAAQAAIFAMEEABAAMAEA8QAAEAAwAgDxBQAQATADAPEFABACAgEA4gIAGAACAwDiAgAYAAUBAOIDABgA');
sf = new ShaderFilter(new Shader(d.toByteArray()));
sf.shader.data.d.value = [0, 0];
}
private function loop(x:*):void {
if (x.info.code == 'NetStream.Play.Stop')
ns.seek(0);
}
private function loGet(e:Event):void {
sf.shader.data.lo.input = e.target.content.bitmapData;
if (++qty == 2)
done();
}
private function hiGet(e:Event):void {
sf.shader.data.hi.input = e.target.content.bitmapData;
if (++qty == 2)
done();
}
private function done():void {
src.filters = [sf];
addChild(src);
}
}
}