PDA

View Full Version : Embed pano with cylConverter?


Kahlil
07-21-2008, 04:32 PM
:confused::confused::confused:
Any help would be greatly appreciated :)
Being a noob I am having a bit of coding trouble!
I have a cylinder tour that works fine but now I am trying to embed it in the embed pano file. The embed pano flash actionscript deals with the cube face files nature that comes with the example. How do I change the actionscript so my tours work in cylinder file..
I have to get a preview of a navigated tour ready for central connecticut state university as soon as I can so I can continue to build and make better acceptable tours.
here is the pano
http://www.dimensionalconcepts.us/welte_test/welte.html
here is the embed pano which is failing
http://www.dimensionalconcepts.us/welte_test/embedPano.html

here is my actionscript in the fla file
it is probably really off



var panorama:MovieClip;
var loader:Loader = new Loader();
loader.load(new URLRequest("welte.swf"));
addChild(loader);

loader.contentLoaderInfo.addEventListener(Event.CO MPLETE,loadComplete);

function loadComplete (e:Event) {
swapChildren(loader,border);
panorama = loader.content;
panorama.setArea(100,50,400,300);

panorama.loadPanorama("pano.swf?panoName=welte");

//Variants:
//panorama.loadPanorama("pano.swf?panoName=images/snow"); //load images/snow pano, old syntax
//panorama.loadPanorama("panoName=images/snow&segments=10&pan=100"); //load images/snow with custom params
//panorama.loadPanorama("panoName=images/snow&xml_file=&"); //load images/snow without myPano.xml file
//panorama.loadPanorama("panoName=images/snow&xml_file=my.xml"); //load images/snow with custom xml file
//panorama.loadPanorama("xml_file=my.xml"); //load xml file (panoname within)
//panorama.loadPanorama("panoName=images/snow&layer_1=files/menuFullscreen.swf"); //load menuFullscreen plugin

//panorama.loadPanorama("xml_text="+xml_1); //load with predefined XML data

left_btn.addEventListener(MouseEvent.MOUSE_DOWN, doLeft);
right_btn.addEventListener(MouseEvent.MOUSE_DOWN, doRight);
up_btn.addEventListener(MouseEvent.MOUSE_DOWN,doUp );
down_btn.addEventListener(MouseEvent.MOUSE_DOWN,do Down);
stage.addEventListener(MouseEvent.MOUSE_UP, reset);

pano1_btn.addEventListener(MouseEvent.CLICK, doPano1);
pano2_btn.addEventListener(MouseEvent.CLICK,doPano 2);
}

// you can store XML's for panoramas directly in code:
var xml_1:XML =
<panorama>
<parameters>
panoType = cylinder
loaderText =
layer_1 = cylConverter.swf
layer_2 = glassMeter.swf
layer_3 = limits.swf
layer_4 = cylConverter.swf
</parameters>
</panorama>;

function doLeft (e:Event) {
panorama.pano.panKey = -1;
}
function doRight (e:Event) {
panorama.pano.panKey = 1;
}
function doUp (e:Event) {
panorama.pano.tiltKey = 1;
}
function doDown (e:Event) {
panorama.pano.tiltKey = -1;
}
function reset (e:Event) {
panorama.pano.panKey = 0;
panorama.pano.tiltKey = 0;
}
function doPano1 (e:Event) {
if (panorama.pano.loadCompleted) {
// if Hotspots plugin is present, use hotspots.loadPano()
// change panorama manually otherwise
// this allows to avoid problems with Hotspots controller
if (panorama.externals.hotspots!=null) {
panorama.externals.hotspots.loadPano(["pano.swf?panoName=welte"]);
} else {
panorama.pano.remove();
panorama.loadPanorama("pano.swf?panoName=welte");
}
}
}
function doPano2 (e:Event) {
if (panorama.pano.loadCompleted) {
if (panorama.externals.hotspots!=null) {
panorama.externals.hotspots.loadPano(["pano.swf?panoName=welte"]);
} else {
panorama.pano.remove();
panorama.loadPanorama("pano.swf?panoName=welte");
}
}
}

Rob
07-21-2008, 06:08 PM
Hi Kahlil,

Im still pretty n00b at all this but have had some success with the embed pano and might be able to spot a few issues for you.

After looking at your code & cross ref'ing with mine i see the following as possible issues:



1. loader.load(new URLRequest("welte.swf"));
should relate to the raw, out of the box pano.swf file

2. panorama.loadPanorama("pano.swf?panoName=welte");
Should be more like this: pano.swf?panoName=panos/YOUR_PANO_FILE_NAME&xml_file=YOUR_XML_FILE.xml

3. panorama.externals.hotspots.loadPano(["pano.swf?panoName=welte"]);
Should be more like this: pano.swf?panoName=panos/YOUR_PANO_FILE_NAME&xml_file=YOUR_XML_FILE.xml

4. panorama.loadPanorama("pano.swf?panoName=welte");
Should be more like this: pano.swf?panoName=panos/YOUR_OTHER_PANO_FILE_NAME&xml_file=YOUR_XML_FILE.xml

Also adding this below your code will help the fullscreen issues you might run into:
function doFullscreen (e:Event) {
if (stage.hasOwnProperty("displayState")) {
if (stage.displayState == StageDisplayState.FULL_SCREEN) {
stage.displayState = StageDisplayState.NORMAL;
} else {
stage.displayState = StageDisplayState.FULL_SCREEN;
}
}
}
function fullscreenHandler (e:FullScreenEvent) {
if (e.fullScreen) {
left_btn.visible = right_btn.visible = up_btn.visible = down_btn.visible = false;
pano1_btn.visible = pano2_btn.visible = border.visible = theMask.visible = false;
panorama.setArea(0,0,stage.stageWidth,stage.stageH eight);
panorama.mask = null;
full_btn.x = stage.stageWidth-22;
full_btn.y = 22;
} else {
left_btn.visible = right_btn.visible = up_btn.visible = down_btn.visible = true;
pano1_btn.visible = pano2_btn.visible = border.visible = true;
panorama.setArea(78,50,700,300);
panorama.mask = theMask;
full_btn.x = 737.3;
full_btn.y = 72;
}
}


I would suggest looking at Patrick's Great tutorial (http://flashpanos.com/tutorials/patrick/embedding-fpp-panoramas-another-flash-container) it helped me out no end, the guy is a guru ;)

Kahlil
07-22-2008, 03:23 PM
Rob thanks alot :)
I am going to give this a try. I hopefully will be working with cube faces in the future but for now my gear is limited and I need to "Fake it till I make it" so the university will upgrade my equipment. Untill then I have to work with these cylinder panos.

Kahlil
07-22-2008, 05:41 PM
:)

Thanks again Rob it worked.

Thats brings you one step away from n00b in my book.

Kahlil
07-22-2008, 07:40 PM
ok I figured this out
now time to go get a flash book.....
http://www.dimensionalconcepts.us/welte_test/embedPano.html

Rob
07-24-2008, 04:16 PM
Glad I could help Kahlil :)