package {
import flash.display.Sprite;
import flash.utils.ByteArray;
import flash.display.Loader;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLLoaderDataFormat;
import flash.geom.Rectangle;
import flash.events.Event;
public class Main extends Sprite {
private var urlLoader:URLLoader = new URLLoader();
public function Main() {
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.load(new URLRequest("http://www.rntsoft.com/image2.jpg"));
urlLoader.addEventListener(Event.COMPLETE, completeHandler);
}
private function completeHandler(event:Event):void {
var loader:Loader = new Loader();
loader.loadBytes(urlLoader.data);
addChild(loader);
}
}
}