I followed the preloader tutorial on this site and I got that all working then I followed the load image tutorial, now I was wondering if with this code could be altered so it loads an external swf file instead of an image, if so how do I edit it?
var imageLoader:Loader;
function loadImage(url:String):void {
preloader.visible = true;
imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
}
loadImage(“car.jpg”);
function imageLoaded(e:Event):void {
preloader.visible = false;
imageArea.addChild(imageLoader);
}
function imageLoading(e:ProgressEvent):void {
var loaded:Number = e.bytesLoaded / e.bytesTotal;
preloader.SetProgress(loaded);
}