I think I don't have the code right. This is what I have-
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
var loader:Loader;
loader = new Loader();
var url:String = "
http://www.photosynergy.net/hannesbecker/livingroom.swf";
var urlReq:URLRequest = new URLRequest(url);
var vr:MovieClip; // panorama movieclip
// This is done after the swf is loaded.
function finished_loading (e:Event) {
}
function initHandler(event:Event):void {
trace("initHandler: " + event);
vr = MovieClip(loader.content); // cast 'DisplayObject' to 'MovieClip'
vr.isFlash10=false; // Disable Flash 10 rendering if the container is Flash 9
}
function initPanorama(e:Event) {
// check if the panorama object is available and initialize it
if ((vr!=null) && (vr.pano!=null)) {
removeEventListener( Event.ENTER_FRAME , initPanorama);
vr.pano.setWindowSize(800,480); // resize the window
vr.pano.setWindowPos(200,200); // reposition
}
}
// call initPanorama every frame
addEventListener( Event.ENTER_FRAME , initPanorama);
// Tell the loader to call 'finished_loading' after the swf is loaded.
loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, finished_loading);
// Tell the loader to call 'initHandler' after the swf is initialized.
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.load(urlReq);
addChild(loader); // add your swf directly to the stage
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
function loop(e:ProgressEvent):void {
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString();
LoadIndicator.width = perc * 800; // my loadindicator is 400 pixels wide at 100%
}
All I get is a white screen