When running this code:init panorama player...
initHandler: [Event type="init" bubbles=false cancelable=false eventPhase=2]
TypeError: Error #1010: A term is undefined and has no properties.
at vr2_fla::MainTimeline/finished_loading()
Code: Select all
var loader:Loader;
loader = new Loader();
var url:String = "vrs/Scene_A.swf";
var urlReq:URLRequest = new URLRequest(url);
// This is done after the swf is loaded.
function finished_loading (e:Event) {
vr.pano.onClickQtHotspot=function(id:Number,title:String,url:String,target:String)
{
// add your code here!
trace(id + "," + title);
}
}
function initHandler(event:Event):void {
trace("initHandler: " + event);
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);
}
}
// 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);
vr.addChild(loader); // add your swf directly to the stage