How i can send command from HTTP (javascript) to KRPano for load new XML file and load other panorama?
krpano new user
Did you get a look at that page ? http://www.krpano.com/docu/html/ it might help you if you didn't get a look at it !
Vincèn
http://www.skivr.com
Hmm... That link shows how to embed your krpano presentation in a Web page, but not how to communicate from the Web page to krpano.
This page http://www.krpano.com/docu/js/ is probably what would help, but isn't complete yet.
In any case, I'm guessing ExternalInterface?
Patrick Cheatham Forum Administrator
Hi,
krpano exports this 3 functions:
with the get/set functions you can change any of the varaibles listed here:
http://krpano.com/docu/api/
and with the call function you can call this actions: (one or more)
http://krpano.com/docu/actions/
to access it from Javascript:
the second parameter in this line is the name of the krpano object (krpanoSWFObject)
to make a call now, get this object, and for example call a function:
that's it
here some examples:
to load and blend in 1 second:
to zoom in, and load a other image, blend and zoom out
or to set the field of view to 120 degree and disable the fisheye effect: (special case - to update the view immediately, you must set(update,view))
to look to a given position, wait 1 second, and then move to the next position
it's also possible to the call a javascript function from krpano, e.g.
krpano.xml:
html/js file:
best regards, Klaus
not worked
i write this
...
var krpano1 = document.getElementById("krpanoSWFObject"); krpano1.call("loadpano(p02.xml);"); } </SCRIPT>
....
<p><a href="javascript:loadpanoto()"><img src="pict/b1.jpg"/></a></p>
AND NOT WORKED!
i tested it
alert(document.getElementById("krpanoSWFObject")); var krpano1 = document.getElementById("krpanoSWFObject"); alert (krpano1); krpano1.set("view.fov", "120");
alert("FINE");
}
return messages
1. [object HTMLEmbedElement] 2. [object HTMLEmbedElement] 3. -> nothng!!!!
after krpano1.set("view.fov", "120"); is java aborted? not send message FINE
one question - where do you test it - on a server or locally?
when testing locally - the flash security settings needed to be changed to allow javascript access.
to change the settings have a look at here:
http://krpano.com/docu/localaccess/
you can check this by pressing the 'O'-key in the panorama:
if there is the message: "WARNING: not local trusted - ExternalInterface disabled!"
then you need to change the security settings or test it on a server (e.g. localhost or on the web)
regards, Klaus
My local folder trusted for flash.
I press O and not see message - "WARNING: not local trusted - ExternalInterface disabled!"
I can see krpano flash, work with him, click to hotspot and load other panoramas (xml)
BUT SCRIPT NOT WORKED!
Can you see me worked web page for exemple in Internet? Please.
hmm... interesting, which browser do you use?
here some examples from my site:
http://krpano.com/examples/javascript1/
http://krpano.com/examples/javascript2/
http://krpano.com/examples/javascript3/
the first example loads a other pano on click on the thumbs (loading with blending/zooming with the links on the right side)
the second examples shows how to move in the pano, and how to get values from it
and the third show hot to show a html element over the flash (but this doesn't work in Opera, which doesn't supports html over flash)
Thank you Klaus!!!
Java script is working!!!!
Your examples are very easy for studying
Did you get a look at that
Did you get a look at that page ? http://www.krpano.com/docu/html/ it might help you if you didn't get a look at it !
Vincèn
http://www.skivr.com
re: send command from HTML to krpano
Hmm... That link shows how to embed your krpano presentation in a Web page, but not how to communicate from the Web page to krpano.
This page http://www.krpano.com/docu/js/ is probably what would help, but isn't complete yet.
In any case, I'm guessing ExternalInterface?
Patrick Cheatham
Forum Administrator
HR1 wrote: How i can send
How i can send command from HTTP (javascript) to KRPano for load new XML file and load other panorama?
Hi,
krpano exports this 3 functions:
get(varible) ... returns the value of a variable
call(action) ... calls a action
with the get/set functions you can change any of the varaibles
listed here:
http://krpano.com/docu/api/
and with the call function you can call this actions: (one or more)
http://krpano.com/docu/actions/
to access it from Javascript:
the second parameter in this line is the name of the krpano object (krpanoSWFObject)
to make a call now, get this object, and for example call a function:
krpano.call("loadpano(nextpano.xml);");
that's it
here some examples:
to load and blend in 1 second:
to zoom in, and load a other image, blend and zoom out
or to set the field of view to 120 degree and disable the fisheye effect:
(special case - to update the view immediately, you must set(update,view))
krpano.set("view.fisheye", "0");
krpano.set("update", "view");
to look to a given position, wait 1 second, and then move to the next position
it's also possible to the call a javascript function from krpano,
e.g.
krpano.xml:
<plugin name="button" url="button.png" onclick="js(jstest());" ... />
...
html/js file:
function jstest()
{
alert("hello from krpano");
}
...
best regards,
Klaus
not worked
not worked
i write this
...
function loadpanoto () {
var krpano1 = document.getElementById("krpanoSWFObject");
krpano1.call("loadpano(p02.xml);");
}
</SCRIPT>
...
<noscript>
...
</noscript>
</div>
...
// <![CDATA[
if (typeof(deconcept) !== 'undefined' && deconcept.SWFObjectUtil.getPlayerVersion().major >= 6)
{
var so = new SWFObject("../pano/krpano.swf", "krpanoSWFObject", "100%", "350", "9.0.28","#000000");
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.addVariable("pano", "p01.xml");
so.useExpressInstall('../swfobject/expressinstall.swf');
so.setAttribute('xiRedirectUrl', window.location);
if ( so.write("krpanoframe") ) { var macmousewheel = new SWFMacMouseWheel(so); }
}
else
{
.....}
// ]]>
</script>
....
<p><a href="javascript:loadpanoto()"><img src="pict/b1.jpg"/></a></p>AND NOT WORKED!
krpano new user
test
i tested it
alert(document.getElementById("krpanoSWFObject"));
var krpano1 = document.getElementById("krpanoSWFObject");
alert (krpano1);
krpano1.set("view.fov", "120");
alert("FINE");
}
return messages
1. [object HTMLEmbedElement]
2. [object HTMLEmbedElement]
3. -> nothng!!!!
after
krpano1.set("view.fov", "120");
is java aborted? not send message FINE
krpano new user
Hi, one question - where do
Hi,
one question - where do you test it - on a server or locally?
when testing locally - the flash security settings needed to be changed to allow javascript access.
to change the settings have a look at here:
http://krpano.com/docu/localaccess/
you can check this by pressing the 'O'-key in the panorama:
if there is the message:
"WARNING: not local trusted - ExternalInterface disabled!"
then you need to change the security settings or test it on a server (e.g. localhost or on the web)
regards,
Klaus
trusted folders
My local folder trusted for flash.
I press O and not see message - "WARNING: not local trusted - ExternalInterface disabled!"
I can see krpano flash, work with him, click to hotspot and load other panoramas (xml)
BUT SCRIPT NOT WORKED!
Can you see me worked web page for exemple in Internet? Please.
krpano new user
hmm... interesting, which
hmm... interesting, which browser do you use?
here some examples from my site:
http://krpano.com/examples/javascript1/
http://krpano.com/examples/javascript2/
http://krpano.com/examples/javascript3/
the first example loads a other pano on click on the thumbs
(loading with blending/zooming with the links on the right side)
the second examples shows how to move in the pano, and how to get values from it
and the third show hot to show a html element over the flash (but this doesn't work in Opera, which doesn't supports html over flash)
best regards,
Klaus
YES!!! Java script is working!!!
Thank you Klaus!!!
Java script is working!!!!
Your examples are very easy for studying
krpano new user