Flash API (Pano2VR) From Garden Gnome Softw are (Redirected from Pano2VR - Flash API) Jump to: navigation, search To embed the pano, please use the following code: Contents [hide] 1 Loading the Panorama o 1.1 Actionscript 3.0 o 1.2 Actionscript 2.0 2 Panorama API calls o 2.1 Changing the view o 2.2 Changing the panorama window o 2.3 Hotspots o 2.4 Video o 2.5 Others 3 Change the default Hotspot handler o 3.1 Actionscript 3.0 o 3.2 Actionscript 2.0 Loading the Panorama Actionscript 3.0 import flash.display.*; import flash.net.URLRequest; import flash.events.Event; var loader:Loader = new Loader(); var url:String = "panorama.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.x=50; vr.y=50; vr.pano.setWindowSize(400,300); } } // 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 If you like to rem...