You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

jophine

Beginner

  • "jophine" started this thread

Posts: 10

Location: India

Occupation: Developer

  • Send private message

1

Monday, September 24th 2012, 2:25pm

on load complete event on javascript class

Hi,

how can i access
--- in xml ---
" <events onloadcomplete='hideprogressbar();'/> "

in javascript class
krpano().set("events.onloadcomplete", hideprogressbar);

but i could not able to get the event

if my code is wrong then plz help me solve the issue with the complete simple sample file.

2

Thursday, September 27th 2012, 9:27am

Hi,

what exactly are you trying to do?
a js plugin for the html5 viewer?
using the js-interface and try to set a xml function?
or do you try to set a call back to js?

best regards,
Klaus

jophine

Beginner

  • "jophine" started this thread

Posts: 10

Location: India

Occupation: Developer

  • Send private message

3

Thursday, September 27th 2012, 12:35pm

trying to do "using the js-interface and try to set a xml function?

and "try to set a call back to js? "


regards

Jophine

4

Friday, September 28th 2012, 1:24pm

Hi,
and "try to set a call back to js? "
xml:

Source code

1
<events onloadcomplete='js( your_js_function() );'/> "


html/js:

Source code

1
2
3
4
function  your_js_function()
{
  ...
}



trying to do "using the js-interface and try to set a xml function?
html/js:

Source code

1
krpano().set("events.onloadcomplete", "hideprogressbar()");


best regards,
Klaus

jophine

Beginner

  • "jophine" started this thread

Posts: 10

Location: India

Occupation: Developer

  • Send private message

5

Thursday, October 4th 2012, 8:40am

Thank you very much
now i got the concept and implemented in my project and is working fine

once again thank you *smile* *smile* *smile* *smile*

jophine

Beginner

  • "jophine" started this thread

Posts: 10

Location: India

Occupation: Developer

  • Send private message

6

Friday, October 5th 2012, 2:10pm

all images are loaded and viewable event

How can we get a even to javascript class where all images are loaded on the stage if i mentioned in xml
<events onmousedown="set(syncother,true);" onmousewheel="events.onmousedown();" onloadcomplete="events.onloadcomplete()" onloaddone="events.onloaddone()" onxmlcomplete="events.onxmlcomplete()" />

and in javascript
...

interval = setInterval(loadPanoXML, 500);
function loadPanoXML() {
clearInterval(interval);
try{
var krpano = $("#krpanoContainer").get(0);
if(krpano){
krpano.set('events.onxmlcomplete',hideprogressbar());
krpano.set('events.onloaded',hideprogressbar1());
krpano.set('events.onloaddone',hideprogressbar2());
}
}catch(e){
console.log(e);
}
}

on the above code i am getting all events together at the same time. even on the same images are loading only.. when we rotate the image some images are not loaded on stage.

plz provided some solution for this.

regards

Jophine

7

Saturday, October 6th 2012, 4:40pm

Hi,
How can we get a even to javascript class where all images are loaded
just:

xml:

Source code

1
<events onloadcomplete="js( js_onloadcomplete() );" />


js:

Source code

1
2
3
4
function js_onloadcomplete()
{
  ...
}



<events onmousedown="set(syncother,true);" onmousewheel="events.onmousedown();" onloadcomplete="events.onloadcomplete()" onloaddone="events.onloaddone()" onxmlcomplete="events.onxmlcomplete()" />
That code doesn't make any sense - should the events call their-self again? That should result in an end-less loop... (which should be automatically stopped after some time when the limit of actions will be reached).

Best regards,
Klaus

jophine

Beginner

  • "jophine" started this thread

Posts: 10

Location: India

Occupation: Developer

  • Send private message

8

Wednesday, October 17th 2012, 9:37am

Dynamically set data to xml

Thank you very much

but still i have some more issues in krpano javascript version

1. if we can generate an xml dynamically and pass with parameter like

Source code

1
2
3
krpano.call("loadxml(" + escape(generateXML(true)) + ")");"

function generateXML(flag) {	var xmlString = "  loadscene(get(scene[0].name), null, MERGE); set(isFlag,+this.flag+); 	 	  	     			   		 	 "		return xmlString;}


here i could not able to set the value of isFlag is any way to set this.

2. for make a call to loadxml is required some time delay

Source code

1
 viewer = createPanoViewer({ swf: "pano.swf", id: "krpano", xml: xmlPath, target: container, width: width, height: height }); viewer.addParam("wmode", "transparent"); // viewer.call("loadxml(" + escape(generateXML(true)) + ")");"    ------------ this line gives error 



without any interval how can i call loadxml and pass the xml

getting stuck with these issues in out project
plz provide help for me

9

Wednesday, October 24th 2012, 12:34pm

Hi,

the 'viewer' embedding object doesn't provide a 'call' function!
See here for the functions of that object:
http://krpano.com/docu/html/#embeddingobject

You would need to use the object with the with embedding 'id':
http://krpano.com/docu/js/#top

And note - this object will be created dynamically and so you need to wait it is loaded/created/embedded and ready of course!
Either (constantly) check if that object and its set/get/call functions are already there or better use a callback from xml to js to make sure the viewer is ready.

Best regards,
Klaus

10

Tuesday, November 7th 2017, 9:46pm

hello,

I've got this to work with loadxml via events tag, but the downside is I need to have my function in window scope. is there any way I could supply function reference to loadxml, so that local scope function could be used to handle load completion?

thanks.

11

Monday, November 13th 2017, 10:55pm

There are several possibilities - e.g. here one - set a krpano variable to your JS function, then call krpano code and after it you function.
That function will be still the in the right scope.

Source code

1
2
3
4
5
6
7
8
9
10
function test()
{
  ...
  krpano.set("mycallback", function()
  {
    console.log("done...");
  });

  krpano.call("loadxml(...); mycallback();");
}

12

Friday, November 17th 2017, 1:12am

Thanks, this helps.

Actually wait, it's not ( It does not seem to wait for the image to load, but fires right away with loadxml call.

This post has been edited 1 times, last edit by "makc" (Nov 17th 2017, 1:28am)