Hey, I am trying out your Pano2VR software and want to integrate some panoramas into an AS3 Flash file. The code works fine when it is not in a packaged class, but when I put it in the class, I get a whole bunch of errors. Here is my current code:
package com.vs.pano{
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
var loader:Loader;
var urlReq:URLRequest
var vr:MovieClip;
class pano {
loader = new Loader();
var url:String = "data/1/pan/base.swf";
urlReq = new URLRequest(url);
// 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.pano.setWindowSize(200,100);
}
// Tell the loader to call 'finished_loading' after the swf is loaded.
loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, finished_loading);
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.load(urlReq);
addChild(loader);// add your swf directly to the stage
}
}
I have used your Pano2QTVR for many years and will likely buy this software if I can get this class working.
package com.vs.pano{
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;
public class pano extends MovieClip {
public function pano() {
var loader:Loader;
loader = new Loader();
var url:String = "URL HERE";
var urlReq:URLRequest = new URLRequest(url);
var vr: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.pano.setWindowSize(200,100);
}
// Tell the loader to call 'finished_loading' after the swf is loaded.
loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, finished_loading);
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.load(urlReq);
addChild(loader);// add your swf directly to the stage
}
}
}