Forums

Forums (http://flashpanoramas.com/forum/index.php)
-   General FPP Discussion (http://flashpanoramas.com/forum/forumdisplay.php?f=7)
-   -   Strange question about URLs :) (http://flashpanoramas.com/forum/showthread.php?t=2273)

bober 04-16-2009 09:09 AM

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?

HansNyberg 04-16-2009 09:35 AM

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

bober 04-16-2009 09:44 AM

Quote:

Originally Posted by HansNyberg (Post 12574)
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 ?

allSaints 04-16-2009 09:46 AM

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

bober 04-16-2009 10:07 AM

Quote:

Originally Posted by allSaints (Post 12577)
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 !!!

Nate 04-16-2009 07:05 PM

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">

bober 04-17-2009 08:02 PM

Quote:

Originally Posted by allSaints (Post 12577)
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"...

allSaints 04-17-2009 10:32 PM

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

davide73 01-14-2011 12:00 PM

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

sachagriffin 01-14-2011 01:48 PM

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.


All times are GMT. The time now is 08:14 AM.

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