PDA

View Full Version : HTML Text Links to jump to specific panorama in tour?


vhs
04-01-2009, 09:53 AM
Can I create a HTML text link that jumps to a certain panorama within my panorama tour? I didn't find an example or parameter to do that.

Thanks.

jordi
04-01-2009, 09:56 AM
I think what you need you will find it here (http://flashpanoramas.com/blog/2007/05/23/add-some-life-to-panoramas/)

from there you can link to some external text, which will give an action to the pano

vhs
04-01-2009, 07:52 PM
I didn't find what you're referring to but if I understood you right you thought of linkink from the panorama to en external text (via hotspot)?

Maybe I wasn't precise enough. I meant I have e.g. a panorama tour on page panorama.php and I want to call a certain panorama within the tour via a text link.

Let's say I have a tour with 3 panoramas: Kitchen, Garden & Bedroom. When I just load panorama.php I get the tour which starts in the Kitchen by default.

Can I have a link similar to this: panorama.php?panorama=Garden to start the panorama tour in the Garden for example?


Cheers

izoneguy
04-01-2009, 11:08 PM
I think the easiest thing to do is to create different html pages.
Have each page reference a different xml.

Then have a main html page that references the individual html pages.

Trying to write javascript that references the internal xml can be done
but it gets very complicated.

allSaints
04-02-2009, 07:27 AM
Trying to write javascript that references the internal xml can be done
but it gets very complicated.

But isn't that exactly what the page in the link above does?

Tommy

izoneguy
04-02-2009, 01:46 PM
Hmmm I guess so!!
I never really looked at it before - This is useful and would be a good tutorial someone could write up.

<h2>Add some life to panoramas</h2>
<div id="flashpost20"><em>You need the Flash Player to view this content.</em></div>
<p><script type="text/javascript">/*
<pre><!--*/var so = new SWFObject("/player/examples/files/show_pano.swf", "movie20", 580, 420, "6.0.65", "#FFFFFF");so.addParam("allowFullScreen","true");so.addParam("allowScriptAccess","sameDomain");so.addParam("base","/player/examples/");so.addVariable("movie","files/pano.swf?xml_file=livePano.xml");so.addVariable("redirect", window.location);so.write("flashpost20");
function checkPano20() {
if (window.document.movie20==null) {
alert("Update your Flash Player plugin.");return false;
}
if (window.document.movie20.livePanoExecute==null) {
alert("Load the panorama at firts.");return false;
}
return true;
}
function showClock() {
if (!checkPano20()) return;
window.document.movie20.livePanoExecute("pano.qualityStatic=low;pano.pan=-15.9,2000,elastic;pano.tilt=6.4,3000,elastic;pano. zoom=2.5,1000,-,restoreQuality;")
}
function showCamera() {
if (!checkPano20()) return;
window.document.movie20.livePanoExecute("vid.url=images/camera.swf")
}
function hideCamera() {
if (!checkPano20()) return;
window.document.movie20.livePanoExecute("vid.url=images/abeauty.swf")
}
function showVideo() {
if (!checkPano20()) return;
window.document.movie20.livePanoExecute("pano.qualityStatic=low;pano.pan=31.9,3000,elastic; pano.tilt=-10,1000;pano.zoom=1.5,1000,smooth,restoreQuality;")
}
function showPhotos() {
if (!checkPano20()) return;
window.document.movie20.livePanoExecute("pano.qualityStatic=low;pano.pan=-55,4000,elastic;pano.tilt=-30,2100,elastic;pano.zoom=1,2000,elastic,restoreQu ality;")
}

allSaints
04-02-2009, 02:22 PM
Yes izoneguy,
and I have actually used it a couple of times.

It is called the ExternalInterface API and is in fact included in the FPP documentation:

ExternalInterface provides the possibility to control Flash Panorama Player from any other Flash application on the same HTML page (inside or outside the panorama application) or using Javascript commands.

Regards,
Tommy

izoneguy
04-02-2009, 03:22 PM
Yes I have seen that used a few times - But for us non-programming types it is not easier to do. I have worked with some examples but I have not the brain power to figure it out.

vhs
04-03-2009, 12:06 AM
I'm not really good in JS and I tried to make it work with the External API before but without success. I didn't find an example that does what I try to do or did I oversee it?

I reckon I need a function that loads a different panorama on call.
Because I need 2 slightly different things, this function needs either to be called on page load with JS (I take a GET var with PHP and then write it into the JS function?) or I call the function by HTML text link.

I have a client (accommodation) who has a tour. The tour should be embedded into his website but he has 4 different room types = 4 different webpages. In the tour they're connected of course but on each room page the panorama should start with the selected room. Basically changing the default/start panorama of the tour. And I'd like to avoid 4 different XML config files...

Does anyone have an example for me?

Cheers

vhs
04-03-2009, 04:59 AM
I finally have a working link to load another panorama. This is my link:

<a href="javascript:window.document.pano.myidPanoExecute('l oadPano(panoName=files/visualFiles/Hotel_Room2&amp;zoom=-20);')">Room 2</a>

What I now try to figure out is if I can override the XML file with an URL parameter. (Later I want to pass the panorama name via URL and PHP to JS)
This attempt didn't work so far:


...
var so = new SWFObject("panorama.swf?xml_file=/panorama/files/xml/controller.xml&zoom=-2&panoName=panorama/files/visualFiles/Conference_Room", "pano", "100%", "100%", "10", "#282828");
...

The panoName= parameter is being ignored.

vhs
04-06-2009, 07:45 PM
Nothing? Is there no way to override the default/starting panorama in a tour (on page load) that is defined in the XML?

Regards

vhs
04-07-2009, 09:02 PM
I'm almost there but i can use a little help. I think it's my bad Javascript that doesn't address the right object/id.
Now I just put some JS at the end of the page that gets executed after the panorama has been loaded with the default XML config.

document.getElementById('pano').myidPanoExecute('l oadPano(panoName=panorama/accommodation/files/visualFiles/Room2&zoom=-21');

But then I get an error: document.getElementById("pano").myidPanoExecute is not a function

However I put an alert right in front of the code to find out if the object is there...and after I close the alert with OK the script gets executed fine but not without the alert?!
I reckon there's some addressing error in this part: .myidPanoExecute('loadPano...

In the global tag in the XML the ID is set to "myid"

Cheers

bober
04-16-2009, 09:10 AM
I think that answer in my topic will be useful for you, too :)
http://flashpanoramas.com/forum/showthread.php?t=2273