Scratches: Monica Fonseca
Monica Fonseca
By Ctrl
March 2010
Inspired By: http://www.soho.com.co/wf_InfoGaleriasMujeres.aspx?IdGal=550
/**
* Copyright Ctrl ( http://wonderfl.net/user/Ctrl )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/8LFJ
*/
// Monica Fonseca
// By Ctrl
// March 2010
// Inspired By: http://www.soho.com.co/wf_InfoGaleriasMujeres.aspx?IdGal=550
package
{
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
[SWF(frameRate="3")]
public class MonicaFonseca extends Sprite
{
private var url2:String = "http://www.soho.com.co/upload/images/2009/2/10/17575_142752_7.jpg";
private var url4:String = "http://www.soho.com.co/upload/images/2009/2/10/17576_142752_7.jpg";
private var url5:String = "http://www.soho.com.co/upload/images/2009/2/10/17577_142752_7.jpg";
private var loader:Loader;
private var loader2:Loader = new Loader();
public function MonicaFonseca()
{
loader2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadPic2);
loader2.load(new URLRequest(url2));
addChild(loader2);
loader = new Loader();
addChild(loader);
}
private function loadPic2(e:Event):void
{
loader2.contentLoaderInfo.removeEventListener(Event.COMPLETE, loadPic2);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadPic3);
loader.load(new URLRequest(url4));
}
private function loadPic3(e:Event):void
{
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, loadPic3);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, startLoop);
loader.load(new URLRequest(url5));
}
private function startLoop(e:Event):void
{
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, startLoop);
addEventListener(Event.ENTER_FRAME, loop);
}
private function loop(e:Event):void
{
loader.unloadAndStop();
var num:Number = Math.ceil(Math.random()*3-1);
var arr:Array = [url2, url4, url5];
loader.load(new URLRequest(arr[num]));
}
}
}