Forums  

Go Back   Forums > Talk > General FPP Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 04-16-2009, 09:09 AM
bober bober is offline
Junior Member
 
Join Date: Mar 2009
Posts: 20
Downloads: 0
Uploads: 0
Default Strange question about URLs :)

Well, the question is this: I have a tour located on some page of my site. While I am surfing through the tour, URL of the page remain same. So if I want to send link to certain panorama in the tour, I just can't do that.
I think a lot about it, but only solution Icould imagine is to make not a tour, but a pages with one pano on each and links that take you to anoyher page... A bit weird, I think Are there any other ways to do that?
And other question: I want to be able to begin tour from any pano depending on from what pade i do this. The simple way is to make several XML's with different "onStart", but it is weird too I use code like this:

Quote:
<script type="text/javascript">
var so = new SWFObject("hotel.swf", "pano", "100%", "100%", "9", "#40373a");
so.addVariable("xml_file","hotel2.xml");
so.addVariable("filepath", getQueryParamValue("filepath"));
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
window.document["pano"].focus();
</script>
to include pano to page, maybe I can add something there to change "onStart" on the fly?
Reply With Quote
  #2  
Old 04-16-2009, 09:35 AM
HansNyberg HansNyberg is offline
Senior Member
 
Join Date: Oct 2007
Posts: 611
Downloads: 0
Uploads: 0
Default

You can just duplicate your xml then change the initial pano and make a duplicate of your html with a new title and URL. Change the xml in this html

Here is an example.
Normal page http://www.panoramas.dk/kaloe-slot/index.html

Linked directly to pano 6 http://www.panoramas.dk/kaloe-slot/castle.html

Hans
Reply With Quote
  #3  
Old 04-16-2009, 09:44 AM
bober bober is offline
Junior Member
 
Join Date: Mar 2009
Posts: 20
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by HansNyberg View Post
You can just duplicate your xml then change the initial pano and make a duplicate of your html with a new title and URL. Change the xml in this html

Here is an example.
Normal page http://www.panoramas.dk/kaloe-slot/index.html

Linked directly to pano 6 http://www.panoramas.dk/kaloe-slot/castle.html

Hans
Maybe my English is not so good as I think, but upper I write that I already find this way If i can't find other ways, I'll use this, but as for me it looks like nail by a microscope An also, if after some time I'll want to change something in my tour I'll need to change all 30 XML's. Maybe you know how to do it using ExternalAPI ?
Reply With Quote
  #4  
Old 04-16-2009, 09:46 AM
allSaints's Avatar
allSaints allSaints is offline
Senior Member
 
Join Date: Aug 2008
Location: Stockholm, Sweden
Posts: 945
Downloads: 0
Uploads: 0
Default

Hi Bober,

as you are using javascript to embed your FPP pano, you can also use javascript to parse a parameter that contains the name of the starting pano:

example URL: http://domain_name.com/path/nam.html?startpano=hotel3


Code:
...
<script type="text/javascript">
var startPano = getParm("startpano");

var so = new SWFObject("hotel.swf", "pano", "100%", "100%", "9", "#40373a");
so.addVariable("panoName",startPano);
so.addVariable("xml_file","hotel.xml");
so.addVariable("filepath", getQueryParamValue("filepath"));
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
window.document["pano"].focus();

function getParm( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
</script>
...
So, by including the code above in your web page, you can choose your starting pano simply by changing the parameter in your url.

Regards,
Tommy
Reply With Quote
  #5  
Old 04-16-2009, 10:07 AM
bober bober is offline
Junior Member
 
Join Date: Mar 2009
Posts: 20
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by allSaints View Post
Hi Bober,

as you are using javascript to embed your FPP pano, you can also use javascript to parse a parameter that contains the name of the starting pano:

Regards,
Tommy
Thank you!!!!!!!!!
It works, and also it works as an answer to my first question, too !!!
Reply With Quote
  #6  
Old 04-16-2009, 07:05 PM
Nate Nate is offline
Senior Member
 
Join Date: Sep 2007
Posts: 112
Downloads: 0
Uploads: 0
Default

You could also use a query string in the url :
How to pass parameters to the player

Query string

Query string format is simple: player_name.swf?param1=value1&param2=value2&param3 =value3

Use player name (swf name), then question-mark "?", then all needed parameters divided by ampersand "&"

For example: http://www.flashpanoramas.com/player...=80&zoomHome=2. This gives a panorama from the simple tutorial with initial point of view in the sky (80 degrees above the horizon) with magnification (zoom factor is 2).

This gives you a possibility to run panoramas without any additional HTML or XML files.

It works as well for HTML code:

<PARAM NAME=movie VALUE="pano.swf?panoName=folder/mypano">
__________________
http://www.AlohaStateMedia.com
Reply With Quote
  #7  
Old 04-17-2009, 08:02 PM
bober bober is offline
Junior Member
 
Join Date: Mar 2009
Posts: 20
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by allSaints View Post
Hi Bober,

as you are using javascript to embed your FPP pano, you can also use javascript to parse a parameter that contains the name of the starting pano:

example URL: http://domain_name.com/path/nam.html?startpano=hotel3


Code:
...
<script type="text/javascript">
var startPano = getParm("startpano");

var so = new SWFObject("hotel.swf", "pano", "100%", "100%", "9", "#40373a");
so.addVariable("panoName",startPano);
so.addVariable("xml_file","hotel.xml");
so.addVariable("filepath", getQueryParamValue("filepath"));
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
window.document["pano"].focus();

function getParm( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
</script>
...
So, by including the code above in your web page, you can choose your starting pano simply by changing the parameter in your url.

Regards,
Tommy
And one another question: what changes are needed to make tour open on some panorama (for example, 11/12_cube) when there are no parameters? Now in this case i see "loading failed"...
Reply With Quote
  #8  
Old 04-17-2009, 10:32 PM
allSaints's Avatar
allSaints allSaints is offline
Senior Member
 
Join Date: Aug 2008
Location: Stockholm, Sweden
Posts: 945
Downloads: 0
Uploads: 0
Default

Well, bober

with a small change in the function getParm() you could set a default name if there are no parameters:

Code:
function getParm( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "default_pano_name";
  else
    return results[1];
}

Tommy
Reply With Quote
  #9  
Old 01-14-2011, 12:00 PM
davide73 davide73 is offline
Junior Member
 
Join Date: Dec 2010
Posts: 6
Downloads: 3
Uploads: 0
Default

Thanks Tommy for your code,
I used it to set not only the panoname but also pan, tilt and zoom of the first loaded pano.

Is there a way to pass other information to the player on startup, for example to execute a specific global.function related to the specific pano that is gonna be loaded?
I need for example to center the (great!) gpmap2 and sometimesto stop the autorotator directly from the link url.

What now works:
myDomain/index.html?startpano=mypano03&pan=90&tilt=17&zoom= 3

What I need: something like
myDomain/index.html?startpano=mypano03&pan=90&tilt=17&zoom= 3&autorotator=0&external.gpmap2.panto=myplace03&my Text.htmlText=myDescription03
or (better)
myDomain/index.html?startpano=mypano03&pan=90&tilt=17&zoom= 3&function=global.setup03

any idea?
thanksalot,
davide

p.s. I opened a thread here before the idea of replying here: sorry for crossposting

Last edited by davide73; 01-14-2011 at 01:31 PM.
Reply With Quote
  #10  
Old 01-14-2011, 01:48 PM
sachagriffin sachagriffin is offline
Senior Member
 
Join Date: Oct 2007
Posts: 211
Downloads: 1
Uploads: 0
Default

Pass your queries to your xml, and use a programming language to accept your queries and output your custom xml. asp or php will work fine.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 11:42 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.