![]() |
|
|
|
|
|
||||||||||
|
| User list | Rules | You are not logged in.
I am trying to call a javascript function when somebody clicks on a hotspot. PTP makes this easy enough, but I also want it to change which panorama is showing. PTP doesn't let you use more than one type of event for hotspots. So I am hoping there is a way to manually trigger the switch using javascript to call a function in the swf file. I know this is technically possible with JS and actionscript, but I wonder if PTP supports it.
Offline
Hello,
With the current version of Panotour Pro you cannot do this directly within PTP.
But yes, you are right, you can call some krpano actions from your JS script.
Here is the krpano documentation about this feature :
http://krpano.com/docu/js/
If you want to load a new panorama, instead of calling the standard krpano "loadpano" action, I suggest you to call our "mainloadpano" action. This action will do the call to "loadpano", but also will do some other calls to "close the objects" that may be opened in the current panorama.
Gérald
Offline
I think I need a little more help with this.
I've looked through the documentation and I can't seem to get javascript to successfully communicate with the tour swf file. I'm using Panotour Pro and I have a hotspot calling a javascript function. This part is successful. What I need to do is use javascript to switch the scene in the tour. All of the documentation refers to an xml file, which I do not have. When I build my tour using Panotour Pro, I only get a swf file, no xml. The documentation refers to droplets and things like that, which create xml files. I am not using any droplets, I am using the Panotour Pro application.
I even tried to simply copy the example on the javascript interface tutorial by changing the fov, here: http://krpano.com/docu/js/. But the fov doesn't change.
Any idea what I might be doing wrong?
My embed code is simply:
embedpano({target:"panoDIV",swf:"/condo2.swf", wmode: 'transparent'});And in the tour, I have a hotspot calling the javascript function switchscene('test')
That function is simply:
function switchscene(pano)
{
console.log(pano) //outputs 'test'
var krpano = document.getElementById("krpanoSWFObject");
console.log(krpano); //outputs the embed object
// this stuff doesn't work:
var fov = Number( krpano.get("view.fov") );
fov += 10.0;
krpano.set("view.fov", fov);
}Last edited by iamthejeff (2012-06-16 22:40:30)
Offline
iamthejeff wrote:
All of the documentation refers to an xml file, which I do not have. When I build my tour using Panotour Pro, I only get a swf file, no xml.
Are you using a fully licensed and registered version of PTP?
If so then you need to uncheck the Embed XML option in the Tour Build dialogue.
Offline
That did the trick. I have a bunch of xml files now. (Yes, I am registered and licensed)
So I should be able to call loadpano or loadmainpano and send it an xml file?
Is there a way to change how the generated xml files are named?
Offline
iamthejeff wrote:
Is there a way to change how the generated xml files are named?
I don't think so.
Offline
iamthejeff wrote:
So I should be able to call loadpano or loadmainpano and send it an xml file?
I know nothing of javascript useage but in his earlier post Gerald suggested:
"If you want to load a new panorama, instead of calling the standard krpano "loadpano" action, I suggest you to call our "mainloadpano" action. This action will do the call to "loadpano", but also will do some other calls to "close the objects" that may be opened in the current panorama.
Offline
Thanks. I got it working. I had to also set a restricted web domain in the build settings.
Offline
iamthejeff wrote:
Thanks. I got it working. I had to also set a restricted web domain in the build settings.
Ah, yes.
Do you have anything on line to demonstrate your javascript stuff?
Offline
Nothing online yet, no. I can post an example later next week though.
Offline
Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
|
CHOOSING KOLOR Why choose Kolor? Which solution to choose? Download a trial Where can I buy? Education |
SOFTWARE Autopano Pro Autopano Giga Panotour Panotour Pro XnView |
ACCESSORIES Training DVD Panobook PROJECTS Paris 26 Gigapixels Yosemite 17 Gigapixels |
COMMUNITY Forums YouTube channel Google+ |
COMPANY Blog About Kolor Resellers Contact Visit us |
PRESS Press center Press review TOOLS My account |
