Sie sind nicht angemeldet.

jophine

Anfänger

  • »jophine« ist der Autor dieses Themas

Beiträge: 10

Wohnort: India

Beruf: Developer

  • Nachricht senden

1

Montag, 24. September 2012, 14:25

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

Donnerstag, 27. September 2012, 09:27

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

Anfänger

  • »jophine« ist der Autor dieses Themas

Beiträge: 10

Wohnort: India

Beruf: Developer

  • Nachricht senden

3

Donnerstag, 27. September 2012, 12:35

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

Freitag, 28. September 2012, 13:24

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

Quellcode

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


html/js:

Quellcode

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



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

Quellcode

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


best regards,
Klaus

jophine

Anfänger

  • »jophine« ist der Autor dieses Themas

Beiträge: 10

Wohnort: India

Beruf: Developer

  • Nachricht senden

5

Donnerstag, 4. Oktober 2012, 08:40

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

Anfänger

  • »jophine« ist der Autor dieses Themas

Beiträge: 10

Wohnort: India

Beruf: Developer

  • Nachricht senden

6

Freitag, 5. Oktober 2012, 14:10

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

Samstag, 6. Oktober 2012, 16:40

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

xml:

Quellcode

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


js:

Quellcode

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

Anfänger

  • »jophine« ist der Autor dieses Themas

Beiträge: 10

Wohnort: India

Beruf: Developer

  • Nachricht senden

8

Mittwoch, 17. Oktober 2012, 09:37

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

Quellcode

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

Quellcode

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

Mittwoch, 24. Oktober 2012, 12:34

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

Dienstag, 7. November 2017, 21:46

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

Montag, 13. November 2017, 22:55

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.

Quellcode

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

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

12

Freitag, 17. November 2017, 01:12

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.

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »makc« (17. November 2017, 01:28)