The following example displays the gpUrlLoader Class with an option to load an swf file. Add the event listener, then call the init method with the url and the load type.
I also added a progress and Load Error Listener. With the Progress Listener, you can track bytesLoaded and bytesTotal.
var ldr:gpUrlLoader = new gpUrlLoader();
ldr.addEventListener(Event.COMPLETE, swfLoaded);
ldr.addEventListener(ProgressEvent.PROGRESS, onProgress);
ldr.addEventListener(gpUrlLoader.LOADERROR, ioError);
ldr.init('joneil.jpg', 'swf');
function swfLoaded(event:Event):void {
var swf:Loader = image.getSWF();
addChild(swf);
}
function onProgress(event:Event):void {
trace(ldr.urlLoader.bytesLoaded);
}
function ioError(e:Event):void {
trace('Error loading file');
}
For documentation about the gpUrlLoader AS3 Class, view the blog post.